Key pairs
Send your credential ID and secret joined by a period in theAuthorization header, or send the same pair in two sb-api-* headers:
SK…) paired with the key’s secret, or an account ID (AC…) paired with the account’s token.
If a request includes an
Authorization header, that header decides authentication alone. Any sb-api-key-id and sb-api-secret-key headers on the same request are ignored.Existing Sendblue API keys
Thesb-api-key-id and sb-api-secret-key your integration already sends to the earlier Sendblue API work here too, either as two headers or as Authorization: Bearer <key id>.<secret>.
The key acts as an API key of your company’s root account: it can use the non-administrative operations and read the balance, and is refused on other /admin routes. If your company has no Omni account yet, the request answers 401 unauthenticated, the same as a wrong secret.
Scoped keys
An administrator session, the account token, or an API key withkeys:manage can create keys with POST /admin/keys.
role, an explicit list with permissions, or neither for a standard key:
Key rules:
- An explicit
permissionslist is exact; an empty list grants nothing. Includeme:readif the key should callGET /me. - When both
roleandpermissionsare given,permissionsmust be a subset of the preset. - A key can only grant permissions it holds itself, and an expiring key cannot issue one that outlives it.
- To change a key’s grants, create a new key and revoke the old one with
DELETE /admin/keys/{key_id}. Revoked and expired keys stop authenticating immediately. - Keys with a custom or narrowed permission list work only on this JSON API. The Twilio-compatible API under
/taccepts standard keys and account tokens.
403 permission_denied with error.details.required_permission naming the missing grant. Every endpoint in the API reference states its required permission.
Sessions
The Sendblue web app signs people in and sends their ID token asAuthorization: Bearer <ID token>. A person acts in their company’s root account with the role of their seat (admin, manager, or member), and may act in one of its active subaccounts by sending Sendblue-Account: <account id>. Server integrations should use API keys.
Account scoping
Every request acts in the account its credential belongs to — no path, query, or body field selects the account. A key or token issued for a subaccount acts in that subaccount. Accessing a resource belonging to another account returns404 not_found, identical to a missing resource.
The balance, as well as company contacts, tags, variables, and workflows, belong to the root account. Callers acting in a subaccount are refused on those routes.
Failed authentication
A missing or invalid credential returns401 unauthenticated. Repeated failures for the same credential ID are throttled.