List conversations for a user
GET/v2/agents/{agentId}/users/{userId}/conversations
Return the conversations of one user across an agent, newest first, so you can show a chat history in your own app.
Working draft. These docs are illustrative: names, endpoints and examples describe the intended behaviour and can change before launch.
Returns the conversations that belong to one userId, newest first. Call it to show a customer their earlier chats, or to find everything one person said before you answer a data request.
Request
GET /v2/agents/{agentId}/users/{userId}/conversations
Path parameters:
| Name | Type | Required | Description |
|---|---|---|---|
agentId |
string | Yes | The ID of the agent, starting with agt_. |
userId |
string | Yes | The ID you sent as userId in chat requests, starting with usr_. |
Query parameters:
| Name | Type | Required | Description |
|---|---|---|---|
limit |
integer | No | Items per page, from 1 to 100. Defaults to 20. |
cursor |
string | No | The nextCursor value from the previous page. |
status |
string | No | open, resolved or handoff. |
Only conversations with this agent are returned. If the person talked to several agents, call the endpoint for each one. The concept is explained in User conversations.
Example request
curl "https://api.askocto.co/v2/agents/agt_8f3k2m/users/usr_3b6t0z/conversations?limit=10" \
-H "Authorization: Bearer $OCTO_API_KEY"
const response = await fetch(
"https://api.askocto.co/v2/agents/agt_8f3k2m/users/usr_3b6t0z/conversations?limit=10",
{ headers: { Authorization: `Bearer ${process.env.OCTO_API_KEY}` } },
)
const { data, nextCursor } = await response.json()
console.log(`${data.length} conversations`, nextCursor)
Example response
A successful call returns 200 OK.
{
"data": [
{
"id": "conv_5n2p8w",
"agentId": "agt_8f3k2m",
"userId": "usr_3b6t0z",
"channel": "widget",
"status": "handoff",
"messageCount": 6,
"createdAt": "2026-03-20T13:58:00Z",
"updatedAt": "2026-03-20T14:05:00Z"
},
{
"id": "conv_1d9k4x",
"agentId": "agt_8f3k2m",
"userId": "usr_3b6t0z",
"channel": "email",
"status": "resolved",
"messageCount": 4,
"createdAt": "2026-03-02T10:20:00Z",
"updatedAt": "2026-03-02T10:41:00Z"
}
],
"nextCursor": null
}
Response fields
The items are conversation objects, with the fields described in List conversations. nextCursor is a string while more conversations are available and null on the last page.
A user without any conversation returns an empty data array, not an error. To read the text of one conversation, call List conversation messages with its id.
Errors
| Status | Code | When |
|---|---|---|
| 400 | invalid_request |
limit is outside 1 to 100, or status has an unknown value. |
| 401 | unauthorized |
The API key is missing, malformed or deleted. |
| 404 | not_found |
No agent has this ID in your workspace. |
| 429 | rate_limited |
Too many requests. Wait for the number of seconds in the Retry-After header. |