Get Chat Messages
Chats
Get Chat Messages
GET
Get Chat Messages
Get Chat Messages
This endpoint retrieves paginated messages from a specific chat session. Messages are returned in chronological order and include both user and AI assistant messages.Authentication
Authentication header with your tenant’s API key
Path Parameters
The unique identifier (UUID) of the chat whose messages you want to retrieve
Query Parameters
The number of messages to skip before starting to collect results
The maximum number of messages to return (max 100)
Sort order for messages by creation time. Options: ‘asc’ (oldest first) or ‘desc’ (newest first)
Response
Array of message objects from the chat
Total number of messages in this chat
Current offset value used for pagination
Current limit value used for pagination
Indicates if there are more messages available
Message Object
Unique identifier for the message
The text content of the message
Role of the message sender. Values: ‘user’ or ‘assistant’
Type of media attachment, if any (e.g., ‘image’, ‘file’)
URL to the media attachment, if any
Timestamp when the message was created
Additional metadata associated with the message
Error Responses
400: Bad Request
400: Bad Request
Invalid query parameters (e.g., limit exceeds maximum)
401: Unauthorized
401: Unauthorized
404: Not Found
404: Not Found
Chat not found or doesn’t belong to your tenant
500: Internal Server Error
500: Internal Server Error
Server error processing the request
Example Usage
cURL
JavaScript
Python
React Component Example
Pagination Example
To load all messages in a chat, you can implement pagination:Notes
- Messages are returned in chronological order when using
order=asc(recommended for chat display) - Use
order=descto get the most recent messages first - The maximum
limitis 100 messages per request - Empty chats will return an empty messages array with
total: 0 - Media attachments (if any) are referenced via
media_urlfields - Message metadata may contain additional information like AI model details or user context