Skip to content
MZSMS

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_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Keys 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#

Scopes
FieldTypeDescription
sms:sendoptionalscopeSend single and bulk SMS, and estimate cost.
messages:readoptionalscopeRead message status and history.
balance:readoptionalscopeRead wallet balance and rates.
sender_ids:readoptionalscopeList 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#

  1. Create a new key with the same scopes.
  2. Deploy it to your service.
  3. Confirm traffic uses the new key (the dashboard shows each key's last use).
  4. 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.