Get started

Moving from v1

v2 covers everything v1 does with one consistent shape. You can move one call at a time: v1 and v2 work on the same data.

Main differences

v1v2
Base URLhttps://server.scaledmail.com/api/v1https://api.scaledmail.com/v2
TokensRead or write accessScopes per area, e.g. orders:read, purchases:write
Workspace?organization_id=org_...Workspace: org_... header
IdsMixed (org_, sub_, UUIDs)Prefixed: org_, ord_ ... (a domain is its name, a mailbox its email address)
NamesMixed camelCase and snake_casesnake_case everywhere
MoneyDollarsDollars as a number (25.98)
ErrorsTwo shapesOne shape with type and code
ListsSome bare arrays, some unpagedAlways { data }; long lists paged with a cursor (has_more, next_cursor), up to 100 per page
OrderingFour create-order routesOne: POST /orders
Changes to live ordersSend and forgetChange requests you can list, read and cancel
WebhooksSet up in the portalSet up in the app; the same events as v1

v1 and v2 share your data: an order placed with v1 shows in v2, and the other way round. The workspace id is the same org_… id as in v1 and the app; an order's sub_X is ord_X in v2. v1 tokens don't work on v2 and v2 tokens don't work on v1 (401 wrong_api_version): make a v2 token in Settings › API tokens. Sub-workspaces are only reachable with v2.

Route by route

v1v2Notes
GET /organizationsGET /workspacesIncludes parent_id (sub-workspaces).
POST /organizationsPOST /workspacesparent_id makes a sub-workspace.
GET /packagesGET /productsPrices in dollars, as in v1.
POST /calculate-packagePOST /quotesA price preview, with tier and a price per line. To buy it, send the domains to POST /orders.
POST /search-domainsPOST /domains/availability
POST /suggest-domainsPOST /domains/suggestions
POST /buy-domainsPOST /domain-purchasesEach name shows in GET /domains as unused once paid.
GET /domainsGET /domainsUp to 100 per page with a cursor; GET /domains/:domain reads one.
GET /purchased-domainsGET /domainsFilter for domains not in an order yet.
GET /domain-maskingGET /masking-domainsAlso lists external masking-only domains, which GET /domains leaves out.
POST /create-order/:price_idPOST /ordersOne route for every kind of order. Send the same price_id as package (it is in GET /products). The coupon query parameter is now a coupon field in the body. See the Package on own domains example on Create order.
POST /create-custom-orderPOST /ordersLeave out package: you pay for the domains you send (Google per mailbox, Outlook and SMTP per domain). See the Google + Outlook on new domains example.
POST /buy-pre-warm-inboxesPOST /prewarmed-ordersSend the name of each domain.
GET /ordersGET /orders
GET /orders/:uuidGET /orders/:id
PATCH /orders/:uuid/tagPATCH /orders/:idChange tag.
POST /orders/:uuid/cancel-domainsPOST /orders/:id/remove-domains
DELETE /orders/:uuidPOST /orders/:id/cancel
POST /swap-domain/:old_domainPOST /change-requestsWith a replace_domain block; several changes can go in one request.
POST /swap-redirect/:old_domainPOST /change-requestsWith a redirect block.
POST /swap-sender-name/:old_domainPOST /change-requestsWith a sender_name block.
POST /swap-domain-masking/:old_domainPOST /change-requestsWith a masking block.
GET /mailboxes/:domainGET /mailboxes?domain=demo-domain-1.comPasswords: include=credentials instead of ?password=true.
GET /generate-aliasesPOST /alias-suggestionsNow needs a token, and counts as a read call (300 a minute per token).
GET /pre-warm-inboxesGET /prewarmed-inventory
GET /reportingGET /reportsSame idea: one row per domain per week. Filter by domain, order_id or week_of.

Webhook events

Nothing changes: webhooks are set up in the app, and your endpoint gets the same events, body, headers and signature as with v1 (order_created, order_status_changed, order_cancelled).

A safe order of work

  • Make a v2 token with only :read scopes and try your read calls first.
  • Then move changes, and purchases last.
  • Each purchase call charges the card: after a timeout, check GET /orders before sending it again.
  • Change your error handling to error.code.
  • When nothing calls v1 any more, revoke your v1 tokens.