Upload file attachments
POST/conversations/messages/upload
Post the necessary fields for the API to upload files. The files need to be a buffer with the key "fileAttachment".
Note: One of conversationId or contactId must be provided.
File Size Limits:
- Maximum file size: 5 MB
- Maximum files per upload: 5
Allowed file types:
Images: JPG, JPEG, PNG, GIF, SVG, HEIC, AI
Videos: MP4, MPEG, 3GP
Audio: MP3, WAV, WAVE, AIFF, AIF, AIFC, GSM, ULAW, OGG, AAC, M4A, AMR
Documents: PDF, DOC, DOCX, TXT, CSV, XLS, XLSX, PPT, PPTX, ODT
Archives: ZIP, RAR
Other: VCF, VCARD (contact files), ICS (calendar files)
The API will return an object with the URLs
File-service storage: Attachments are stored in the files service, and every response includes
uploadedFileDetails. The returned file-service URLs are publicly accessible for one hour after upload. After that window, the attachment becomes private. To render, download, or retry access, extract the {slug} from the returned /files/d/{slug} URL and call GET /files/d/{slug} with a bearer token that includes the files.readonly OAuth scope. The Files API returns a short-lived signed download URL.
Request
Version stringrequired
API Version
Available options
v4- multipart/form-data
- Body
- Example (auto)
Bodyrequired
conversationIdstring
Conversation Id
contactIdstring
Contact Id
workflowIdstring
Workflow Id
campaignIdstring
Campaign Id
locationIdstringrequired
attachmentUrlsstring[]required
{
"conversationId": "ve9EPM428h8vShlRW1KT",
"contactId": "ve9EPM428h8vShlRW1KT",
"workflowId": "ve9EPM428h8vShlRW1KT",
"campaignId": "ve9EPM428h8vShlRW1KT",
"locationId": "string",
"attachmentUrls": [
"string"
]
}
Uploaded the file successfully
- application/json
- Schema
- Example (auto)
Schema
uploadedFilesobjectrequired
uploadedFileDetailsobject[]required
Per-file metadata for each uploaded attachment.
{
"uploadedFiles": {},
"uploadedFileDetails": [
{
"name": "report.pdf",
"url": "https://services.leadconnectorhq.com/files/d/k3Jq9XwP2vLm",
"assetId": "9f1c2a3b-7d4e-4a8b-9c1f-2e3d4a5b6c7d",
"size": 184320
}
]
}