Agents API
Create and manage AI agents, invoke conversations, and retrieve interaction history Base path:/api/v1/agents
Endpoint count: 3
List agents
GET /api/v1/agents/string
Opaque cursor for the next page (from previous response meta.pagination.cursor)
integer
Number of items per page (1–200, default 25)
string
Sort field; prefix with ’-’ for descending (e.g. ‘-created_at’). Defaults to newest first.
string (enum: active|draft|paused|archived)
Filter by agent status
string
Free-text search across the agent name
Send a chat message to an agent
POST /api/v1/agents/{id}/chat{ data: { response, conversation_id, tokens_used }, meta }. Use POST /chat/stream for incremental token streaming.
string
required
Agent identifier (Devotel agent_xxx id). Path also accepts the alias :agentId for back-compat.
string
required
User message to send to the agent.
object[]
Optional conversation history to seed the agent (additive on top of any persisted state).
string
Existing conversation id to append onto. When omitted, a new conversation is created.
Stream a chat response from an agent (SSE)
POST /api/v1/agents/{id}/chat/streamstatus, token, tool_start, and tool_end are progress frames that may arrive zero or more times, and the stream terminates with exactly one response or error frame. The terminal response event carries data: { "response": "...", "tokensUsed": <number>, "promptTokensUsed": <number>, "completionTokensUsed": <number>, "apiCallsUsed": <number>, "escalated": <boolean>, "conversation_id": "..." }; a terminal error event carries data: { "code": "...", "message": "..." }. The connection persists until the agent completes or the rate-limit window is exhausted (20/min per tenant). See the API reference for the full per-event payload shapes.
string
required
Agent identifier.
string
required
User message to send to the agent.
object[]
Optional conversation history to seed the agent (additive on top of any persisted state).
string
Existing conversation id to append onto. When omitted, a new conversation is created.