SuperMailOS Domains API
The Domains API from SuperMailOS — 4 operation(s) for domains.
The Domains API from SuperMailOS — 4 operation(s) for domains.
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/supermailos-com:supermailos-com-domains-api"
curl "https://apis.io/api/v1/apis?limit=25"
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
title: SuperMailOS Domains API
version: 1.3.0
description: 'The SuperMailOS API lets your code and AI agents read, search, organize and send
business email from your workspace''s real mailboxes — the same mail, rules and
guardrails as the web app. ## Authentication
Create a key in **Settings → Developers → API keys** (workspace admins). Keys look
like `smk_…`, are shown once, and are sent as `Authorization: Bearer `. Prefer calling from a server; never ship a key in public client code. A key acts for the person who created it and reaches exactly the mailboxes they
can open in the app: owners and admins reach every mailbox in the workspace; a
member reaches their own mailboxes plus mailboxes shared with them (view-only,
view-and-send, or full access). Anything else — another workspace, a teammate''s
unshared mailbox — is reported as `404`, never as forbidden. Access follows the
person''s current role, and a key stops working (`401`) once its creator leaves
the workspace. ## Scopes
| Scope | Allows |
|---|---|
| `read` | mailboxes, threads, messages, attachments, search |
| `send` | `POST /send`, `POST /threads/{id}/reply` |
| `write` | `PATCH /threads/{id}` (read/unread, star, move, archive, labels), `POST /threads/{id}/draft`, managing agent inboxes, their keys and held mail, rejecting an agent''s email — never sends |
| `send` (also) | approving an agent''s waiting email (`POST /approvals/{id}/approve`) |
A request without the needed scope gets `403` with code `missing_scope`. ## Rate limits
120 requests per minute per key and 60 per minute per IP, then a
one-minute cooldown. Responses carry `X-RateLimit-Limit` / `X-RateLimit-Remaining`;
a `429` carries `Retry-After` (seconds). Sending has its own per-mailbox and
per-workspace hourly limits and new-domain warm-up caps (also `429`). ## Idempotency
Send an `Idempotency-Key` header (any 1–255 printable ASCII characters — a UUID
is ideal) on `POST /send` and `POST /threads/{id}/reply`. Keys are scoped to your
API key and kept for 24 hours:
- same key + same body → the original response is replayed (same status and
JSON, plus `Idempotency-Replayed: true`); nothing is sent again;
- same key + a different body → `422` `idempotency_key_reused`;
- same key while the first request is still running → `409` `idempotency_in_progress`. Only successful responses are stored: a refused request sent nothing, so you may
fix it and retry with the same key. Always retry sends with the key you first used. ## Errors
Errors are JSON: `{ "error": "", "code": "" }`. `error` is for
humans and may change; `code` is stable: `bad_request`, `unauthorized`, `missing_scope`, `forbidden`, `not_found`, `conflict`, `idempotency_in_progress`, `idempotency_key_reused`, `payload_too_large`, `unprocessable`, `locked`, `rate_limited`, `insufficient_storage`, `server_error`, `upstream_failed`, `limit_reached`. A `503` `server_error` with `Retry-After` means the service is briefly unavailable:
retry, and keep the key — only `401` says it is invalid. ## Pagination
List endpoints return `nextCursor`; pass it back as `?cursor=` for the next page
(`null` on the last page). `limit` is 1–100 (default 25). ## Privacy
Bcc recipients appear only to the person who sent the message or was themselves
Bcc''d — the same rule as the app. Reading a thread over the API never marks it
read; `PATCH` it to change state. ## Ids
Thread, message and attachment ids are opaque strings. A message''s `id` is the
same value webhooks send as `emailId`; `messageId` is the RFC 5322 Message-ID. ## Agent inboxes
Give an AI agent its own inbox on your domain (`POST /inboxes`), with a person who
sponsors it and guardrails on by default. Its id is its mailbox id, so every mail
endpoint above works with it. An **agent key** (`POST /inboxes/{id}/keys`, or
`createKey` on create) reaches that one inbox and nothing else.'
contact:
name: SuperMailOS
url: https://supermailos.com/contact
servers:
- url: https://supermailos.com
description: Production
security:
- bearerAuth: []
tags:
- name: Domains
paths:
/api/v1/domains:
get:
operationId: listDomains
tags:
- Domains
summary: List domains
description: The workspace's domains with their status and what's wrong with their DNS, plus how many the plan allows. A workspace owner's or admin's key; an agent's own key gets `403`.
responses:
'200':
description: Domains.
headers:
X-RateLimit-Limit:
$ref: '#/components/headers/X-RateLimit-Limit'
X-RateLimit-Remaining:
$ref: '#/components/headers/X-RateLimit-Remaining'
content:
application/json:
schema:
type: object
required:
- domains
- allowance
properties:
domains:
type: array
items:
$ref: '#/components/schemas/DomainSummary'
allowance:
type: object
properties:
used:
type: integer
description: Custom domains in the workspace.
limit:
type:
- integer
- 'null'
description: '`null`: unlimited.'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'404':
$ref: '#/components/responses/NotFound'
'429':
$ref: '#/components/responses/RateLimited'
security:
- bearerAuth: []
x-required-scope: read
x-codeSamples:
- lang: curl
label: curl
source: "curl \"https://supermailos.com/api/v1/domains\" \\\n -H \"Authorization: Bearer $SUPERMAILOS_API_KEY\""
- lang: TypeScript
label: TypeScript
source: "const res = await fetch(\"https://supermailos.com/api/v1/domains\", {\n method: \"GET\",\n headers: {\n Authorization: `Bearer ${process.env.SUPERMAILOS_API_KEY}`,\n },\n});\nif (!res.ok) throw new Error(`${res.status}: ${(await res.json()).error}`);\nconst data = await res.json();"
- lang: Python
label: Python
source: "import os\nimport requests\n\nres = requests.get(\n \"https://supermailos.com/api/v1/domains\",\n headers={\n \"Authorization\": f\"Bearer {os.environ['SUPERMAILOS_API_KEY']}\",\n },\n timeout=30,\n)\nres.raise_for_status()\ndata = res.json()"
post:
operationId: addDomain
tags:
- Domains
summary: Add a domain
description: 'Adds a domain and answers with the DNS records to publish at its DNS host, and where to publish them (`setup`). Nothing changes in the domain''s DNS or where its email goes today: publishing the MX records later moves its incoming email here. A domain the workspace already has comes back unchanged (`200`, `created: false`). A workspace owner''s or admin''s key; plan limits apply (`403` `limit_reached`), and at most 10 domains an hour can be added through the API.'
requestBody:
required: true
content:
application/json:
schema:
type: object
additionalProperties: false
required:
- domain
properties:
domain:
type: string
maxLength: 253
examples:
- acme.com
description: A domain you own, or a subdomain of one (agents.acme.com).
responses:
'200':
description: The workspace already has it.
headers:
X-RateLimit-Limit:
$ref: '#/components/headers/X-RateLimit-Limit'
X-RateLimit-Remaining:
$ref: '#/components/headers/X-RateLimit-Remaining'
content:
application/json:
schema:
type: object
required:
- domain
- created
properties:
domain:
$ref: '#/components/schemas/Domain'
created:
type: boolean
const: false
'201':
description: Added.
headers:
X-RateLimit-Limit:
$ref: '#/components/headers/X-RateLimit-Limit'
X-RateLimit-Remaining:
$ref: '#/components/headers/X-RateLimit-Remaining'
content:
application/json:
schema:
type: object
required:
- domain
- created
properties:
domain:
$ref: '#/components/schemas/Domain'
created:
type: boolean
const: true
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'404':
$ref: '#/components/responses/NotFound'
'409':
$ref: '#/components/responses/Conflict'
'429':
$ref: '#/components/responses/RateLimited'
security:
- bearerAuth: []
x-required-scope: write
x-codeSamples:
- lang: curl
label: curl
source: "curl -X POST \"https://supermailos.com/api/v1/domains\" \\\n -H \"Authorization: Bearer $SUPERMAILOS_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\"domain\":\"acme.com\"}'"
- lang: TypeScript
label: TypeScript
source: "const res = await fetch(\"https://supermailos.com/api/v1/domains\", {\n method: \"POST\",\n headers: {\n Authorization: `Bearer ${process.env.SUPERMAILOS_API_KEY}`,\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify({\n \"domain\": \"acme.com\"\n }),\n});\nif (!res.ok) throw new Error(`${res.status}: ${(await res.json()).error}`);\nconst data = await res.json();"
- lang: Python
label: Python
source: "import os\nimport requests\n\nres = requests.post(\n \"https://supermailos.com/api/v1/domains\",\n headers={\n \"Authorization\": f\"Bearer {os.environ['SUPERMAILOS_API_KEY']}\",\n },\n json={\n \"domain\": \"acme.com\",\n },\n timeout=30,\n)\nres.raise_for_status()\ndata = res.json()"
/api/v1/domains/{id}:
get:
operationId: getDomain
tags:
- Domains
summary: Get a domain
description: 'One domain by id or name: its status, every DNS record it needs with what the last check found, where its DNS is hosted, and the next step.'
parameters:
- name: id
in: path
required: true
schema:
type: string
description: The domain's id or name (acme.com).
responses:
'200':
description: The domain.
headers:
X-RateLimit-Limit:
$ref: '#/components/headers/X-RateLimit-Limit'
X-RateLimit-Remaining:
$ref: '#/components/headers/X-RateLimit-Remaining'
content:
application/json:
schema:
type: object
required:
- domain
properties:
domain:
$ref: '#/components/schemas/Domain'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'404':
$ref: '#/components/responses/NotFound'
'429':
$ref: '#/components/responses/RateLimited'
security:
- bearerAuth: []
x-required-scope: read
x-codeSamples:
- lang: curl
label: curl
source: "curl \"https://supermailos.com/api/v1/domains/acme.com\" \\\n -H \"Authorization: Bearer $SUPERMAILOS_API_KEY\""
- lang: TypeScript
label: TypeScript
source: "const res = await fetch(\"https://supermailos.com/api/v1/domains/acme.com\", {\n method: \"GET\",\n headers: {\n Authorization: `Bearer ${process.env.SUPERMAILOS_API_KEY}`,\n },\n});\nif (!res.ok) throw new Error(`${res.status}: ${(await res.json()).error}`);\nconst data = await res.json();"
- lang: Python
label: Python
source: "import os\nimport requests\n\nres = requests.get(\n \"https://supermailos.com/api/v1/domains/acme.com\",\n headers={\n \"Authorization\": f\"Bearer {os.environ['SUPERMAILOS_API_KEY']}\",\n },\n timeout=30,\n)\nres.raise_for_status()\ndata = res.json()"
/api/v1/domains/{id}/verify:
post:
operationId: verifyDomain
tags:
- Domains
summary: Check a domain's DNS now
description: 'Checks the domain''s live DNS now, like Verify now in the app, asking its own nameservers first, and answers with its updated status. A check from the last 10 seconds is answered from its result (`checked: false`). Unverified domains are also re-checked on a schedule; the `domain.verified` webhook tells you when one goes live.'
parameters:
- name: id
in: path
required: true
schema:
type: string
description: The domain's id or name (acme.com).
responses:
'200':
description: Checked.
headers:
X-RateLimit-Limit:
$ref: '#/components/headers/X-RateLimit-Limit'
X-RateLimit-Remaining:
$ref: '#/components/headers/X-RateLimit-Remaining'
content:
application/json:
schema:
type: object
required:
- domain
- checked
properties:
domain:
$ref: '#/components/schemas/Domain'
checked:
type: boolean
description: '`false`: answered from a check moments ago.'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'404':
$ref: '#/components/responses/NotFound'
'429':
$ref: '#/components/responses/RateLimited'
security:
- bearerAuth: []
x-required-scope: read
x-codeSamples:
- lang: curl
label: curl
source: "curl -X POST \"https://supermailos.com/api/v1/domains/acme.com/verify\" \\\n -H \"Authorization: Bearer $SUPERMAILOS_API_KEY\""
- lang: TypeScript
label: TypeScript
source: "const res = await fetch(\"https://supermailos.com/api/v1/domains/acme.com/verify\", {\n method: \"POST\",\n headers: {\n Authorization: `Bearer ${process.env.SUPERMAILOS_API_KEY}`,\n },\n});\nif (!res.ok) throw new Error(`${res.status}: ${(await res.json()).error}`);\nconst data = await res.json();"
- lang: Python
label: Python
source: "import os\nimport requests\n\nres = requests.post(\n \"https://supermailos.com/api/v1/domains/acme.com/verify\",\n headers={\n \"Authorization\": f\"Bearer {os.environ['SUPERMAILOS_API_KEY']}\",\n },\n timeout=30,\n)\nres.raise_for_status()\ndata = res.json()"
/api/v1/domains/{id}/zone:
get:
operationId: getDomainZone
tags:
- Domains
summary: Download a domain's zone file
description: The domain's records as a BIND zone file, to import at a DNS host that accepts one. Optional records are marked. `409` for the workspace's instant subdomain, which has nothing to publish.
parameters:
- name: id
in: path
required: true
schema:
type: string
description: The domain's id or name (acme.com).
responses:
'200':
description: The zone file.
headers:
X-RateLimit-Limit:
$ref: '#/components/headers/X-RateLimit-Limit'
X-RateLimit-Remaining:
$ref: '#/components/headers/X-RateLimit-Remaining'
content:
text/plain:
schema:
type: string
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'404':
$ref: '#/components/responses/NotFound'
'409':
$ref: '#/components/responses/Conflict'
'429':
$ref: '#/components/responses/RateLimited'
security:
- bearerAuth: []
x-required-scope: read
x-codeSamples:
- lang: curl
label: curl
source: "curl \"https://supermailos.com/api/v1/domains/acme.com/zone\" \\\n -H \"Authorization: Bearer $SUPERMAILOS_API_KEY\" \\\n -o acme.com.zone"
- lang: TypeScript
label: TypeScript
source: "import { writeFile } from \"node:fs/promises\";\n\nconst res = await fetch(\"https://supermailos.com/api/v1/domains/acme.com/zone\", {\n method: \"GET\",\n headers: {\n Authorization: `Bearer ${process.env.SUPERMAILOS_API_KEY}`,\n },\n});\nif (!res.ok) throw new Error(`${res.status}: ${(await res.json()).error}`);\nawait writeFile(\"acme.com.zone\", Buffer.from(await res.arrayBuffer()));"
- lang: Python
label: Python
source: "import os\nimport requests\n\nres = requests.get(\n \"https://supermailos.com/api/v1/domains/acme.com/zone\",\n headers={\n \"Authorization\": f\"Bearer {os.environ['SUPERMAILOS_API_KEY']}\",\n },\n timeout=30,\n)\nres.raise_for_status()\nwith open(\"acme.com.zone\", \"wb\") as f:\n f.write(res.content)"
components:
responses:
Unauthorized:
description: Missing, invalid or revoked API key.
headers: {}
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
NotFound:
description: Not found — or not reachable with this key.
headers: {}
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
Conflict:
description: A request with this Idempotency-Key is still in progress.
headers: {}
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
RateLimited:
description: Too many requests.
headers:
Retry-After:
$ref: '#/components/headers/Retry-After'
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
BadRequest:
description: The request is malformed.
headers: {}
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
Forbidden:
description: The key lacks the scope (`missing_scope`) or the access (`forbidden`).
headers: {}
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
headers:
Retry-After:
description: Seconds to wait before retrying.
schema:
type: integer
X-RateLimit-Limit:
description: Requests allowed per minute for this key.
schema:
type: integer
X-RateLimit-Remaining:
description: Requests left in the current minute.
schema:
type: integer
schemas:
DomainSetup:
type: object
required:
- url
- zoneFileUrl
- dnsProvider
- nextStep
properties:
url:
type: string
format: uri
description: 'The domain''s page in the app: one-click setup for some DNS hosts, step-by-step guides for the rest.'
zoneFileUrl:
type: string
format: uri
description: The records as a BIND zone file (GET /api/v1/domains/{id}/zone).
dnsProvider:
type:
- object
- 'null'
description: Where its DNS is hosted, from its nameservers; `null` when we can't tell.
properties:
id:
type: string
name:
type: string
oneClick:
type: boolean
description: The app can write the records with an API token from this host.
nextStep:
type: string
description: What to do next, in a sentence a person can follow.
Domain:
allOf:
- $ref: '#/components/schemas/DomainSummary'
- type: object
required:
- records
properties:
records:
type: array
items:
$ref: '#/components/schemas/DnsRecord'
setup:
$ref: '#/components/schemas/DomainSetup'
description: Custom domains only.
DomainSummary:
type: object
required:
- id
- domain
- kind
- status
- canSend
- createdAt
- verifiedAt
- lastCheckedAt
- nextCheckAt
- problems
properties:
id:
type: string
domain:
type: string
examples:
- acme.com
kind:
type: string
enum:
- custom
- instant
description: '`instant`: the workspace''s free subdomain of ours, with nothing to set up.'
status:
type: string
enum:
- pending
- verifying
- verified
- failed
canSend:
type: boolean
description: Mail can be sent from it (it's verified).
createdAt:
type: string
format: date-time
verifiedAt:
type:
- string
- 'null'
format: date-time
lastCheckedAt:
type:
- string
- 'null'
format: date-time
nextCheckAt:
type:
- string
- 'null'
format: date-time
description: The next scheduled check, while it isn't verified.
problems:
type: array
items:
type: string
description: What's wrong, one line per failing required record.
DnsRecord:
type: object
required:
- purpose
- type
- host
- name
- value
- required
- status
properties:
purpose:
type: string
enum:
- mx
- spf
- dkim
- dmarc
- tracking
- bimi
type:
type: string
enum:
- MX
- TXT
- CNAME
host:
type: string
description: 'Relative to the domain: `@` is the domain itself.'
name:
type: string
description: The full name the record lives at.
value:
type: string
priority:
type: integer
description: MX only.
ttl:
type: integer
required:
type: boolean
description: Needed to verify the domain.
status:
type: string
enum:
- unknown
- checking
- verified
- missing
- mismatch
description: What the last check found.
reason:
type: string
description: Why the last definite check failed.
warning:
type: string
description: A problem that doesn't stop verification (e.g. another provider's MX at the same priority).
suggestedValue:
type: string
description: A value that would fix it, when one can be computed (e.g. a merged SPF).
Error:
type: object
required:
- error
- code
properties:
error:
type: string
description: Human-readable message.
code:
type: string
description: Stable machine-readable code.
enum:
- bad_request
- unauthorized
- missing_scope
- forbidden
- not_found
- conflict
- idempotency_in_progress
- idempotency_key_reused
- payload_too_large
- unprocessable
- locked
- rate_limited
- insufficient_storage
- server_error
- upstream_failed
- limit_reached
securitySchemes:
bearerAuth:
type: http
scheme: bearer
bearerFormat: smk_…
description: A workspace API key from Settings → Developers → API keys.
externalDocs:
description: Quick reference (agent skill)
url: https://supermailos.com/.well-known/agent-skills/supermailos/SKILL.md