Chatspark
K

API Reference

v1
K

List Conversations

List conversations for an agent. Uses cursor-based pagination. Requires Plus plan or higher.

GET

/api/v1/agents/{id}/conversations

Plus+

Path Parameters

NameTypeRequiredDescription
idintegerRequired

Agent ID

Query Parameters

NameTypeRequiredDescription
limitinteger

Max items per page (1–100). Default: 20

cursorstring

Cursor from previous response for next page

Response Schema

FieldTypeDescription
conversationsarrayList of conversation objects
nextCursorstring | nullCursor 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"
}

cURL

bash

curl -X GET "https://chatspark.io/api/v1/agents/123/conversations?limit=20" \
  -H "Authorization: Bearer cs_live_..."

Node.js

javascript

const res = await fetch(`${API_BASE}/agents/123/conversations?limit=20`, {
  headers: { "Authorization": "Bearer cs_live_..." },
});
const { conversations, nextCursor } = await res.json();

Previous

Delete Agent

Next

Get Conversation