Conversations API
A conversation is a running dialogue between a person or system and one agent. The agent keeps the context of everything said before, and each answer can be streamed as it is written. Conversations started through the API appear in the dashboard like any other.
Base path: /api/v1/conversations. Permissions: agents:read to read, agents:execute to start conversations and send messages, agents:write to update or delete them.
List conversations
GET /api/v1/conversations
| Parameter | Type | Description |
|---|---|---|
page | integer | Page number (default 1) |
limit | integer | Results per page (default 100) |
agentId | string | Only this agent's conversations |
appId | string | Only this workspace |
teamId | string | Only this team |
channel | string | chat, a2a, email, messaging or videoconf |
The response is { "conversations": [ … ], "meta": { "total", "page", "limit", "hasMore" } }.
GET /api/v1/conversations/stats returns totals for the same filters: number of conversations, active and completed, per channel, total messages and tokens.
Start a conversation
POST /api/v1/conversations
| Field | Type | Required | Description |
|---|---|---|---|
agentId | string | Yes | The agent to talk to |
title | string | No | A title shown in the dashboard |
channel | string | No | Defaults to chat |
appId, teamId | string | No | Workspace and team context |
metadata | object | No | Your own tags, such as a ticket id |
The response is the new conversation, with its id.
Send a message
POST /api/v1/conversations/:id/messages
| Field | Type | Required | Description |
|---|---|---|---|
message | string | Yes | Up to 10,000 characters |
stream | boolean | No | Default true (streamed answer). false waits and returns JSON. |
fileIds | string[] | No | Up to 10 files you uploaded earlier |
options.maxTokens | integer | No | Cap the length of the answer |
options.temperature | number | No | 0-2 |
Without streaming
With "stream": false the call returns once the agent has answered:
{
"response": "I found 3 contacts at Acme Corp…",
"conversationId": "conv_789",
"tokenUsage": { "input": 1100, "output": 450, "total": 1550 },
"cost": 0.0045,
"duration": 4120,
"toolCalls": []
}
With streaming
By default the answer arrives as Server-Sent Events in the open AG-UI event format, so standard AG-UI clients can render it:
| Event | What it carries |
|---|---|
RUN_START | The run has started |
TEXT_MESSAGE_START / TEXT_MESSAGE_CONTENT / TEXT_MESSAGE_END | The answer, delta by delta |
TOOL_CALL_START / TOOL_CALL_ARGS / TOOL_CALL_END | A tool the agent used: its name, its arguments and its result |
CUSTOM run_metrics | Token usage, cost and duration, just before the end |
CUSTOM message_replace | The final answer replaces what was streamed (for example after a guardrail) |
RUN_FINISHED | The run is complete |
RUN_ERROR | The run failed, with the reason |
heartbeat, progress and thinking events keep the connection alive and can be ignored. The TypeScript SDK reads this stream for you.
Read a conversation
GET /api/v1/conversations/:id
GET /api/v1/conversations/:id/history?limit=50&offset=0
GET /api/v1/conversations/agent/:agentId
GET /:id returns the conversation with its most recent messages. /history pages through every message (up to 200 per page) and returns messages, total and hasMore. /agent/:agentId lists one agent's conversations.
Update, archive, delete
PATCH /api/v1/conversations/:id { "title", "status", "starred", "bookmarked" }
POST /api/v1/conversations/:id/archive
DELETE /api/v1/conversations/:id
Archive keeps the conversation and hides it from active lists, and you can bring it back by setting status again. Delete removes it for good. The deletion is recorded in the audit log.