List messages in a chat conversation
Retrieves messages in a specific conversation within a chat with cursor-based pagination. Messages are sorted chronologically from oldest to newest.
Use the beforeUUID parameter to get older messages and the afterUUID parameter to get newer messages. Please note:
- When
beforeUUIDis specified, the most recent messages beforebeforeUUIDare returned. - When
beforeUUIDandafterUUIDare both specified, the most recent messages beforebeforeUUIDare returned. - When
afterUUIDis specified on its own, the least recent messages afterafterUUIDare returned.
GET
/v1/replicas/{replicaUUID}/chats/{chatUUID}/conversations/{conversationUUID}/messages
curl \
--request GET 'https://api.sensay.io/v1/replicas/03db5651-cb61-4bdf-9ef0-89561f7c9c53/chats/8e9309af-baa4-4a85-8c59-c3a2a0c2ad0f/conversations/8e9309af-baa4-4a85-8c59-c3a2a0c2ad0f/messages' \
--header "X-ORGANIZATION-SECRET: $API_KEY" \
--header "X-USER-ID: $API_KEY" \
--header "X-API-Version: 2025-03-25"
Response examples (200)
{
"success": true,
"items": [
{
"uuid": "03db5651-cb61-4bdf-9ef0-89561f7c9c53",
"createdAt": "2024-09-24T09:09:55.66709+00:00",
"content": "Hello world!",
"role": "user",
"senderName": "John Doe",
"senderProfileImageURL": "https://example.com/avatar.png",
"source": "web",
"replicaUUID": "03db5651-cb61-4bdf-9ef0-89561f7c9c53"
}
]
}
Response examples (400)
{
"error": "A text representation of the error",
"success": false,
"request_id": "xyz1::reg1:reg1::ab3c4-1234567890123-0123456789ab",
"fingerprint": "14fceadd84e74ec499afe9b0f7952d6b"
}
Response examples (401)
{
"error": "A text representation of the error",
"success": false,
"request_id": "xyz1::reg1:reg1::ab3c4-1234567890123-0123456789ab",
"fingerprint": "14fceadd84e74ec499afe9b0f7952d6b"
}
Response examples (404)
{
"error": "A text representation of the error",
"success": false,
"request_id": "xyz1::reg1:reg1::ab3c4-1234567890123-0123456789ab",
"fingerprint": "14fceadd84e74ec499afe9b0f7952d6b"
}
Response examples (415)
{
"error": "A text representation of the error",
"success": false,
"request_id": "xyz1::reg1:reg1::ab3c4-1234567890123-0123456789ab",
"fingerprint": "14fceadd84e74ec499afe9b0f7952d6b"
}
Response examples (500)
{
"error": "A text representation of the error",
"success": false,
"request_id": "xyz1::reg1:reg1::ab3c4-1234567890123-0123456789ab",
"fingerprint": "14fceadd84e74ec499afe9b0f7952d6b",
"inner_exception": {
"name": "Server overheated",
"cause": "Request too complicated",
"stack": "Error: Server overheated due to an unexpected situation\n at Object.eval (eval at <anonymous>...",
"message": "The server overheated due to an unexpected situation"
}
}