Documentation
Upload file
POST
/api/bot/uploadUpload a file and attach it to a chat as a message. Files are stored in S3 and served via signed URLs.
Request body
| Parameter | Type | Description |
|---|---|---|
chatId* | string | Target chat ID |
file* | file | File binary or base64-encoded content |
filename | string | Original filename (e.g. invoice.pdf) |
contentType | string | MIME type of the file (e.g. image/png) |
Supported file types
| Content type | Max size |
|---|---|
image/* | 10 MB |
application/pdf | 25 MB |
text/* | 5 MB |
Example request
terminal
curl -X POST https://app.bx-livechat.com/api/bot/upload \
-H "Authorization: Bearer bxl_pat_aB7XyZ..." \
-F "chatId=clxyz1234567890abc" \
-F "file=@/path/to/screenshot.png" \
-F "filename=screenshot.png" \
-F "contentType=image/png"Response
200 OK
{
"messageId": "clxyz0987654321def",
"fileUrl": "https://s3.amazonaws.com/bxlivechat/org_abc/clxyz.../screenshot.png?X-Amz-Signature=..."
}Pre-validation
Files are validated for type and size before upload. Rejected files return
400 with a clear error message.