Skip to content

Send Message



POST /admin/message

Sends a message to a specific conversation. The message can include text, attachments, and optional metadata. All online participants of the conversation will receive the message in real-time.

{ Admin-Api-Key: {{ HTTP_ADMIN_API_KEY }} }

Content-Type: application/json

{
"organizationId": "680a2fae96cc69d78861f101",
"senderId": "63480e68f4794709f802a2fa",
"message": {
"id": "5а34p21m0xj23",
"body": "hey how is going?",
"cid": "63480e68f4794709f802a2fa",
"x": {
"param1": "value",
"param2": "value"
},
"attachments": [
{ "name": "file_1", "size": 240, "content_type": "type" },
{ "name": "file_2", "size": 126, "content_type": "type" }
]
}
}
FieldTypeDescription
organizationIdstringOrganizationId performing request
senderIdstringUser ID of the sender
message.idstringUnique message ID received from the server** (i.e., server_mid from a previous response), used for tracking and acknowledgment
message.bodystringThe message text
message.cidstringConversation ID the message belongs to
message.xobjectCustom parameters, e.g. { "new_friend_connected": true }
message.attachmentsarray of objectArray of attachment metadata
{
"ask": {
"mid": "5а34p21m0xj23",
"server_mid": "63480e68f4794709f802a2fd",
"t": 15673838834
}
}
{
"message": {
"_id": "63480e68f4794709f802a2fa",
"t": 15673838833,
"from": "634ec51c0b65918393dca5bf",
"body": "hey how is going?",
"cid": "63480e68f4794709f802a2fa",
"x": {
"param1": "value",
"param2": "value"
},
"attachments": [
{ "file_id": "123123_file_1", "file_name": "file_1" },
{ "file_id": "653534_file_2", "file_name": "file_2" }
],
"created_at": "2023-07-04T07:23:53.308Z"
}
}