Upload file attachments
Post the necessary fields for the API to upload files. The files need to be a buffer with the key “fileAttachment”.
The allowed file types are:
- JPG
- JPEG
- PNG
- MP4
- MPEG
- ZIP
- RAR
- DOC
- DOCX
- TXT
- MP3
- WAV
The API will return an object with the URLs
POST
/
conversations
/
messages
/
upload
Upload file attachments
curl --request POST \
--url https://services.leadconnectorhq.com/conversations/messages/upload \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--header 'Version: <version>' \
--form conversationId=ve9EPM428h8vShlRW1KT \
--form 'locationId=<string>' \
--form 'attachmentUrls=<string>'const form = new FormData();
form.append('conversationId', 've9EPM428h8vShlRW1KT');
form.append('locationId', '<string>');
form.append('attachmentUrls', '<string>');
const options = {
method: 'POST',
headers: {Version: '<version>', Authorization: 'Bearer <token>'}
};
options.body = form;
fetch('https://services.leadconnectorhq.com/conversations/messages/upload', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://services.leadconnectorhq.com/conversations/messages/upload"
payload = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"conversationId\"\r\n\r\nve9EPM428h8vShlRW1KT\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"locationId\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"attachmentUrls\"\r\n\r\n<string>\r\n-----011000010111000001101001--"
headers = {
"Version": "<version>",
"Authorization": "Bearer <token>"
}
response = requests.post(url, data=payload, headers=headers)
print(response.text){
"uploadedFiles": {}
}{
"statusCode": 400,
"message": "Bad Request"
}{
"statusCode": 401,
"message": "Invalid token: access token is invalid",
"error": "Unauthorized"
}{
"status": 413,
"message": "Failed to upload the files"
}{
"status": 413,
"message": "Failed to upload the files"
}Authorizations
Body
multipart/form-data
Last modified on March 8, 2026
Was this page helpful?
Upload file attachments
curl --request POST \
--url https://services.leadconnectorhq.com/conversations/messages/upload \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--header 'Version: <version>' \
--form conversationId=ve9EPM428h8vShlRW1KT \
--form 'locationId=<string>' \
--form 'attachmentUrls=<string>'const form = new FormData();
form.append('conversationId', 've9EPM428h8vShlRW1KT');
form.append('locationId', '<string>');
form.append('attachmentUrls', '<string>');
const options = {
method: 'POST',
headers: {Version: '<version>', Authorization: 'Bearer <token>'}
};
options.body = form;
fetch('https://services.leadconnectorhq.com/conversations/messages/upload', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://services.leadconnectorhq.com/conversations/messages/upload"
payload = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"conversationId\"\r\n\r\nve9EPM428h8vShlRW1KT\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"locationId\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"attachmentUrls\"\r\n\r\n<string>\r\n-----011000010111000001101001--"
headers = {
"Version": "<version>",
"Authorization": "Bearer <token>"
}
response = requests.post(url, data=payload, headers=headers)
print(response.text){
"uploadedFiles": {}
}{
"statusCode": 400,
"message": "Bad Request"
}{
"statusCode": 401,
"message": "Invalid token: access token is invalid",
"error": "Unauthorized"
}{
"status": 413,
"message": "Failed to upload the files"
}{
"status": 413,
"message": "Failed to upload the files"
}