Skip to main content
The SDK API lets you build custom chat interfaces on top of AGO. Use it to manage conversations, send and receive messages, create tickets, and retrieve workspace configuration from your own application.

Base URL

All endpoint paths below are relative to this base URL.

Authentication

The SDK API uses the same authentication as the embedded widget. Requests are authorized by the X-User-Anon-Id header and validated against your allowed domains list, which you configure in Widget & SDK Configuration. Include these headers in every request:
*When you send a JWT in the Authorization header, X-User-Anon-Id can be omitted: the user identity is taken from the token’s sub claim.

Conversations

List Conversations

Returns a paginated list of the authenticated user’s conversations. Query parameters: Example request:
Example response:

Get Unread Count

Returns the number of unread conversations and the ID of the most recent unread conversation. Example request:
Example response:

Get Conversation

Returns a single conversation with all its messages. Path parameters: Example request:
Example response:
Each message includes a tool_call_data array listing the tool calls the agent made while producing that message, in the order they ran. The array is empty when no tool was used. Each entry carries the tool’s status, tool_name, a display name, and a type that tells your interface how to render it (for example status_message, progress_indicator, confirmation_input, or form). Calls to your own client-side functions also include an arguments object with the values the function was called with, so you can show what ran. This is the same shape used by the built-in chat interface, so you can replay a past conversation — including its tool calls — in a custom UI.

Messages

Send Message

Sends a message and returns a streaming response using Server-Sent Events (SSE).
This endpoint returns a text/event-stream response. You need an SSE-compatible client to consume the stream. If the stream disconnects, use the Get Message Status endpoint to poll for the final result.
JSON request body: Example request (JSON):
File uploads: To attach files, send the request as multipart/form-data with content, conversation_id, and agent_id as form fields and files for file attachments.
Response: The response is a text/event-stream. Each event is a line of text prefixed with data: .

Continue Message

Resumes an agent turn that paused on client function calls. Only relevant when you send messages with client_functions_mode: "pause". The two modes differ in when the agent sees your function results:
  • placeholder (default): when the agent calls one of your client functions, the turn continues immediately without the result. The result you submit is only visible to the agent on the next message.
  • pause: the turn stops when the agent calls your client function(s). The SSE stream ends with a status: "WAITING_CLIENT" event that lists waiting_tool_call_ids. Execute each function, submit its result via POST /tool-calls/{id}/submit (body: {"formData": {...}}), then call this endpoint. The agent continues the same turn with the real results — useful when a function changes what the agent should do next (for example a page navigation followed by filling the destination page).
The pause survives page reloads: reload the conversation with Get Conversation, look for an assistant message with status: "WAITING_CLIENT" and tool calls in waiting_input status, then submit and continue as usual. Path parameters: JSON request body: Example flow:
A turn that called several client functions resumes only once every one of them has been submitted — the submit response’s resume.ready flag flips to true on the last one. Sending a new message to the conversation abandons any paused turn. The endpoint returns 409 if the message is not paused, if some tool calls are still waiting, or if the conversation moved on. Response: a text/event-stream, same format as Send Message.

Get Message Status

Poll the current status of a message. Use this as a fallback when the SSE stream disconnects or as an alternative to streaming. Path parameters: Example request:
Example response:
The status field is one of:

Submit Feedback

Submit positive or negative feedback for an agent response. Path parameters: Request body: Example request:
Response: 204 No Content

Tickets

Create Ticket

Creates a support ticket. Send as multipart/form-data to support file attachments. Form fields: Example request:
Example response (201 Created):

Configuration

Get Config

Returns workspace configuration for the authenticated user, including available permissions, pre-chat form status, and active incident banners. Example request:
Example response:
The proactive block tells the SDK whether proactive mode is enabled for the workspace. When enabled is false, the SDK never shows a nudge and never calls the proactive endpoints.

Get Pre-Chat Form Status

Check whether the pre-chat form is required for the current user before they can start a conversation. Example request:
Example response:

Submit Pre-Chat Form

Submit the user’s pre-chat form selection. After a successful submission, the user is assigned a permission and can start conversations. Request body: Example request:
Example response:

Get Active Incident Banners

Returns any active incident or informational banners configured for the workspace. Example request:
Example response:
When agent_ids is empty, the banner applies to all agents. When populated, it only appears for conversations with the listed agents.

Proactive Mode

Used by the SDK’s proactive mode. The evaluate endpoint requires proactive mode to be enabled for the workspace; the events endpoint accepts lifecycle reports regardless, so batches sent around a configuration change are not lost.

Evaluate an Intervention

Called by the SDK after a client-side trigger matched, when the trigger is configured with intervene: "agent". A fast model decides whether a nudge is worth showing right now and drafts its message. Request body:
client_nudge_id is a UUID generated by the SDK for this nudge instance; lifecycle events sent later reference it. agent (optional) is the agent id or name. signals only carries counters and page paths — never form values. Example response:
When intervene is false, message and action are null and the SDK stays silent. action is only ever one of the client_functions declared in the request. Returns 403 (proactive_mode_disabled) when the feature is off for the workspace or the agent, and 429 (rate_limited) when the per-user evaluation cap is reached — the SDK treats both as “do not intervene”.

Report Nudge Events

Batched lifecycle tracking for nudges, including static ones that never called the evaluate endpoint. Maximum 50 events per request. Request body:
source is "static" or "agent". type is one of shown, dismissed, accepted, converted. Events are idempotent per nudge and type: the first reported timestamp wins. Example response:

Error Format

All errors follow a consistent structure: