Begin a chat session with an agent.
You can use the cursor field to continue a multi-turn conversation:
cursor.cursor from the previous response.When a cursor is provided, there is no need to include previous message history in the messages field.
Integration tools — Call Function, Run Python code, and Call REST API — require explicit user confirmation before execution. When the agent wants to run one of these tools, the response includes a toolConfirmation action instead of the final result.
To continue, send a follow-up request with the same cursor and a message of type toolConfirmation in the messages array:
{
"agentExternalId": "my_agent",
"cursor": "<cursor from previous response>",
"messages": [
{
"role": "action",
"type": "toolConfirmation",
"actionId": "<actionId from the toolConfirmation action>",
"status": "ALLOW"
}
]
}
Set status to "ALLOW" to let the agent execute the tool, or "DENY" to cancel it.
Set stream to true in the request to receive Server-Sent Events (SSE) as the agent works. Each event is an AgentSessionResponse whose response.type discriminator indicates the kind of event:
progress — status updates while the agent is working (e.g. "Searching knowledge graph…"). Useful for showing a spinner or activity indicator.responseChunk — incremental content fragments of the agent's reply. Concatenate these to build the full response as it streams in.result — the final complete response, including messages, cursor, and any actions. Always the last event in the stream.When stream is false (the default), only a single result response is returned.
Successful Response
The response for a failed request.
{- "actions": [
- {
- "clientTool": {
- "description": "string",
- "name": "string",
- "parameters": {
- "description": "string",
- "properties": {
- "property1": {
- "additionalProperties": false,
- "default": "processing",
- "description": "The current status of the shipment. Must be one of the predefined values.",
- "enum": [
- "processing",
- "shipped",
- "delivered",
- "cancelled"
], - "examples": [
- "processing"
], - "format": "enum",
- "items": { },
- "maxItems": 3,
- "maxLength": 4,
- "maxProperties": 5,
- "maximum": 4,
- "minItems": 1,
- "minLength": 4,
- "minProperties": 1,
- "minimum": 4,
- "nullable": true,
- "pattern": "^(processing|shipped|delivered|cancelled)$",
- "properties": { },
- "propertyOrdering": [
- "processing",
- "shipped",
- "delivered",
- "cancelled"
], - "required": [ ],
- "title": "Shipping Status",
- "type": "string"
}, - "property2": {
- "additionalProperties": false,
- "default": "processing",
- "description": "The current status of the shipment. Must be one of the predefined values.",
- "enum": [
- "processing",
- "shipped",
- "delivered",
- "cancelled"
], - "examples": [
- "processing"
], - "format": "enum",
- "items": { },
- "maxItems": 3,
- "maxLength": 4,
- "maxProperties": 5,
- "maximum": 4,
- "minItems": 1,
- "minLength": 4,
- "minProperties": 1,
- "minimum": 4,
- "nullable": true,
- "pattern": "^(processing|shipped|delivered|cancelled)$",
- "properties": { },
- "propertyOrdering": [
- "processing",
- "shipped",
- "delivered",
- "cancelled"
], - "required": [ ],
- "title": "Shipping Status",
- "type": "string"
}
}, - "propertyOrdering": [
- "string"
], - "required": [
- "string"
], - "type": "object"
}
}, - "type": "clientTool"
}
], - "agentExternalId": "string",
- "agentId": "string",
- "cursor": "string",
- "messages": [
- {
- "actionId": "string",
- "content": {
- "text": "string",
- "type": "text"
}, - "data": [ ],
- "role": "action",
- "type": "clientTool"
}
], - "retentionPolicy": "temporary",
- "stream": false
}{- "agentExternalId": "string",
- "agentId": "string",
- "response": {
- "cursor": "string",
- "messages": [
- {
- "actions": [
- {
- "actionId": "string",
- "caller": {
- "id": "string",
- "name": "string"
}, - "clientTool": {
- "arguments": "string",
- "name": "string"
}, - "type": "clientTool"
}
], - "content": {
- "text": "string",
- "type": "text"
}, - "data": [
- {
- "instanceId": {
- "externalId": "string",
- "space": "string"
}, - "properties": {
- "property1": "string",
- "property2": "string"
}, - "type": "instance",
- "view": {
- "externalId": "string",
- "space": "string",
- "version": "string"
}
}
], - "reasoning": [
- {
- "content": [
- {
- "text": null,
- "type": null
}
], - "data": [
- {
- "toolCall": null,
- "type": null
}
]
}
], - "role": "agent"
}
], - "type": "result"
}
}