Getting started
Authentication
Authenticate with Bearer API keys, scopes, IP allowlists and key rotation.
Bearer API keys#
Send your key in the Authorization header on every request:
Authorization: Bearer sfk_live_ab12cd34_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXKeys start with sfk_live_ followed by an 8-character identifier (visible in the dashboard, so you can tell keys apart) and a secret. We store only a keyed hash of the full key; it cannot be recovered, only replaced.
Scopes#
| Field | Type | Description |
|---|---|---|
sms:sendoptional | scope | Send single and bulk SMS, and estimate cost. |
messages:readoptional | scope | Read message status and history. |
balance:readoptional | scope | Read wallet balance and rates. |
sender_ids:readoptional | scope | List sender IDs. |
Give each service only what it needs. A reporting job does not need sms:send.
IP allowlist and expiry#
When creating a key you can list the IP addresses allowed to use it, and set an expiry date. Requests from other addresses are rejected with 403 FORBIDDEN.
Rotating keys#
- Create a new key with the same scopes.
- Deploy it to your service.
- Confirm traffic uses the new key (the dashboard shows each key's last use).
- Revoke the old key. Revocation is immediate.
Authentication errors#
401 INVALID_API_KEY: the key is missing, wrong, revoked or expired.403 INSUFFICIENT_SCOPE: the key lacks the scope this endpoint requires.403 FORBIDDEN: IP not allowlisted, or the account is suspended.
Repeated authentication failures from one IP address are rate limited.