Send a message in a live chat
POST
/openapi/chat/sendmessage
const url = 'https://open-api.replyco.com/openapi/chat/sendmessage';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json-patch+json'}, body: '{ "chatId": "2e7f4a96-8b1c-4d3e-a5f7-9c2b6e4d1a83", "text": "Yes, until it ships. Which address should we use?" }'};
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/chat/sendmessage \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json-patch+json' \ --data '{ "chatId": "2e7f4a96-8b1c-4d3e-a5f7-9c2b6e4d1a83", "text": "Yes, until it ships. Which address should we use?" }'Sends a new message in an active live chat conversation.
Required fields:
- ChatId
- MessageText (or attachments)
Optional fields:
- Attachments
- IsInternal (for internal notes)
Sample request:
POST /chat/sendMessage
{
"chatId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"messageText": "Hello! How can I help you today?",
"isInternal": false
}
Authorizations
Section titled “Authorizations”Request Body
Section titled “Request Body”Message details including chat ID and content
object
chatId
string format: uuid
text
string
base64
string
fileName
string
Example
{ "chatId": "2e7f4a96-8b1c-4d3e-a5f7-9c2b6e4d1a83", "text": "Yes, until it ships. Which address should we use?"}object
chatId
string format: uuid
text
string
base64
string
fileName
string
Example generated
{ "chatId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "text": "example", "base64": "example", "fileName": "example"}object
chatId
string format: uuid
text
string
base64
string
fileName
string
Example generated
{ "chatId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "text": "example", "base64": "example", "fileName": "example"}object
chatId
string format: uuid
text
string
base64
string
fileName
string
Example generated
{ "chatId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "text": "example", "base64": "example", "fileName": "example"}Responses
Section titled “Responses”Message was sent successfully
Invalid request (e.g., missing required fields, chat is closed)
User is not authenticated or authorized
Chat with the specified ID was not found