ZevSend Docs
Sign up

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:

PrefixModeWhen you can create one
sk_test_…Test modeAny time, up to 5 active per team.
sk_live_…LiveOnce 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 from address must be on that domain.
  • SMS and WhatsApp: brand fields come from that domain. Passing a different brand_domain_id is 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:

  1. Create a new key in the dashboard.
  2. Deploy the new key to your application.
  3. 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

StatusCodeMeaning
401missing_api_keyNo Authorization header.
401invalid_api_keyThe key isn’t valid or has been revoked.
401api_key_revokedThe key was revoked from the dashboard.
403api_key_domain_scope_mismatchThe key is restricted to a different domain.
403api_key_domain_not_approvedThe 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