Skip to navigation

Send one turn to the agentic chat

Runs the organisation’s agents with their skills and tools. Requires the api.agentic_chat feature. The turn runs as the user who created the API key.

Send messages to start or continue a chat, or card_response to answer the card of the previous reply. The server keeps the history: for an existing chat_id only the last message of the request is used.

A user message may name files uploaded through POST /api/v2/files. agent_id uses one agent from GET /api/v2/agents; without it the router picks.

stream: false waits up to 230 seconds and returns the finished turn; use stream: true for long turns. When the agent stops on a card the reply has status: awaiting_input and a card. Generated files are listed in files; fetch each with GET /api/v2/files/{file_id}.

Authentication

AuthorizationBearer

Pyramid API key (prefix with “Bearer ”)

Request

This endpoint expects an object.
chat_idstringOptionalformat: "uuid"
Continue this chat. Omit to start one.
project_idstringOptionalformat: "uuid"
Bind a new chat to a project.
messageslist of objectsOptional

The last message must have role user. For an existing chat_id the server supplies the earlier turns and only the last message is used.

card_responseobjectOptional

The answer to the card of the previous reply. tool_call_id and card (the card’s name) come from that reply.

agent_idstringOptional

An agent id from GET /api/v2/agents. Absent: the router picks an agent for each turn.

knowledge_sourcesobjectOptional
Absent means all on.
streambooleanOptionalDefaults to false

true returns the event stream instead of the finished turn.

include_eventsbooleanOptionalDefaults to true

false leaves the raw events out of a non-streamed reply.

Response

Finished turn (JSON when stream=false, SSE when stream=true)

request_idstringformat: "uuid"

Server-generated per-request UUID. Also sent as X-Request-Id response header. Include in support tickets.

successany
dataobjectOptional
paginationobjectOptional

Present only on list endpoints. Top-level (not nested inside data).

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
404
Not Found Error
409
Conflict Error
503
Service Unavailable Error