Get started
Authentication
Every call sends an API v2 token in the Authorization header. A token has scopes that limit what it can do, and covers the workspaces you picked when you made it.
Send the token
Authorization: Bearer sm_live_EXAMPLE_KEY
| Prefix | Mode |
|---|---|
sm_ | Live: real purchases on your saved card and real work by our team. |
| Problem | Answer |
|---|---|
No token, or no Bearer | 401 missing_ |
| The token doesn't exist | 401 invalid_ |
| The token has expired | 401 token_ |
| The token was revoked | 401 token_ |
| An API v1 token sent to v2 | 401 wrong_ |
| The person who made the token is no longer an owner or admin of its workspace | 403 no_ |
| Many calls with a missing or wrong token from one address | 429 too_ for a minute |
Keep tokens secret and only call the API from your server. Never put a token in a web page, a mobile app or a public repository. A token that can buy can spend on your card.
v1 tokens and v2 tokens
- API v1 tokens and API v2 tokens are separate. A v1 token sent to
/v2answers401wrong_, and a v2 token sent toapi_ version /api/v1answers401wrong_too.api_ version - v1 tokens never reach sub-workspaces: they are not listed there, can't be used there and can't be created inside one. To work with sub-workspaces, use a v2 token.
- v1 keeps working until March 31, 2027. See Moving from v1.
Create a token
- In the portal, open Settings › API tokens and click Create token. Owners and admins of the workspace can create tokens; a workspace can have up to 10 live tokens.
- API version: v2 is the default. Inside a sub-workspace only v2 tokens can be made.
- Access: Read only or Read and write. With Read and write you can also tick Can buy (charges the saved card). Mailbox passwords follow your role: owners, admins and members can read them, viewers can't.
- Workspaces: Only this workspace, All my workspaces (every workspace where you are owner or admin, later ones too) or Choose workspaces. The owner of a main workspace can also tick Also the sub-workspaces of the workspaces it covers.
- Can create workspaces (with Read and write only): needed for
POST /workspaces. - Expires: never, or after 30 days, 90 days or 1 year.
- The full token is shown once. Copy it into your secret store straight away; afterwards the portal shows only its first characters.
- A token acts with the rights of the person who made it, and only while that person is an owner or admin of the workspace it acts on.
Scopes
Every token can read everything in its workspaces. Scopes only matter for changes: Read and write lets the token change things (:write scopes), and Can buy lets it charge the card (purchases:write). A change the token may not make answers 403 missing_, and param names the scope.
| Scope | Allows |
|---|---|
workspaces:read | List and read workspaces. |
workspaces:write | Create workspaces and sub-workspaces (with Can create workspaces), rename them. |
catalog:read | Read products and pre-warmed inventory, and create quotes. |
domains:read | Check availability, get suggestions, read domains, masking domains and domain purchases. |
domains:write | Given with Read and write. Buying domains also needs Can buy. |
mailboxes:read | List and read mailboxes, suggest aliases. Passwords with include=credentials when the token's creator may see them. |
mailboxes:write | Given with Read and write. No endpoint needs it yet. |
orders:read | List and read orders and their deliverability reports. |
orders:write | Change, cancel or remove domains from orders. |
purchases:write | Can buy: anything that charges the card (create orders, pre-warmed orders and buy domains). Only with Read and write. |
change_ | List and read change requests. |
change_ | Create and cancel change requests. |
billing:read | List and read invoices. |
Read calls never answer missing_: tokens made in the app always get every :read scope.
Which workspaces a token covers
- When you make a token you pick one or more workspaces. The token can't see or change anything outside them.
- With Also the sub-workspaces, the token also covers every sub-workspace of the mains it covers, including subs added later.
- A workspace you create with a token is added to that token straight away.
- The token only works in a workspace while the person who made it is an owner or admin there.
- Send
Workspaceon each call, also with a token for one workspace. See Workspaces and sub-workspaces.
Rotate a token
- Create a new token with the same access and workspaces.
- Deploy it to your servers.
- Check in Settings › API tokens that the old token's Last used time has stopped moving.
- Revoke the old token.
Revoking takes effect at once: the next call with that token answers 401 token_. If a token may have leaked, revoke it first and rotate afterwards.
