Begin a chat session with an agent. When a user submits a message, the agent responds using the language model and the associated tools.
This API is stateless, but you can continue conversations by including the cursor from the previous response in subsequent requests.
Providing the cursor allows the agent to maintain the context of the conversation and deliver more accurate responses.
When the cursor is provided, there is no need to include the previous message history in the messages
field.
NOTE: Cursors are short-lived and may expire. Clients should not cache cursors or rely on them being available long-term.
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": [
- {
- "content": {
- "text": "string",
- "type": "text"
}, - "role": "user"
}
]
}
{- "agentExternalId": "string",
- "agentId": "string",
- "response": {
- "cursor": "string",
- "messages": [
- {
- "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
}
]
}
], - "role": "agent"
}
], - "type": "result"
}
}