Chatspark
K

API Reference

v1
K

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

Get a single conversation with its full message history. Requires Plus plan or higher.

Path Parameters

ParameterDescription
idAgent ID (integer)
conversationIdConversation/session ID (string, e.g. from chat response)

Response Schema

FieldTypeDescription
conversationobjectFull conversation with messages
conversation.idstringConversation ID
conversation.createdAtstringISO 8601 timestamp
conversation.messagesarrayOrdered list of user/assistant exchanges
messages[].querystringUser message
messages[].responsestringAssistant response
messages[].createdAtstringISO 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

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

Node.js

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

Previous

List Conversations

Next

List Messages