import { createClient } from "@mailsai/sdk";
const client = createClient(); // reads MAILS_API_KEY
const result = await client.domains.get(
"dom_01JZX8K3M9Q4P7VN2YB6RTDC0E",
);
console.log(result);from mailsai import create_client
client = create_client() # reads MAILS_API_KEY
result = client.get_domain(
"dom_01JZX8K3M9Q4P7VN2YB6RTDC0E",
)
print(result)curl 'https://api.mails.ai/v1/domains/dom_01JZX8K3M9Q4P7VN2YB6RTDC0E' \
-H "Authorization: Bearer $MAILS_API_KEY"mails domains get dom_01JABC{
"name": "mails_domains_get",
"arguments": {
"domain_id": "dom_01JZX8K3M9Q4P7VN2YB6RTDC0E"
}
}{
"id": "dom_01JZXE8S0U2W4Y6A8C0E2G4J6L",
"domain": "mail.acme.com",
"status": "pending",
"provider": "ownmetal",
"dns_records": [
{
"type": "TXT",
"host": "dkim._domainkey.mail.acme.com",
"value": "v=DKIM1; k=rsa; p=MIIBIjANBgkq…",
"purpose": "dkim",
"required": true,
"verified": false,
"instruction": "Add this record exactly as shown."
},
{
"type": "TXT",
"host": "mail.acme.com",
"value": "v=spf1 ip4:15.204.67.226 ~all",
"purpose": "spf",
"required": false,
"verified": false,
"instruction": "If you already publish an SPF.",
"merge_token": "ip4:15.204.67.226"
},
{
"type": "TXT",
"host": "_dmarc.mail.acme.com",
"value": "v=DMARC1; p=none; rua=mailto:dmarc@mail.acme.com",
"purpose": "dmarc",
"required": false,
"verified": false,
"instruction": "Only if you have no DMARC record today. If you already publish one, KEEP IT — never lower an existing p=quarantine or p=reject to p=none. Point rua at a mailbox you control."
}
],
"fail_reason": null,
"last_check_at": null,
"verified_at": null,
"created_at": "2026-07-24T10:30:00.000Z"
}200 Domain status + the DNS records to create.
401 Missing or invalid API key.
403 The API key lacks the required scope
(insufficient_scope), or the token belongs to an
app connected by sign-in and this operation is
closed to connected apps
(connected_app_not_allowed).
404 Resource not found in this workspace, or the agent
a send names is archived (agent_archived).
500 Internal server error.Get a domain
import { createClient } from "@mailsai/sdk";
const client = createClient(); // reads MAILS_API_KEY
const result = await client.domains.get(
"dom_01JZX8K3M9Q4P7VN2YB6RTDC0E",
);
console.log(result);from mailsai import create_client
client = create_client() # reads MAILS_API_KEY
result = client.get_domain(
"dom_01JZX8K3M9Q4P7VN2YB6RTDC0E",
)
print(result)curl 'https://api.mails.ai/v1/domains/dom_01JZX8K3M9Q4P7VN2YB6RTDC0E' \
-H "Authorization: Bearer $MAILS_API_KEY"mails domains get dom_01JABC{
"name": "mails_domains_get",
"arguments": {
"domain_id": "dom_01JZX8K3M9Q4P7VN2YB6RTDC0E"
}
}{
"id": "dom_01JZXE8S0U2W4Y6A8C0E2G4J6L",
"domain": "mail.acme.com",
"status": "pending",
"provider": "ownmetal",
"dns_records": [
{
"type": "TXT",
"host": "dkim._domainkey.mail.acme.com",
"value": "v=DKIM1; k=rsa; p=MIIBIjANBgkq…",
"purpose": "dkim",
"required": true,
"verified": false,
"instruction": "Add this record exactly as shown."
},
{
"type": "TXT",
"host": "mail.acme.com",
"value": "v=spf1 ip4:15.204.67.226 ~all",
"purpose": "spf",
"required": false,
"verified": false,
"instruction": "If you already publish an SPF.",
"merge_token": "ip4:15.204.67.226"
},
{
"type": "TXT",
"host": "_dmarc.mail.acme.com",
"value": "v=DMARC1; p=none; rua=mailto:dmarc@mail.acme.com",
"purpose": "dmarc",
"required": false,
"verified": false,
"instruction": "Only if you have no DMARC record today. If you already publish one, KEEP IT — never lower an existing p=quarantine or p=reject to p=none. Point rua at a mailbox you control."
}
],
"fail_reason": null,
"last_check_at": null,
"verified_at": null,
"created_at": "2026-07-24T10:30:00.000Z"
}200 Domain status + the DNS records to create.
401 Missing or invalid API key.
403 The API key lacks the required scope
(insufficient_scope), or the token belongs to an
app connected by sign-in and this operation is
closed to connected apps
(connected_app_not_allowed).
404 Resource not found in this workspace, or the agent
a send names is archived (agent_archived).
500 Internal server error.Path Parameters
Domain id (dom_…).
Response
Domain id (dom_…).
The custom sending domain, lowercased.
pending → records issued; verifying → checks in progress; verified → agents on this domain send under their own identity; failed → 20 verify calls in a row did not pass. Not final: a failed domain is still re-checked automatically (less often the longer it fails, at most a day apart) and verifies by itself once its records resolve; verify still checks at once, and the count starts over on success or after a day without a verify call.
Backing sending infrastructure for this domain.
The records to create at your DNS host. Each record's verified says whether the last check found it, and every required one must be found for the domain to verify.
Why the last verification did not pass, when it didn't.
When the records were last checked: by a verify call, by the automatic re-checks of unverified domains, or by the daily re-check of verified ones. Null before the first check.
When the domain first verified. Null until then, and cleared again when the daily re-check of verified domains (06:40 UTC) finds a required record gone.
When the domain was added (UTC).
Was this page helpful?