API Reference
Authentication
How to authenticate API requests with a Bearer key.
ZevSend uses Bearer token authentication. Every request must
include a valid API key in the Authorization header:
curl https://api.zevsend.com/v1/emails \
-H "Authorization: Bearer sk_live_..." \
-H "Content-Type: application/json"
Creating an API key
Open Settings → API keys in the dashboard and click Create key. We’ll show the secret value once. Copy it immediately — we never store it in a recoverable form, and losing it means creating a new key.
sk_test_a1b2c3d4e5f6... # sandbox traffic
sk_live_a1b2c3d4e5f6... # live traffic
Test vs live keys
The prefix tells you which mode the key targets:
| Prefix | Mode | When you can create one |
|---|---|---|
sk_test_… | Test mode | Any time, up to 5 active per team. |
sk_live_… | Live | Once one of your domains has been approved. |
Both call the same endpoints, and the key decides the mode. A test key stays in test mode even after your team goes live: it only emails people on your team, and SMS, WhatsApp and verification codes are simulated rather than delivered. See Sandbox and live mode for the details.
Run your staging environment on a test key and production on a live key, side by side.
Per-key domain scope
When you create a live key you can restrict it to one of your domains. A restricted key only speaks for that domain’s brand:
- Email: the
fromaddress must be on that domain. - SMS and WhatsApp: brand fields come from that domain. Passing
a different
brand_domain_idis refused.
This is useful when one team runs more than one brand: if a key leaks, it can’t be used to send as your other brands. To send for another brand, create a separate key restricted to that domain.
Restrictions don’t apply to test keys, which always send from the ZevSend default sender.
Rotating a key
When you suspect a key is compromised:
- Create a new key in the dashboard.
- Deploy the new key to your application.
- Revoke the old key from the dashboard.
Revoking a key takes effect immediately — in-flight requests
on the old key fail with 401 invalid_api_key. Messages
already accepted are unaffected.
Authentication errors
| Status | Code | Meaning |
|---|---|---|
401 | missing_api_key | No Authorization header. |
401 | invalid_api_key | The key isn’t valid or has been revoked. |
401 | api_key_revoked | The key was revoked from the dashboard. |
403 | api_key_domain_scope_mismatch | The key is restricted to a different domain. |
403 | api_key_domain_not_approved | The key’s domain hasn’t been approved yet. |
Safe key handling
- Never commit keys to source control. Use environment variables or a secret store.
- Never embed live keys in mobile or browser apps. The client side is not a safe place for a server credential. Proxy through a backend you control.
- Use the principle of least privilege. Create separate keys for separate services so a leak from one doesn’t compromise the rest.
Updated at, Saturday, October 31, 2026