API Reference
List conversations for an agent. Uses cursor-based pagination. Requires Plus plan or higher.
/api/v1/agents/{id}/conversations
Plus+| Name | Type | Required | Description |
|---|---|---|---|
| id | integer | Required | Agent ID |
| Name | Type | Required | Description |
|---|---|---|---|
| limit | integer | Max items per page (1–100). Default: 20 | |
| cursor | string | Cursor from previous response for next page |
| Field | Type | Description |
|---|---|---|
conversations | array | List of conversation objects |
nextCursor | string | null | Cursor for next page, or null if no more |
Each conversation includes: id, messageCount, lastMessageAt, createdAt.
json
{
"conversations": [
{
"id": "clx123abc456",
"messageCount": 5,
"lastMessageAt": "2025-02-24T11:45:00.000Z",
"createdAt": "2025-02-24T11:30:00.000Z"
}
],
"nextCursor": "clx123abc457"
}bash
curl -X GET "https://chatspark.io/api/v1/agents/123/conversations?limit=20" \
-H "Authorization: Bearer cs_live_..."javascript
const res = await fetch(`${API_BASE}/agents/123/conversations?limit=20`, {
headers: { "Authorization": "Bearer cs_live_..." },
});
const { conversations, nextCursor } = await res.json();