Skip to main content
idto has two ways to authenticate, depending on where the call originates.

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.
Because these headers work in any request, this method is for calls your own backend makes. Never embed a client ID and API key in a mobile app or a web page, anyone who reads the app bundle or the network tab gets your permanent 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 permanent X-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

The token is valid for 900 seconds (15 minutes). It is a short-lived, client-side credential: the SDK sends it as 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.
POST /auth/sdk/token is meant to be called from your backend, not from the browser or app itself. If the client-side code called it directly, it would need your permanent X-API-Key to do so, which defeats the purpose of the exchange.

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.
Last modified on December 2, 2026