Choosing the Right API
SDK API
The SDK API, at/api/sdk/v1/, is what your end users reach through the embeddable widget, a custom chat UI built with the JavaScript SDK, or a mobile app.
How It Works
Each request identifies the visitor with anX-User-Anon-Id header. When you configure allowed domains for the widget, AGO rejects browser requests from other origins.
AGO then applies your workspace’s configuration: which agents the user can reach, what the pre-chat form looks like, and how conversations are routed. The SDK API covers conversations, messages, tickets, configuration, pre-chat forms and incident banners.
Authentication Modes
The SDK API supports three authentication modes. Anonymous access needs only theX-User-Anon-Id header. AGO creates an anonymous identity for the visitor, who receives your default permissions. Use it for public chat where users do not log in.
JWT authentication adds an Authorization: Bearer {jwt} header. AGO verifies the token against the JWKS URL you configure, with the RS256, RS384, RS512 or ES256 algorithm. AGO reads the user’s email and name from the token claims and links the conversation to that identity. The user receives logged-in permissions, and you can add permission rules based on JWT claims.
Auth token forwarding sends an X-Auth-Token header instead of a JWT. AGO resolves the user’s identity by calling an external API you configure. Use it when your authentication system does not issue JWTs. The user receives logged-in permissions once AGO resolves their identity.
You can also send X-User-Email and X-Widget-Permission headers to give AGO more context about the user. See Widget & SDK Authentication for setup.
Permission Model
Anonymous users get your default permissions, suitable for public interactions. Authenticated users, whether by JWT or by a resolved auth token, get logged-in permissions, and JWT claims can grant more through permission rules. You can open more features to users as they log in, with the same integration.Public API v1
The Public API v1, at/api/v1/, is for backend integrations, automation and administration.
How It Works
Each request includes anX-API-Key header. Keys start with ago_v1_sk_, which makes them easy to spot in logs and configuration files.
A Public API request does not act as an end user. It acts as an integration, with the permissions granted by the key’s scopes.
API Key Scopes
Each key has scopes that control which endpoints it can call. For example, a key withknowledge:read can read documents and sources but not change them, and conversations:read can read conversation history but not create conversations. Give each integration a key with only the scopes it needs.
Key Security
- IP allowlists: restrict a key to IP addresses or CIDR ranges. Requests from other addresses are rejected, even with a valid key.
- Automatic lockout: after 10 consecutive failed authentication checks, AGO locks the key.
- Key rotation: rotate a key with a grace period during which the old key keeps working while you update your integrations.
- Audit logging: AGO records the endpoint, response status and client IP of API requests.
Authentication Comparison
MCP
AGO exposes an MCP (Model Context Protocol) endpoint at/api/v1/mcp. MCP clients such as Claude and Cursor can connect to your AGO workspace through it and use your agents and tools.
Connect with an API key that has the scopes you need, or sign in with OAuth from clients that support it. See the MCP Integration Guide for setup.
Forwarding User Auth
When your agents call your APIs on behalf of a user, those APIs often need to know who the user is. Turn on Forward User Auth on an HTTP Request Tool or an API data source to pass the user’s credentials along:- An HTTP Request Tool sends the user’s JWT in an
Authorization: Bearerheader. - An API data source sends the user’s JWT in an
Authorization: Bearerheader, or, for users authenticated with an auth token, the token in anX-Auth-Tokenheader.
Related Documentation
- API Integration: connect your application with the SDK API or the Public API
- JavaScript SDK: embed AGO in your application
- Widget & SDK Authentication: configure JWT and auth token verification
- API Key Authentication: create and manage API keys
- MCP Integration Guide: connect MCP clients to AGO
