Send a new message to a thread
const url = 'https://open-api.replyco.com/openapi/message/send';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json-patch+json'}, body: '{ "threadId": "7d2e9b14-5c3a-4f61-9a8e-2b6c0d4e1f37", "htmlBody": "<p>Hi Jane,</p><p>We have sent a replacement today.</p>", "text": "Hi Jane,\n\nWe have sent a replacement today.", "closeAfterSend": false }'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://open-api.replyco.com/openapi/message/send \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json-patch+json' \ --data '{ "threadId": "7d2e9b14-5c3a-4f61-9a8e-2b6c0d4e1f37", "htmlBody": "<p>Hi Jane,</p><p>We have sent a replacement today.</p>", "text": "Hi Jane,\n\nWe have sent a replacement today.", "closeAfterSend": false }'Sends a new message to an existing thread/ticket.
Required fields:
- threadId
- accountId
- htmlBody (or attachments)
Optional fields:
- text (plain text version of the message, required for eBay - see below)
- attachments
- languageCode
- closeAfterSend, archiveAfterSend
- isDelayed with sendingDate (schedule the message instead of sending it now)
- messageDate
Plain text integrations (eBay):
Some integrations do not accept HTML. For tickets on an eBay integration the message
content must be sent in text as plain text instead of htmlBody, otherwise the
request is rejected with 400. eBay also limits a reply to 4000 characters.
For all other integrations htmlBody is used, and sending text alongside it is still
recommended so the plain text version matches your formatting.
Attachments:
Each attachment needs a fileName including its extension, plus one of:
data- the base64 encoded content of a new file. This is the normal way to upload.url- a path returned by an earlier Replyco response, to re-use a file that is already stored. External addresses are not downloaded and will not produce a working attachment.
Limits depend on the integration the ticket belongs to. Files are rejected with 400 when a limit is exceeded, and executable file types are always rejected:
| Integration | File types | Per file | Per message | Max files |
|---|---|---|---|---|
| eBay | jpg, jpeg, png, gif, bmp, tif, tiff (pdf only when the file converter is enabled for your user) | 12 MB | - | 5 |
| eBay REST | any non-executable type | 10 MB | 25 MB | 5 |
| Amazon | any non-executable type | 10 MB | 6 MB | - |
| Cdiscount | any non-executable type | 10 MB | 4 MB | 3 |
| all others | any non-executable type | 10 MB | 25 MB | - |
eBay additionally rejects an image whose width plus height is more than 12000 pixels.
Size limits only apply to files sent as data; there is no size to check for an attachment
referenced by url, though its file type is still validated.
Sample request:
POST /message/send
{
"threadId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"accountId": "8a1b1d6c-5f1a-4c8e-9f2b-7d3e5a9c1b40",
"htmlBody": "Thank you for contacting us.",
"text": "Thank you for contacting us.",
"attachments": [
{
"fileName": "invoice.pdf",
"data": "JVBERi0xLjQKJcfsj6IKNSAwIG9iago8PC9MZW5ndGg..."
}
]
}
Sample request for a ticket on an eBay integration:
POST /message/send
{
"threadId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"accountId": "8a1b1d6c-5f1a-4c8e-9f2b-7d3e5a9c1b40",
"text": "Thank you for contacting us.",
"attachments": []
}
Authorizations
Section titled “Authorizations”Request Body
Section titled “Request Body”Message details including thread ID, content, and options
object
The ID of the thread/ticket to add this message to
The ID of the account/integration this message is associated with
Whether this message should be scheduled for later sending instead of being sent immediately. Default is false
The date and time when the message was originally created or received
The scheduled date and time when this message should be sent. Only applicable when IsDelayed is true
The HTML content of the message. This can include formatting, links, and embedded images
The plain text content of the message without HTML formatting
Whether to automatically close(resolve) the ticket after this message is sent. Default is false
Whether to automatically archive the ticket after this message is sent. Default is false
List of file attachments to include with this message. Can be empty if no attachments are needed
object
Path of a file already stored by Replyco, exactly as returned by a previous API response. Provide either ‘url’ or ‘data’ for each attachment. A URL is stored as given and is never downloaded, so an external address will not produce a working attachment
Required. The name of the file including its extension (e.g., “invoice.pdf”, “image.jpg”). The extension decides whether the integration accepts the file, so it must be present
Base64 encoded content of a new file to upload. Provide either ‘data’ or ‘url’. Size and file type limits apply and depend on the integration the ticket belongs to
The language code of the message content (e.g., “en”, “es”, “fr”). Used for translation and localization
Example
{ "threadId": "7d2e9b14-5c3a-4f61-9a8e-2b6c0d4e1f37", "htmlBody": "<p>Hi Jane,</p><p>We have sent a replacement today.</p>", "text": "Hi Jane,\n\nWe have sent a replacement today.", "closeAfterSend": false}object
The ID of the thread/ticket to add this message to
The ID of the account/integration this message is associated with
Whether this message should be scheduled for later sending instead of being sent immediately. Default is false
The date and time when the message was originally created or received
The scheduled date and time when this message should be sent. Only applicable when IsDelayed is true
The HTML content of the message. This can include formatting, links, and embedded images
The plain text content of the message without HTML formatting
Whether to automatically close(resolve) the ticket after this message is sent. Default is false
Whether to automatically archive the ticket after this message is sent. Default is false
List of file attachments to include with this message. Can be empty if no attachments are needed
object
Path of a file already stored by Replyco, exactly as returned by a previous API response. Provide either ‘url’ or ‘data’ for each attachment. A URL is stored as given and is never downloaded, so an external address will not produce a working attachment
Required. The name of the file including its extension (e.g., “invoice.pdf”, “image.jpg”). The extension decides whether the integration accepts the file, so it must be present
Base64 encoded content of a new file to upload. Provide either ‘data’ or ‘url’. Size and file type limits apply and depend on the integration the ticket belongs to
The language code of the message content (e.g., “en”, “es”, “fr”). Used for translation and localization
Example generated
{ "threadId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "accountId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "isDelayed": true, "messageDate": "2026-04-15T12:00:00Z", "sendingDate": "2026-04-15T12:00:00Z", "htmlBody": "example", "text": "example", "closeAfterSend": true, "archiveAfterSend": true, "attachments": [ { "url": "example", "fileName": "example", "data": "example" } ], "languageCode": "example"}object
The ID of the thread/ticket to add this message to
The ID of the account/integration this message is associated with
Whether this message should be scheduled for later sending instead of being sent immediately. Default is false
The date and time when the message was originally created or received
The scheduled date and time when this message should be sent. Only applicable when IsDelayed is true
The HTML content of the message. This can include formatting, links, and embedded images
The plain text content of the message without HTML formatting
Whether to automatically close(resolve) the ticket after this message is sent. Default is false
Whether to automatically archive the ticket after this message is sent. Default is false
List of file attachments to include with this message. Can be empty if no attachments are needed
object
Path of a file already stored by Replyco, exactly as returned by a previous API response. Provide either ‘url’ or ‘data’ for each attachment. A URL is stored as given and is never downloaded, so an external address will not produce a working attachment
Required. The name of the file including its extension (e.g., “invoice.pdf”, “image.jpg”). The extension decides whether the integration accepts the file, so it must be present
Base64 encoded content of a new file to upload. Provide either ‘data’ or ‘url’. Size and file type limits apply and depend on the integration the ticket belongs to
The language code of the message content (e.g., “en”, “es”, “fr”). Used for translation and localization
Example generated
{ "threadId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "accountId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "isDelayed": true, "messageDate": "2026-04-15T12:00:00Z", "sendingDate": "2026-04-15T12:00:00Z", "htmlBody": "example", "text": "example", "closeAfterSend": true, "archiveAfterSend": true, "attachments": [ { "url": "example", "fileName": "example", "data": "example" } ], "languageCode": "example"}object
The ID of the thread/ticket to add this message to
The ID of the account/integration this message is associated with
Whether this message should be scheduled for later sending instead of being sent immediately. Default is false
The date and time when the message was originally created or received
The scheduled date and time when this message should be sent. Only applicable when IsDelayed is true
The HTML content of the message. This can include formatting, links, and embedded images
The plain text content of the message without HTML formatting
Whether to automatically close(resolve) the ticket after this message is sent. Default is false
Whether to automatically archive the ticket after this message is sent. Default is false
List of file attachments to include with this message. Can be empty if no attachments are needed
object
Path of a file already stored by Replyco, exactly as returned by a previous API response. Provide either ‘url’ or ‘data’ for each attachment. A URL is stored as given and is never downloaded, so an external address will not produce a working attachment
Required. The name of the file including its extension (e.g., “invoice.pdf”, “image.jpg”). The extension decides whether the integration accepts the file, so it must be present
Base64 encoded content of a new file to upload. Provide either ‘data’ or ‘url’. Size and file type limits apply and depend on the integration the ticket belongs to
The language code of the message content (e.g., “en”, “es”, “fr”). Used for translation and localization
Example generated
{ "threadId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "accountId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "isDelayed": true, "messageDate": "2026-04-15T12:00:00Z", "sendingDate": "2026-04-15T12:00:00Z", "htmlBody": "example", "text": "example", "closeAfterSend": true, "archiveAfterSend": true, "attachments": [ { "url": "example", "fileName": "example", "data": "example" } ], "languageCode": "example"}Responses
Section titled “Responses”Message was sent successfully
Invalid request - missing required fields, invalid thread, or an attachment that is too large, of a file type the integration does not accept, or missing its file name. The response body carries the reason in its ‘error’ field
User is not authenticated or authorized
User does not have permission to send messages to this thread
Thread with the specified ID was not found