Get started
Introduction
The ScaledMail API lets your own tools buy domains and inboxes, and manage your orders, domains and mailboxes, without opening the portal.
What you can do
- Buy: search and buy domains, order inbox packages (Google, Outlook, SMTP), buy pre-warmed inboxes. Purchases are charged to the workspace's saved card (accounts billed on their subscription get the order on their next invoice instead).
- Orders: list your orders, read one order, change its tag, cancel some of its domains or the whole order.
- Domains and mailboxes: list your domains and their mailboxes, replace a domain, change a redirect, sender names or domain masking.
- Workspaces: list the workspaces your token can use, and create new ones.
- Webhooks: get a call to your own server when an order is created, changes status or is cancelled.
Base URL
Every path in these docs starts with this base URL:
https://server.scaledmail.com/api/v1
The API only speaks HTTPS. Send request bodies as JSON with Content-Type: application/json. Every answer is JSON too.
The organization_id parameter
A workspace is called an organization in the API. Most routes work on one workspace, so you name it in the query string: ?organization_. You find your workspace ID in the portal under Settings › API tokens, or with GET /organizations.
| Routes | organization_id |
|---|---|
GET /organizations, POST /organizations, GET /packages, POST /calculate-package | Not needed, and ignored if you send it: these use the workspace the token was made in |
GET /generate-aliases | Not needed, and no token either |
| Every other route | Required |
If it is missing you get 400 organization_. If your token can't use that workspace you get 401 organization_.
Your first request
Create a token in the portal (see Authentication), then list the workspaces it can use:
curl https://server.scaledmail.com/api/v1/organizations \ -H "Authorization: Bearer sm_live_EXAMPLE_TOKEN"
{
"total": 1,
"organizations": [
{ "id": "org_DemoWorkspace1", "name": "Main" }
]
}Then use that id as organization_ on the other routes, for example GET /orders?organization_.
Where to go next
- Authentication: tokens, read and write access, which workspaces a token reaches.
- Errors: the error shapes and the codes you can check for.
- Rate limits: read this before you call the buy routes from a script.
- Webhooks: get told about order changes instead of asking for them.
