List Conversation Messages
Retrieve one page of a conversation's messages, newest first. Obtain conversation_id from List Conversations or data.conversation.id in a message webhook. Follow links.next to read older pages. Each message's identifier is data[].id.
GET https://developers.chatway.app/api/v1/conversations/{conversation_id}/messagesExample request
curl -G "https://developers.chatway.app/api/v1/conversations/0f46c0a1-8938-40e3-b2b5-bb56f569fcab/messages" \
-H "X-API-KEY: your_api_key" \
--data-urlencode "limit=20" \
--data-urlencode "page=1"Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
limit | query | No | integer|null | Maximum messages per page. Default: 20. Allowed range: 1–20. |
page | query | No | integer|null | Page number, starting at 1. Default: 1. |
include_fields | query | No | string|null | Allowed: conversation_id, chat_contact_id, agent, contact, origin, content, type, created_at. Example: `content,type`. If both this and exclude_fields are sent, only include_fields is applied. |
exclude_fields | query | No | string|null | Allowed: conversation_id, chat_contact_id, agent, contact, origin, content, type, created_at. Ignored when include_fields is also present (include takes precedence). |
conversation_id | path | Yes | string | Conversation ID Example: 0f46c0a1-8938-40e3-b2b5-bb56f569fcab |
search | query | No | string | Optional search term for this conversation's messages. Omit it to request messages without a search filter. |
Responses
200
Paginated list responses include data, meta.pagination, and links. Use the page and limit query parameters to walk results. Follow links.next until it is null, or increment page until current_page >= total_pages.
| Field | Description |
|---|---|
meta.pagination.total |
Total records across all pages |
meta.pagination.count |
Records returned on this page |
meta.pagination.per_page |
Page size used for this response (matches limit) |
meta.pagination.current_page |
Current page number (1-based) |
meta.pagination.total_pages |
Total number of pages |
links.next |
URL for the next page, or null on the last page |
links.first / links.last |
First and last page URLs |
application/json
data (array<object>, required)type (string, required)id (string, required)attributes (object, required)— Returned attributes depend on include_fields and exclude_fields. Filtered-out attributes are omitted. The field types below apply when an attribute is present. If both filters are supplied, only include_fields is applied.conversation_id (string)chat_contact_id (string|null)agent (object|null)id (string|null, required)name (string|null, required)
contact (object|null)id (string|null, required)name (string|null, required)email (string|null, required)phone (string|null, required)
origin (string)content (string)type (string)created_at (string|null)
meta (object, required)pagination (object, required)total (integer, required)count (integer, required)per_page (integer, required)current_page (integer, required)total_pages (integer, required)
links (object, required)self (string, required)first (string, required)next (string|null, required)last (string, required)
404
Conversation not found
application/json
message (string, required)
422
Examples
Response 200 example
{
"data": [
{
"type": "messages",
"id": "5d2c8f3e-7a41-4b9e-9c06-1f8e2b7a4d93",
"attributes": {
"conversation_id": "0f46c0a1-8938-40e3-b2b5-bb56f569fcab",
"chat_contact_id": "9b0c5fe6-35ad-459d-b6ba-4288191f84f1",
"agent": null,
"contact": {
"id": "9b0c5fe6-35ad-459d-b6ba-4288191f84f1",
"name": "John Doe",
"email": "[email protected]",
"phone": "+1XXXXXXXXXX"
},
"origin": "chat",
"content": "Hello, I need help",
"type": "message",
"created_at": "2026-02-04T10:30:00Z"
}
}
],
"meta": {
"pagination": {
"total": 1,
"count": 1,
"per_page": 20,
"current_page": 1,
"total_pages": 1
}
},
"links": {
"self": "https://developers.chatway.app/api/v1/conversations/0f46c0a1-8938-40e3-b2b5-bb56f569fcab/messages?page=1",
"first": "https://developers.chatway.app/api/v1/conversations/0f46c0a1-8938-40e3-b2b5-bb56f569fcab/messages?page=1",
"next": null,
"last": "https://developers.chatway.app/api/v1/conversations/0f46c0a1-8938-40e3-b2b5-bb56f569fcab/messages?page=1"
}
}