Webinar: Better Agents, Easier than Ever — Thursday, June 18th at 9am PT / 12pm ET. Register Now
Version 2.5
Conversations

Conversations

Talk to a Conversational agent: open conversations, post and stream messages, and work with the files and data frames a conversation produces. To create or configure the agent itself, see Agents.

All paths are relative to the base URL and require an Authorization: Bearer YOUR_API_KEY header. {aid} is the agent ID and {cid} is the conversation ID.

List conversations

GET /agents/{aid}/conversations

ParameterInTypeRequiredDescription
aidpathstringYesAgent ID.
limitqueryintegerNoPage size.
nextquerystringNoPagination token.

Returns a PaginatedResponse of Conversation objects.

Field (Conversation)TypeDescription
idstringConversation ID.
namestringConversation name.
agent_idstringID of the owning agent.

Create conversation

POST /agents/{aid}/conversations

Body

FieldTypeRequiredDescription
namestringYesConversation name.
curl -X POST 'https://{your-deployment-host}/tenants/{tenant-id}/api/v2/agents/{aid}/conversations' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{ "name": "Q3 reconciliation" }'

Returns the created Conversation.

Delete conversation

DELETE /agents/{aid}/conversations/{cid}

Deletes a conversation and returns the deleted Conversation.

Messages

Get messages

GET /agents/{aid}/conversations/{cid}/messages

Returns the conversation's messages as a PaginatedResponse.

Post a message (synchronous)

POST /agents/{aid}/conversations/{cid}/messages

Posts a user message and waits for the agent to respond, returning the updated conversation state. Use streaming for incremental output.

Body

FieldTypeRequiredDescription
contentstringYesThe message text.
curl -X POST 'https://{your-deployment-host}/tenants/{tenant-id}/api/v2/agents/{aid}/conversations/{cid}/messages' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{ "content": "Summarize the attached invoice." }'

Stream a message

POST /agents/{aid}/conversations/{cid}/stream

Posts a message and streams the response as Server-Sent Events, each event carrying an incremental delta. Set Accept: text/event-stream.

Body — same as the synchronous endpoint (content).

curl -N -X POST 'https://{your-deployment-host}/tenants/{tenant-id}/api/v2/agents/{aid}/conversations/{cid}/stream' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -H 'Accept: text/event-stream' \
  -d '{ "content": "Walk me through the reconciliation." }'

Concatenate the data: event deltas to assemble the full reply.

Files

A conversation has its own file space — inputs you upload and outputs the agent produces. See Files.

List files

GET /agents/{aid}/conversations/{cid}/files

Upload files

POST /agents/{aid}/conversations/{cid}/files

Send as multipart/form-data with a repeated files field.

curl -X POST 'https://{your-deployment-host}/tenants/{tenant-id}/api/v2/agents/{aid}/conversations/{cid}/files' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -F 'files=@invoice.pdf' \
  -F 'files=@receipt.png'

Download a file

GET /agents/{aid}/conversations/{cid}/files/download/

Returns the file bytes.

ParameterInTypeRequiredDescription
aidpathstringYesAgent ID.
cidpathstringYesConversation ID.
file_refquerystringYesReference of the file to download.

Data frames

Tabular data the agent produced in a conversation. See Data frames.

List data frames

GET /agents/{aid}/conversations/{cid}/data-frames

ParameterInTypeRequiredDescription
aidpathstringYesAgent ID.
cidpathstringYesConversation ID.
num_samplesqueryintegerNoNumber of sample rows to include.

Get a data frame

GET /agents/{aid}/conversations/{cid}/data-frames/{data_frame_name}

Returns a data frame's contents, with optional slicing, column selection, and ordering.

ParameterInTypeRequiredDescription
aidpathstringYesAgent ID.
cidpathstringYesConversation ID.
data_frame_namepathstringYesName of the data frame.
offsetqueryintegerNoRow offset to start from.
limitqueryintegerNoMaximum number of rows to return.
column_namesquerystringNoComma-separated columns to include.
order_byquerystringNoColumn to order by.
output_formatquerystringNoFormat of the returned rows.