Skip to content

Chat with AI Agent

POST
/api/v3/organizations/{organisation}/ai/agents/{agentId}/chat

Initiates a chat session with a specific AI agent. The agent’s configuration (system prompt, temperature, model, allowed tools) is automatically applied. * * Key Features: * - Session Management: Automatic session creation and state tracking * - Multi-turn Conversations: Full conversation history maintained server-side * - Agent’s system prompt is prepended to conversation * - Only agent’s allowed tools are available * - All tools are auto-executed (no client confirmation) * - Temperature and model from agent config * * Session Support: * - Omit sessionId to create a new session automatically * - Include sessionId to continue an existing conversation * - Sessions expire after 60 minutes of inactivity * - Use /sessions/{sessionId} to retrieve full conversation history

Authorizations

Parameters

Path Parameters

organisation
required
string

The organisation ID

agentId
required
string format: uuid

The agent ID

Request Body required

object
message
required

The user’s message to the agent

string
sessionId

Optional session ID to continue a conversation

string format: uuid
userId

Optional user identifier for session isolation

string
stream

Whether to stream the response (SSE)

boolean

Responses

200

Agent response generated successfully

object
sessionId
string format: uuid
response
object
text
string
stopReason
string
usage
object
inputTokens
integer
outputTokens
integer
toolResults
Array<object>
object

400

Invalid request parameters

403

Access denied

404

Agent not found

500

Failed to chat with agent