Skip to main content
AGO has separate APIs for code that runs in your users’ browser or app and for code that runs on your servers. Pick the one that matches where your code runs. All APIs are served from https://<your-workspace>.api.useago.com, where <your-workspace> is your AGO workspace name.

SDK API

The SDK API is what the AGO widget uses. Your code sends the user’s message to POST /api/sdk/v1/messages and reads the answer as a Server-Sent Events stream, so you can show it as it is written.
  • Every request identifies the user with X-User-Anon-Id, a stable identifier you generate per user or device. To identify signed-in users, also send Authorization: Bearer <jwt> with a token your application issues. See Widget & SDK Authentication.
  • Requests from a browser must come from a domain in your allowed domains list.
  • Keep thread.id from the stream and send it as conversation_id with the next message to continue the conversation. The answer can come back with a different conversation ID; see Forked conversations.
  • If a proxy or firewall cuts the stream, poll GET /api/sdk/v1/messages/{message_id}/status until the message is complete.
For native apps, see Mobile SDK Examples.

Public API v1 and Resolutions API

Server integrations authenticate with an API key created in Studio > API Keys. Each key has scopes that limit the endpoints it can call. You can also restrict it to IP addresses and rotate it. See API Key Authentication. The Resolutions API returns the agent’s complete answer in one response, without streaming, which is simpler for automations.

Good Practices

  • Never put an API key in browser or mobile code. Use the SDK API there, and keep API keys on your servers.
  • Show streamed answers as they arrive, and allow at least 60 seconds before a streaming request times out. Answers that use tools can take a while.
  • Retry with exponential backoff on 429 and 5xx responses and on network errors.

Troubleshooting

See Errors for error formats.