Skip to main content
POST
Start an attachment upload

Authorizations

Authorization
string
header
required

Use a workspace API key in the Authorization header. Keys use pk_live_<key_id> for production and pk_test<key_id>_ for test mode.

Headers

Idempotency-Key
string
required
Required string length: 8 - 128

Body

application/json
filename
string
required
Required string length: 1 - 255
contentType
enum<string>
required
Available options:
image/jpeg,
image/png,
image/webp,
image/gif,
audio/mpeg,
audio/ogg,
audio/wav,
audio/mp4,
audio/webm,
video/mp4,
video/webm,
video/quicktime,
application/pdf,
text/plain,
text/csv
sizeBytes
integer
required
Required range: 1 <= x <= 16777216
sha256
string
required
Pattern: ^[a-f0-9]{64}$

Response

This upload already completed. Reuse the attachment.

uploadId
string
required
status
enum<string>
required
Available options:
pending,
ready
url
string<uri>

Temporary PUT URL, present only while pending.

method
enum<string>
Available options:
PUT
headers
object
expiresAt
string<date-time>
maxSizeBytes
integer
attachment
object

Present only when ready. Use this object in a message's attachments array.