- Create a session —
POST /v1/chat/chat/sessionswith anagentId - Send messages —
POST /v1/chat/chat/sessions/{id}/messages(stream by default) - Close the session —
PATCH /v1/chat/chat/sessions/{id}/closewhen done
Create session
Open a new chat session with an agent.
Send message
Send a message and receive a streaming reply.
List sessions
Browse all sessions with filtering by agent, state, or platform.
List messages
Retrieve the full message history for a session.
Key concepts
- Session — a stateful conversation thread between a user and an agent. All messages, tool calls, and context live inside a session.
- Platform — where the session originated:
SDK,WEB,WHATSAPP, orVOICE. Affects analytics tagging. - State — sessions are
OPENby default and transition toCLOSEDwhen explicitly closed or when the agent considers the conversation complete. - Metadata — arbitrary key-value pairs on sessions and messages for storing user IDs, locale, correlation IDs, etc.
Streaming
Message replies stream over Server-Sent Events. Pass"stream": true (the default) in the message body. Each event contains:
"stream": false for a single JSON response when streaming isn’t practical (e.g., serverless functions with response buffering).
Webhook events
Closing a session fires asession.closed webhook. Incoming messages fire session.message.created. Configure webhooks in the dashboard.