x-api-key header for clients that cannot set Authorization:
Key modes
The prefix tells you the mode; the API enforces it.
A live key on a sandbox-only account, or a revoked key, answers
401 unauthorized. A key that belongs to an application that is not approved yet answers 403 account_not_active.
Scopes
A key isfull (the default) or check. A check-scoped key may only call check and GET /v1/verify/{id}; start, resend and cancel answer 403 insufficient_scope. Use it on a server that only ever confirms codes and never sends them. Partner keys are always full scope.
Expiry and IP allowlists
Set at creation time, checked right after the key is recognised and before anything else:- Expiry: once
expires_atpasses, every call answers401 key_expired. - IP allowlist: exact IPs and CIDR ranges, IPv4 and IPv6. A caller outside the list gets
403 ip_not_allowed. Empty means every address.
The order of checks
Knowing the order helps you read an error. On every endpoint:- Per-key rate limit (
429 too_many_requests), checked before authentication. - Key recognised, then expiry, IP allowlist and scope.
- Account and application state (
403 account_not_active). - Request shape (
400 invalid_json,400 invalid_request), channel and destination (422). - Sandbox gates, hourly caps and the protection guard (
429,403). - Balance (
402 insufficient_credits). - The send itself (
502 send_failed, refunded).