Server-to-server: API key headers
Every call to/verify/* (v1) or /v2/verify/* (v2) is authenticated with a static header pair:
Send both on every request. There’s no separate login step for this method, the headers are the credential.
Hosts
Staging and production keys are separate pairs. A staging
X-Client-ID and X-API-Key won’t authenticate against prod.idto.ai, and vice versa. See Environments.
Browser and mobile SDKs: token exchange
The idto SDKs (web, Android, iOS, Flutter, React Native) run in an environment you don’t control, a user’s browser or device, so they can’t hold your permanentX-Client-ID / X-API-Key pair. Instead, your backend exchanges that pair for a short-lived token and hands the token to the SDK.
1
Your backend requests a token
client_id and client_secret are the same values as your X-Client-ID and X-API-Key.2
idto returns a bearer token
Authorization: Bearer <token> and it authenticates verification calls as your account until it expires. Your client_secret never leaves your server. Mint a token per user session, just before you start the SDK, and never log or persist it.Errors: wrong credentials return 401 with {"detail": "Invalid client credentials"}, and an inactive client returns 401 with {"detail": "Client is inactive"}.3
Your backend passes the token to the SDK
Hand
access_token to the SDK at init time as its client token. If a user takes longer than 15 minutes, the web SDK calls its getToken option on a 401, so point that at an endpoint on your backend that mints a fresh token the same way. Never move the exchange to the client.Authentication errors
These are returned before any verification runs and are never billed.
Which method to use
Was this page helpful? Email us at tech@idto.ai with the page link.