Authentication and tokens
An App Key for your app (no backend needed), or project keys on your server and short-lived tokens for each call.
Set in your dashboard vs. set in code
| Setting | Where |
|---|---|
| App Key, its bindings (package name, bundle ID, website, signing certificate) and Quick-mode caps | Dashboard: Console → Projects → Quick mode |
| Who the user is (user id, display name) | Code: init / setUser in the app |
| Token lifetime (server tokens) | Code: ttl_seconds, within the project limit |
| Project keys (create, rotate, revoke, IP allowlist) | Dashboard: Console → Projects |
Two ways
| App Key (Quick mode) | Project key + join tokens (production hardening) | |
|---|---|---|
| Where it lives | In your app. Publishable. | Key on your server; the app gets one token per call. |
| Backend needed | No | Yes |
| Reaches | The app-facing routes only (Client API) | Every route, including balance, usage, receipts, gift settings and webhooks setup |
| Control | Bindings and caps you set in the console | Your server decides who joins which call, for how long, in which role |
App Key (Quick mode)
The App Key (tak_…) is in the console under Projects → Quick mode. Put it in your app and call init with it and your own user id; the SDK does the rest.
The App Key is publishable, not a secret: it can only reach the app-facing routes, it is bound to your package name, bundle ID or website, and spend and usage caps fence it. The binding is a deterrent, not a lock (a determined attacker can copy an app's identity), so the caps are what limit the damage. For strict control, add server tokens (production hardening below).
- Bound to the package names, bundle IDs, websites and (Android, optional) signing-certificate SHA-256 you list.
- Capped by limits you set: the longest call, minutes per user per day and a daily spend cap for the project.
- Rotate it in the console if it leaks; the old key stops working.
The SDKs send these headers for you (only needed if you call the routes yourself). Never send an Authorization header with an App Key.
| Header | Value |
|---|---|
X-Titli-App-Key | The App Key |
X-Titli-User | Your own user id, ^[A-Za-z0-9_.:@-]{1,128}$ |
X-Titli-Platform | android, ios or web |
X-Titli-App | Android package name or iOS bundle ID (not on web: the browser's Origin is used) |
X-Titli-App-Cert | Android only, optional: SHA-256 of the signing certificate |
X-Titli-Device | A random id per install |
X-Titli-SDK | SDK name and version, such as flutter/0.2.0 |
Every route, header and error of Quick mode: Client API (Quick mode).
Production hardening (optional): server tokens
You do not need a server to start: Quick mode works with the App Key alone. Add a server when you want strict control over every call (who joins which call, for how long, in which role): keep the project key on your server and mint a short-lived join token per person there. The app uses the same SDK and hands it a token instead of the App Key. Both ways can run side by side.
Project keys (server only)
Call the REST API from your backend with HTTP Basic auth: username = key ID (tk_…), password = key secret (ts_…). Every request is scoped to the key’s project.
Authorization: Basic base64(key_id:key_secret)Never put the key secret in a mobile or web app. Anyone who unpacks the APK can read it. (The App Key is the one made for apps.)
Join tokens (in the app)
POST /v1/calls/{id}/tokens mints a token for one end_user_id in one call. Fields:
end_user_id(required): becomes the participant identity. If the same id joins again, the older connection is dropped.role:user(default) orhost. The firstuserbecomes the payer if none was set.name: display name, up to 80 characters.ttl_seconds: from 30 up to your project's limit (normally 3600). Default: the project's default, 600 unless you changed it in the console. Limits when the token can be used to join, not how long the call lasts.
{
"token": "eyJ…", "livekit_url": "wss://…", "room": "tvs_…", "call_id": "…",
"identity": "user_1001", "role": "user", "type": "video", "expires_at": "…",
"end_user_is_new": true, "payer_end_user_id": "user_1001", "payer_free_seconds_available": 60,
"max_video_resolution": "720p"
}Give the app token and livekit_url. Minting registers the end user; it fails with 409 call_ended for an ended call and 402 when the balance cannot cover the call and the payer has no free seconds. Every field: REST API reference.
Audio-call tokens can publish only the microphone; video-call tokens can publish camera and microphone.
Rotating keys
Create a second key, deploy it, then revoke the old one. A project holds up to two active keys.
When authentication fails
| HTTP | Code | Meaning |
|---|---|---|
| 401 | APP_KEY_INVALID (AK-401) | App Key: missing, wrong, rotated away or switched off. |
| 403 | APP_NOT_ALLOWED (AB-403) | App Key: the package name, bundle ID, website or signing certificate is not on the key's list, or the platform header is missing. |
| 403 | QUICK_MODE_OFF (QM-403) | App Key: Quick mode is switched off for the project, or paused by us. |
| 403 | FORBIDDEN (FB-403) | App Key: acting as another user, or on a call the user is not in. |
| 401 | unauthorized | Project key: no Authorization header, or it is not HTTP Basic key_id:key_secret. |
| 401 | invalid_api_key | Project key: the key ID is unknown or the secret is wrong. |
| 401 | key_revoked, key_expired | The key was revoked in the console, or passed its expiry date. Use your new key. |
| 403 | ip_not_allowed | The key has an IP allowlist and this request came from another address. The message names the address we saw. |
| 403 | project_disabled, vendor_suspended, vendor_closed | The project or account is switched off. |