Skip to main content
Native mobile apps call the SDK API with the same headers as the embedded widget. This page covers the headers your app sends and how AGO identifies the user behind each request.

Base URL

Replace your-workspace with your AGO workspace name.

Authentication Modes

You can send both: a signed-in user’s JWT together with the device’s X-User-Anon-Id.

Headers


Anonymous Mode

AGO creates one user per X-User-Anon-Id. Every request with the same ID reads and writes the same conversation history.
  • Generate a random UUID once per installation and store it (UserDefaults on iOS, SharedPreferences on Android).
  • Send the same ID on every request and every app launch. A new ID means a new user with no history.
  • Use a random value, not an account number or email. Anyone who sends the same ID sees the same conversations.

JWT Mode

Your backend issues a JWT after the user signs in to your app. AGO verifies its signature with the public keys published at your JWKS URL.

Setup

  1. Publish your signing keys as a JWKS endpoint (for example https://example.com/.well-known/jwks.json).
  2. In AGO, go to Support → Settings → Your channels → Widget & SDK and enter it in JWT JWKS URL.
Supported signing algorithms: RS256, RS384, RS512 and ES256.

Claims AGO Reads

Other claims can be shown to your support team with JWT Fields Mapping on the same settings page, and can drive permission rules.
An expired or invalid JWT is not rejected. If the request also carries X-User-Anon-Id, it continues as that anonymous user, without the signed-in identity. Refresh tokens before they expire.

Errors

The SDK API returns 401 when it cannot identify the user:
  • X-User-Anon-Id is missing and no valid JWT is sent
  • X-User-Anon-Id contains characters other than letters, digits, - and _, or is longer than 64 characters
  • Origin is sent and does not match your allowed domains
Error bodies follow the standard error format.

Implementation Examples

Swift (iOS)

Kotlin (Android)