Skip to main content

Upload attachment

Uploads a file (image or PDF) to attach it to a message. The response returns a { url, name, type } object that you pass as-is in the attachment field of Send message. The file isn’t sent in the chat body: first you upload it with this endpoint and then you reference it by its URL. Uploading a file doesn’t consume credits. The cost is charged when you send the message.
Required scope: chat:write

Path parameters


Request body

The body must be multipart/form-data with a single field:

Allowed types and sizes


Response

Code: 201 Created

Response fields


Full example: upload and send

1. Upload the file
2. Send the message with the attachment Use the data object from the previous response as attachment. The message field is still required.
Only attachments uploaded with this endpoint are processed. If attachment.url points to another site, the agent can’t see the file.

Common errors