Skip to main content

How it works

The Humain device API uses per-device bearer tokens. Each physical device, website widget, or VoIP adapter gets its own credential. This lets you revoke a single device without affecting others, monitor usage per device, and apply rate limits at the credential level.
Credentials are long-lived and are never stored in plain text on the server — only a SHA-256 hash is persisted. The raw token is shown exactly once at creation time. Copy it immediately and store it in a secret manager (e.g. AWS Secrets Manager, Vault, Doppler).
Browser-side integrations — a website widget, a single-page app, anything running in a visitor’s browser — should not embed a device credential in client-side code. Use the Public Gateway instead, which lets a browser open sessions without ever holding this token.

Token format

A valid token always matches /^hk_(live|test)_[A-Za-z0-9\-_]{43}$/. Both prefixes work against the same https://api.humain.ai host — there is no separate sandbox URL. The prefix alone determines whether the session runs live or in sandbox mode.

Issuing credentials

Credentials are managed in the admin panel under Kiosk → Credentials.
1

Open the admin panel

Navigate to app.humain.ai and select your workspace.
2

Select a kiosk

Open the kiosk you want to issue a credential for. One kiosk can have multiple active credentials (e.g. one per device in a fleet).
3

Issue a new credential

Click Issue new credential, give it a descriptive label (e.g. lobby-terminal-01), choose Live or Sandbox, and confirm.
4

Copy the token

The raw token is displayed once. Copy it now — you cannot retrieve it later.

Using the token in code

Rotating credentials

To rotate a credential (e.g. after a suspected leak):
  1. Issue a new credential from the admin panel.
  2. Deploy the new token to your device.
  3. Revoke the old credential — existing open sessions that used it will be terminated.
Revocation is immediate. The old token stops working as soon as you revoke it, regardless of any cached sessions on the device.

Error responses