AgentMail Domains API
The domains API from AgentMail — 4 operation(s) for domains.
The domains API from AgentMail — 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/agentmail:agentmail-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: Reference Domains API
version: 1.0.0
servers:
- url: https://api.agentmail.to
description: prod
- url: https://x402.api.agentmail.to
description: prod-x402
- url: https://mpp.api.agentmail.to
description: prod-mpp
- url: https://api.agentmail.eu
description: eu-prod
tags:
- name: Domains
paths:
/v0/domains:
get:
operationId: domains_list
summary: List Domains
description: '**CLI:**
```bash
agentmail domains list
```'
tags:
- Domains
parameters:
- name: limit
in: query
required: false
schema:
$ref: '#/components/schemas/Limit'
- name: page_token
in: query
required: false
schema:
$ref: '#/components/schemas/PageToken'
- name: ascending
in: query
required: false
schema:
$ref: '#/components/schemas/Ascending'
responses:
'200':
description: Response with status 200
content:
application/json:
schema:
$ref: '#/components/schemas/domains_ListDomainsResponse'
security:
- Bearer: []
post:
operationId: domains_create
summary: Create Domain
description: '**CLI:**
```bash
agentmail domains create --domain example.com
```'
tags:
- Domains
responses:
'200':
description: Response with status 200
content:
application/json:
schema:
$ref: '#/components/schemas/domains_Domain'
'400':
description: Error response with status 400
content:
application/json:
schema:
$ref: '#/components/schemas/ValidationErrorResponse'
'422':
description: Error response with status 422
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/domains_CreateDomainRequest'
security:
- Bearer: []
/v0/domains/{domain_id}:
get:
operationId: domains_get
summary: Get Domain
description: '**CLI:**
```bash
agentmail domains get --domain-id
```'
tags:
- Domains
parameters:
- name: domain_id
in: path
required: true
schema:
$ref: '#/components/schemas/domains_DomainId'
responses:
'200':
description: Response with status 200
content:
application/json:
schema:
$ref: '#/components/schemas/domains_Domain'
'404':
description: Error response with status 404
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
security:
- Bearer: []
patch:
operationId: domains_update
summary: Update Domain
description: '**CLI:**
```bash
agentmail domains update --domain-id
```'
tags:
- Domains
parameters:
- name: domain_id
in: path
required: true
schema:
$ref: '#/components/schemas/domains_DomainId'
responses:
'200':
description: Response with status 200
content:
application/json:
schema:
$ref: '#/components/schemas/domains_Domain'
'404':
description: Error response with status 404
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/domains_UpdateDomainRequest'
security:
- Bearer: []
delete:
operationId: domains_delete
summary: Delete Domain
description: '**CLI:**
```bash
agentmail domains delete --domain-id
```'
tags:
- Domains
parameters:
- name: domain_id
in: path
required: true
schema:
$ref: '#/components/schemas/domains_DomainId'
responses:
'200':
description: Successful response
'404':
description: Error response with status 404
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
security:
- Bearer: []
/v0/domains/{domain_id}/zone-file:
get:
operationId: domains_getZoneFile
summary: Get Zone File
description: '**CLI:**
```bash
agentmail domains get-zone-file --domain-id
```'
tags:
- Domains
parameters:
- name: domain_id
in: path
required: true
schema:
$ref: '#/components/schemas/domains_DomainId'
responses:
'200':
description: Response with status 200
content:
application/octet-stream:
schema:
type: string
format: binary
'404':
description: Error response with status 404
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
security:
- Bearer: []
/v0/domains/{domain_id}/verify:
post:
operationId: domains_verify
summary: Verify Domain
description: '**CLI:**
```bash
agentmail domains verify --domain-id
```'
tags:
- Domains
parameters:
- name: domain_id
in: path
required: true
schema:
$ref: '#/components/schemas/domains_DomainId'
responses:
'200':
description: Successful response
'404':
description: Error response with status 404
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'409':
description: Error response with status 409
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'422':
description: Error response with status 422
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
security:
- Bearer: []
/v0/domains/{domain_id}/setup-link:
get:
operationId: domains_getSetupLink
summary: Get Setup Link
description: 'Build a one-click DNS setup link for the domain via the Domain Connect standard. When the domain''s DNS provider supports Domain Connect and carries the AgentMail template, the response contains a signed URL: opening it lets the domain owner approve the required DNS records at their provider, which writes them automatically — no copy-paste. When the provider does not support it, `supported` is `false` and the domain''s `records` should be added manually instead.'
tags:
- Domains
parameters:
- name: domain_id
in: path
required: true
schema:
$ref: '#/components/schemas/domains_DomainId'
responses:
'200':
description: Response with status 200
content:
application/json:
schema:
$ref: '#/components/schemas/domains_GetSetupLinkResponse'
'404':
description: Error response with status 404
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'409':
description: Error response with status 409
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'422':
description: Error response with status 422
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
security:
- Bearer: []
components:
schemas:
domains_CreateDomainRequest:
type: object
properties:
domain:
$ref: '#/components/schemas/domains_DomainName'
allow_conflicting_provider:
type: boolean
description: 'Allow registration when the domain already has Google Workspace MX records.
Defaults to false; registration otherwise returns 422 when a conflicting
provider is detected.
This flag does not configure DNS or inbound routing. For shared Google
Workspace domains, follow the [Google Workspace guide](/google-workspace).
Only checked when `inbound_enabled` is true; a send-only domain skips the check.'
feedback_enabled:
$ref: '#/components/schemas/domains_FeedbackEnabled'
inbound_enabled:
$ref: '#/components/schemas/domains_InboundEnabled'
subdomains_enabled:
$ref: '#/components/schemas/domains_SubdomainsEnabled'
tracking_enabled:
$ref: '#/components/schemas/domains_TrackingEnabled'
required:
- domain
title: CreateDomainRequest
ErrorCode:
type: string
description: Stable, machine-readable error code in snake_case (for example, not_found or missing_permission). Branch on this rather than the message text.
title: ErrorCode
domains_RecordStatus:
type: string
enum:
- MISSING
- INVALID
- VALID
title: RecordStatus
pods_PodId:
type: string
description: ID of pod.
title: PodId
domains_DomainItem:
type: object
properties:
pod_id:
$ref: '#/components/schemas/pods_PodId'
domain_id:
$ref: '#/components/schemas/domains_DomainId'
domain:
$ref: '#/components/schemas/domains_DomainName'
feedback_enabled:
$ref: '#/components/schemas/domains_FeedbackEnabled'
inbound_enabled:
$ref: '#/components/schemas/domains_InboundEnabled'
description: Absent on domains created before this field existed; those receive email.
subdomains_enabled:
$ref: '#/components/schemas/domains_SubdomainsEnabled'
tracking_enabled:
$ref: '#/components/schemas/domains_TrackingEnabled'
client_id:
$ref: '#/components/schemas/domains_ClientId'
updated_at:
type: string
format: date-time
description: Time at which the domain was last updated.
created_at:
type: string
format: date-time
description: Time at which the domain was created.
required:
- domain_id
- domain
- feedback_enabled
- subdomains_enabled
- tracking_enabled
- updated_at
- created_at
title: DomainItem
Count:
type: integer
description: Number of items returned.
title: Count
ValidationErrorResponse:
type: object
properties:
name:
$ref: '#/components/schemas/ErrorName'
code:
$ref: '#/components/schemas/ErrorCode'
message:
$ref: '#/components/schemas/ErrorMessage'
errors:
description: Validation errors. Each entry has a path and a message identifying the invalid field.
fix:
$ref: '#/components/schemas/ErrorFix'
docs:
$ref: '#/components/schemas/ErrorDocs'
required:
- name
- errors
title: ValidationErrorResponse
ErrorDocs:
type: string
description: Link to the error reference entry for this code.
title: ErrorDocs
domains_ListDomainsResponse:
type: object
properties:
count:
$ref: '#/components/schemas/Count'
limit:
$ref: '#/components/schemas/Limit'
next_page_token:
$ref: '#/components/schemas/PageToken'
domains:
type: array
items:
$ref: '#/components/schemas/domains_DomainItem'
description: Ordered by `created_at` descending.
required:
- count
- domains
title: ListDomainsResponse
domains_RecordType:
type: string
enum:
- TXT
- CNAME
- MX
title: RecordType
domains_VerificationRecord:
type: object
properties:
type:
$ref: '#/components/schemas/domains_RecordType'
description: The type of the DNS record.
name:
type: string
description: The name or host of the record.
value:
type: string
description: The value of the record.
status:
$ref: '#/components/schemas/domains_RecordStatus'
description: The verification status of this specific record.
priority:
type: integer
description: The priority of the MX record.
reason:
type: string
description: Why the record is INVALID, when known. `duplicate_records` means the expected value is present but extra records coexist at the same name; `value_mismatch` means a record exists but does not match the expected value.
required:
- type
- name
- value
- status
title: VerificationRecord
domains_VerificationStatus:
type: string
enum:
- NOT_STARTED
- PENDING
- INVALID
- FAILED
- VERIFYING
- VERIFIED
title: VerificationStatus
domains_FeedbackEnabled:
type: boolean
description: Bounce and complaint notifications are sent to your inboxes.
title: FeedbackEnabled
ErrorMessage:
type: string
description: Error message.
title: ErrorMessage
domains_Status:
$ref: '#/components/schemas/domains_VerificationStatus'
description: The verification status of the domain.
title: Status
domains_Domain:
type: object
properties:
pod_id:
$ref: '#/components/schemas/pods_PodId'
domain_id:
$ref: '#/components/schemas/domains_DomainId'
domain:
$ref: '#/components/schemas/domains_DomainName'
status:
$ref: '#/components/schemas/domains_Status'
reason:
type: string
description: 'Why the domain is not (yet) VERIFIED, when known. `dns_records_missing` / `dns_records_invalid` point at the DNS records. The `ses_*` values mean the records look right and sending-infrastructure validation has not converged: `ses_dkim_pending` / `ses_mail_from_pending` (still checking), `ses_dkim_temporary_failure` / `ses_mail_from_temporary_failure` (a transient error the infrastructure keeps retrying on its own — usually resolves without changes), `ses_dkim_failed` / `ses_mail_from_failed` (a terminal verdict; re-verify after fixing), `ses_dkim_not_started` / `ses_mail_from_not_started` (the attribute was never configured on the identity — re-verify to push it), and `ses_not_verified_for_sending`. Absent when VERIFIED.'
feedback_enabled:
$ref: '#/components/schemas/domains_FeedbackEnabled'
inbound_enabled:
$ref: '#/components/schemas/domains_InboundEnabled'
description: Absent on domains created before this field existed; those receive email.
subdomains_enabled:
$ref: '#/components/schemas/domains_SubdomainsEnabled'
tracking_enabled:
$ref: '#/components/schemas/domains_TrackingEnabled'
records:
type: array
items:
$ref: '#/components/schemas/domains_VerificationRecord'
description: 'A list of DNS records required to verify the domain. Includes the apex
MX record unless `inbound_enabled` is false, and a wildcard MX record
(`*.<domain>`) when `subdomains_enabled` is true.'
client_id:
$ref: '#/components/schemas/domains_ClientId'
updated_at:
type: string
format: date-time
description: Time at which the domain was last updated.
created_at:
type: string
format: date-time
description: Time at which the domain was created.
required:
- domain_id
- domain
- status
- feedback_enabled
- subdomains_enabled
- tracking_enabled
- records
- updated_at
- created_at
title: Domain
domains_GetSetupLinkResponse:
type: object
properties:
supported:
type: boolean
description: Whether one-click setup is available for this domain. `false` means the domain's DNS provider does not support Domain Connect (or does not carry the AgentMail template yet) — add the domain's `records` manually instead.
provider_name:
type: string
description: Display name of the domain's DNS provider, for the setup button label.
url:
type: string
description: 'The signed Domain Connect apply URL. Open it in a browser: the domain owner signs in at their DNS provider, reviews the records, and approves — the provider writes them.'
width:
type: integer
description: Suggested popup width from the provider, in pixels.
height:
type: integer
description: Suggested popup height from the provider, in pixels.
state:
type: string
description: Opaque value echoed back on the provider's redirect. Store it before opening the URL and compare on return to tie the redirect to this request.
conflicting_provider:
type: string
description: Set when the domain currently has another email provider's MX records (for example Google Workspace). Applying the template would replace them — warn before proceeding.
required:
- supported
title: GetSetupLinkResponse
ErrorFix:
type: string
description: The concrete next action that resolves the error.
title: ErrorFix
Limit:
type: integer
description: Limit of number of items returned.
title: Limit
domains_TrackingEnabled:
type: boolean
description: 'Serve open tracking pixels from this domain. Adds a required `link.<domain>`
CNAME record to `records`, which must be published and verified before
`track_opens` can be used on a send.'
title: TrackingEnabled
domains_DomainName:
type: string
description: The name of the domain (e.g., `example.com`).
title: DomainName
domains_SubdomainsEnabled:
type: boolean
description: 'Allow inboxes on any subdomain of this domain. Adds a required wildcard MX
record (`*.<domain>`) to `records`.'
title: SubdomainsEnabled
domains_InboundEnabled:
type: boolean
description: 'Receive email for this domain. Defaults to `true`. Set `false` for a send-only
domain: the apex MX record is not required and is omitted from `records`, so the
domain''s existing email provider keeps receiving its mail. Inboxes on a send-only
domain can still send.'
title: InboundEnabled
ErrorName:
type: string
description: Name of error.
title: ErrorName
Ascending:
type: boolean
description: Sort in ascending temporal order.
title: Ascending
domains_UpdateDomainRequest:
type: object
properties:
feedback_enabled:
$ref: '#/components/schemas/domains_FeedbackEnabled'
inbound_enabled:
$ref: '#/components/schemas/domains_InboundEnabled'
subdomains_enabled:
$ref: '#/components/schemas/domains_SubdomainsEnabled'
tracking_enabled:
$ref: '#/components/schemas/domains_TrackingEnabled'
description: 'Provide at least one of `feedback_enabled`, `inbound_enabled`,
`subdomains_enabled`, or `tracking_enabled`. Omitted fields are left
unchanged; an empty body is rejected. Enabling `inbound_enabled` or
`subdomains_enabled` on a verified domain returns it to `PENDING` until the
newly required MX record (the apex MX, or the wildcard `*.<domain>`) is
published and verified.'
title: UpdateDomainRequest
domains_ClientId:
type: string
description: Client ID of domain.
title: ClientId
PageToken:
type: string
description: Page token for pagination.
title: PageToken
domains_DomainId:
type: string
description: The ID of the domain.
title: DomainId
ErrorResponse:
type: object
properties:
name:
$ref: '#/components/schemas/ErrorName'
code:
$ref: '#/components/schemas/ErrorCode'
message:
$ref: '#/components/schemas/ErrorMessage'
fix:
$ref: '#/components/schemas/ErrorFix'
docs:
$ref: '#/components/schemas/ErrorDocs'
required:
- name
- message
title: ErrorResponse
securitySchemes:
Bearer:
type: http
scheme: bearer
x-provenance:
method: harvested
publisher: AgentMail
source: https://docs.agentmail.to/openapi.json
note: split by refine-openapis from the provider's own published document, verified by fetch (openapi/_original/*.fetch.json);
stamped by stamp-openapi-provenance.py (roadmap#793)