API keys & permissions
Copy page
API keys are the primary way to authenticate. Each key is scoped by permissions and bound to one workspace, so you can issue separate keys per application, per environment, or per team — and revoke them independently.
Create a key
Section titled “Create a key”-
Log in to the customer portal.
-
Go to Settings → API Keys and click Create API Key.
-
Pick the permissions the key needs (see the table below) and, optionally, enable HMAC signature verification for high-security environments.
-
Copy the key (
sk_prod_…). It is shown only once — store it in your secrets manager right away.
Permissions
Section titled “Permissions”Keys follow a deny-by-default model: a key can only call endpoints its permissions allow.
| Permission | Grants |
|---|---|
* | Full access |
sms.send | Send SMS (POST /sms/send) |
sms.read | Status, stats, messages, unified view (GET /sms/*) |
balance.read | Balance (GET /user/balance) |
pricing.read | Pricing (GET/POST /user/pricing) |
payments.read | Payments (GET /user/payments) |
webhooks.read | Webhook settings and logs (GET /user/webhooks, GET /user/webhooks/logs) |
webhooks.write | Update webhooks and send tests (PUT /user/webhooks, POST /user/webhooks/test) |
Recommended configurations
Section titled “Recommended configurations”| Use case | Permissions |
|---|---|
| Send + track delivery | sms.send, sms.read |
| Send only (fire & forget) | sms.send |
| Dashboard / monitoring | sms.read, balance.read |
| Webhook management | webhooks.read, webhooks.write |
| Full API access | sms.send, sms.read, balance.read, pricing.read, payments.read, webhooks.read, webhooks.write |
Calling an endpoint outside the key’s permissions returns 403 FORBIDDEN.
Key security best practices
Section titled “Key security best practices”- One key per application and environment. Separate keys for staging and production let you rotate or revoke one without touching the other.
- Grant the minimum permissions. A background sender rarely needs
payments.read. - Store keys in environment variables or a secrets manager. Never commit them to version control or embed them in client-side code.
- Rotate on staff changes and on any suspicion of exposure — create a new key, switch traffic, then delete the old one.
- Enable HMAC signing for environments where transport interception is a concern — see authentication.
Errors you may see
Section titled “Errors you may see”| HTTP | Code | Meaning |
|---|---|---|
| 401 | INVALID_API_KEY | Key not found or malformed |
| 401 | API_KEY_INACTIVE | Key exists but is disabled |
| 401 | API_KEY_EXPIRED | Key past its expiry date |
| 403 | FORBIDDEN | Key lacks the permission for this endpoint |
Full list: error reference.