Skip to main content

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
ParameterTypeDescription
pageintegerPage number (default 1)
limitintegerResults per page (default 100)
agentIdstringOnly this agent's conversations
appIdstringOnly this workspace
teamIdstringOnly this team
channelstringchat, 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
FieldTypeRequiredDescription
agentIdstringYesThe agent to talk to
titlestringNoA title shown in the dashboard
channelstringNoDefaults to chat
appId, teamIdstringNoWorkspace and team context
metadataobjectNoYour 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
FieldTypeRequiredDescription
messagestringYesUp to 10,000 characters
streambooleanNoDefault true (streamed answer). false waits and returns JSON.
fileIdsstring[]NoUp to 10 files you uploaded earlier
options.maxTokensintegerNoCap the length of the answer
options.temperaturenumberNo0-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:

EventWhat it carries
RUN_STARTThe run has started
TEXT_MESSAGE_START / TEXT_MESSAGE_CONTENT / TEXT_MESSAGE_ENDThe answer, delta by delta
TOOL_CALL_START / TOOL_CALL_ARGS / TOOL_CALL_ENDA tool the agent used: its name, its arguments and its result
CUSTOM run_metricsToken usage, cost and duration, just before the end
CUSTOM message_replaceThe final answer replaces what was streamed (for example after a guardrail)
RUN_FINISHEDThe run is complete
RUN_ERRORThe 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.