Getting started
The Auth Tokens API mints a single-use identity token for an existing end user. Your backend mints the token, your client passes it to the Messaging SDK, and the SDK exchanges it automatically. This page walks through the mint request and the handoff to the SDK.
For the full flow and the security model, see the Auth Tokens API overview.
Before you begin
- An API token, kept on your backend
- The Ada
end_user_idof the person to identify. Create end users, or look them up by your ownexternal_id, with the End Users API.
Step 1: Mint an identity token
Call POST /v2/auth/tokens/ from your backend with the end user’s id:
A successful request returns 201 with the token:
Errors
When your client is about to start or reset a chat session, mint a fresh token. Do not mint tokens in advance or cache them.
Step 2: Pass the token to the Messaging SDK
Return only the token value to your client over HTTPS, then pass it to the SDK as identityToken:
The SDK exchanges the token when the end user engages with the chat. The exchange consumes the token, so every session and every device needs a freshly minted token.
Follow the identity tokens getting started guide for exchange failure handling, re-identification through reset(), and a two-device walkthrough.
Each platform documents its identityToken option: