How It Works
The API v2 uses cursor-based pagination for all list endpoints. Cursors are opaque, base64-encoded strings — treat them as opaque tokens and do not attempt to decode or construct them.Query Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
cursor | string | — | Opaque cursor from a previous response. Omit to start from the beginning. |
limit | integer | 20 | Number of items per page. Range: 1–100. |
Response Shape
All paginated responses follow this structure:| Field | Type | Description |
|---|---|---|
data | array | The page of results. |
pagination.cursor | string | null | Cursor to pass for the next page. null when there are no more results. |
pagination.hasMore | boolean | true if more results are available beyond this page. |
pagination.total | integer | Total number of items matching the query. |
Paginating Through All Results
Pass thecursor from each response into the next request to iterate through all pages:
Message Pagination
The messages endpoint (GET /api/v2/agents/{agentId}/conversations/{conversationId}/messages) paginates backward from the newest messages. Within each page, messages are returned in chronological order.
This means:
- The first page contains the most recent messages
- Passing the
cursorfetches the next older page - Each page’s messages are ordered oldest → newest