Use this endpoint to read what happened in a conversation: messages from the customer and agents, plus other conversation events.
Request
Send a GET request with the conversation ID in the path. There is no request body.
| Parameter | Type | Description |
|---|---|---|
cid (path) |
string | Conversation ID. |
start_id (query) |
string | Optional. Event ID to page from. |
limit (query) |
integer | Optional. Number of events to request. |
To read further, pass an event ID from your previous result as start_id. The response has no next_cursor or total; do not page by offset.
Response
A successful request returns HTTP 200 with a JSON array of events. There is no wrapper object. Selected fields:
[
{
"id": "event_example",
"account_id": "account_example",
"type": "message_sent",
"created": 1763107200000,
"by": {
"id": "user_example",
"type": "user"
},
"data": {
"message": {
"conversation_id": "conversation_example",
"format": "plaintext",
"text": "Hi, is my order ready?"
}
}
}
]
Treat an empty or null result as no events.
Read events correctly
- Check
typefirst. Not every event is a message. Readdata.messageonly for message events such asmessage_sent. - Check the sender.
by.typetells you whether a customer (user) or staff member (agent) acted, andby.ididentifies them. - Check the format. A message can be plain text, a block tree, or attachments only. See Message formats and Attachments.
- Deduplicate by
id. When syncing history with webhook events, use the eventidto avoid storing a message twice.
created is in Unix milliseconds.
HTTP request
Replace YOUR_CID with the conversation ID and YOUR_ACCESS_TOKEN with your token. Add start_id or limit to the query string when needed.
GET https://api.subiz.com.vn/4.0/conversations/YOUR_CID/messages
Authorization: Bearer YOUR_ACCESS_TOKEN