Set attachments on an existing message (replaces existing). Maximum 5 URLs. Supported for TYPE_CUSTOM_CALL (34) and TYPE_CALL (1) with subType EXTERNAL_CALL.
http
PUT https://services.leadconnectorhq.com/conversations/messages/{messageId}/attachmentsAuthorization
| Name | Type | Required | Example | Description |
|---|---|---|---|---|
Authorization | string | Yes | Bearer token generated from the Leadway portal. See Authentication. | |
Version | string | Yes | 2021-07-28 | API version. |
Path parameters
| Name | Type | Required | Example | Description |
|---|---|---|---|---|
messageId | string | Yes | ve9EPM428h8vShlRW1KT | Message Id |
Body
| Name | Type | Required | Example | Description |
|---|---|---|---|---|
attachments | string[] | Yes | Array of attachment URLs to set on the message (replaces existing). Maximum 5 URLs. |
Responses
200 - Successfully set message attachments
400 - Bad Request
json
{}403 - Message type does not support attachment updates
404 - Message not found
Example
curl -X PUT 'https://services.leadconnectorhq.com/conversations/messages/YOUR_messageId/attachments' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Version: 2021-07-28' \
-H 'Content-Type: application/json' \
-d '{
"attachments": [
"https://provider.com/recordings/call-123.mp3"
]
}'const response = await fetch('https://services.leadconnectorhq.com/conversations/messages/YOUR_messageId/attachments', {
method: 'PUT',
headers: {
Authorization: `Bearer ${process.env.LEADWAY_TOKEN}`,
Version: '2021-07-28',
'Content-Type': 'application/json',
},
body: JSON.stringify({"attachments": ["https://provider.com/recordings/call-123.mp3"]}),
});
const data = await response.json();import os, requests
response = requests.request(
'PUT',
'https://services.leadconnectorhq.com/conversations/messages/YOUR_messageId/attachments',
headers={
'Authorization': f"Bearer {os.environ['LEADWAY_TOKEN']}",
'Version': '2021-07-28',
'Content-Type': 'application/json',
},
json={"attachments": ["https://provider.com/recordings/call-123.mp3"]},
)
data = response.json()<?php
$ch = curl_init('https://services.leadconnectorhq.com/conversations/messages/YOUR_messageId/attachments');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'PUT',
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('LEADWAY_TOKEN'),
'Version: 2021-07-28',
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode({'attachments': ['https://provider.com/recordings/call-123.mp3']}),
]);
$data = json_decode(curl_exec($ch), true);