Overview
The/agents/session/messages/list endpoint lets you retrieve messages from a conversation thread. This is useful when you want to:
- Display conversation history in an external UI
- Process or analyze past agent interactions
- Build integrations that react to agent conversation content
Prerequisites
Before you begin, make sure you have:- A Kaizen API key (found in your organization settings)
- A thread ID from an existing agent conversation
Authentication
All API requests require a Bearer token in theAuthorization header:
Listing Messages
Send a POST request with thethreadId to retrieve messages. The endpoint returns up to 1000 messages per page.
Request
Response
Pagination
The endpoint supports offset-based pagination. Use thelimit and offset parameters to page through results.
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
threadId | string | - | Required. External ID of the thread. |
limit | number | 1000 | Maximum messages to return (1-1000). |
offset | number | 0 | Number of messages to skip from the beginning. |
Example: Fetching the Second Page
total field in the response to determine how many pages exist.
Message Types
Every message has arole field indicating who sent it.
User Messages
Sent by the user to instruct the agent. Contains an array of content parts.Assistant Messages
Sent by the agent. There are two variants: Text reply — the agent responds with text content:Tool Messages
Results returned by a tool invocation. ThetoolCallId links back to the corresponding tool call.
Developer Messages
System-level messages generated during the conversation (e.g., file downloads completed, CAPTCHA solving events, tab creation). These provide context about background operations.Content Part Types
Each message contains an array ofparts. The supported types are:
| Type | Fields | Description |
|---|---|---|
text | text | Plain text content. |
file | fileId | Reference to an uploaded file. |
json | data | Structured key-value JSON data. |