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

Header
Authorization: Bearer sm_live_EXAMPLE_KEY
PrefixMode
sm_live_Live: real purchases on your saved card and real work by our team.
ProblemAnswer
No token, or no Bearer 401 missing_api_key
The token doesn't exist401 invalid_token
The token has expired401 token_expired
The token was revoked401 token_revoked
An API v1 token sent to v2401 wrong_api_version
The person who made the token is no longer an owner or admin of its workspace403 no_access
Many calls with a missing or wrong token from one address429 too_many_failed_attempts 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 /v2 answers 401 wrong_api_version, and a v2 token sent to /api/v1 answers 401 wrong_api_version too.
  • 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_scope, and param names the scope.

ScopeAllows
workspaces:readList and read workspaces.
workspaces:writeCreate workspaces and sub-workspaces (with Can create workspaces), rename them.
catalog:readRead products and pre-warmed inventory, and create quotes.
domains:readCheck availability, get suggestions, read domains, masking domains and domain purchases.
domains:writeGiven with Read and write. Buying domains also needs Can buy.
mailboxes:readList and read mailboxes, suggest aliases. Passwords with include=credentials when the token's creator may see them.
mailboxes:writeGiven with Read and write. No endpoint needs it yet.
orders:readList and read orders and their deliverability reports.
orders:writeChange, cancel or remove domains from orders.
purchases:writeCan buy: anything that charges the card (create orders, pre-warmed orders and buy domains). Only with Read and write.
change_requests:readList and read change requests.
change_requests:writeCreate and cancel change requests.
billing:readList and read invoices.

Read calls never answer missing_scope: 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 Workspace on 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_revoked. If a token may have leaked, revoke it first and rotate afterwards.