API Reference
Get a single conversation with its full message history. Requires Plus plan or higher.
| Parameter | Description |
|---|---|
id | Agent ID (integer) |
conversationId | Conversation/session ID (string, e.g. from chat response) |
| Field | Type | Description |
|---|---|---|
conversation | object | Full conversation with messages |
conversation.id | string | Conversation ID |
conversation.createdAt | string | ISO 8601 timestamp |
conversation.messages | array | Ordered list of user/assistant exchanges |
messages[].query | string | User message |
messages[].response | string | Assistant response |
messages[].createdAt | string | ISO 8601 timestamp |
{
"conversation": {
"id": "clx123abc456",
"createdAt": "2025-02-24T11:30:00.000Z",
"messages": [
{
"query": "What are your hours?",
"response": "We're open 9am–5pm Monday through Friday.",
"createdAt": "2025-02-24T11:30:15.000Z"
},
{
"query": "Are you open on weekends?",
"response": "No, we're closed on weekends.",
"createdAt": "2025-02-24T11:30:45.000Z"
}
]
}
}curl -X GET "https://chatspark.io/api/v1/agents/123/conversations/clx123abc456" \
-H "Authorization: Bearer cs_live_..."const res = await fetch(
`${API_BASE}/agents/123/conversations/clx123abc456`,
{ headers: { "Authorization": "Bearer cs_live_..." } }
);
const { conversation } = await res.json();