import { createClient } from "@mailsai/sdk";
const client = createClient(); // reads MAILS_API_KEY
const result = await client.domains.verify(
"dom_01JZX8K3M9Q4P7VN2YB6RTDC0E",
);
console.log(result);from mailsai import create_client
client = create_client() # reads MAILS_API_KEY
result = client.verify_domain(
"dom_01JZX8K3M9Q4P7VN2YB6RTDC0E",
)
print(result)curl -X POST 'https://api.mails.ai/v1/domains/dom_01JZX8K3M9Q4P7VN2YB6RTDC0E/verify' \
-H "Authorization: Bearer $MAILS_API_KEY"mails domains verify dom_01JABC{
"name": "mails_domains_verify",
"arguments": {
"domain_id": "dom_01JZX8K3M9Q4P7VN2YB6RTDC0E"
}
}{
"id": "dom_01JZX8K3M9Q4P7VN2YB6RTDC0E",
"domain": "<domain>",
"status": "pending",
"provider": "<provider>",
"dns_records": [
{
"type": "TXT",
"host": "<host>",
"value": "<value>",
"purpose": "spf",
"required": false,
"verified": false,
"instruction": "<instruction>",
"merge_token": "<merge_token>"
}
],
"fail_reason": "<fail_reason>",
"last_check_at": "2026-10-04T12:00:00.000Z",
"verified_at": "2026-10-04T12:00:00.000Z",
"created_at": "2026-10-04T12:00:00.000Z"
}200 The domain with refreshed per-record verification
state.
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.Verify a domain now
import { createClient } from "@mailsai/sdk";
const client = createClient(); // reads MAILS_API_KEY
const result = await client.domains.verify(
"dom_01JZX8K3M9Q4P7VN2YB6RTDC0E",
);
console.log(result);from mailsai import create_client
client = create_client() # reads MAILS_API_KEY
result = client.verify_domain(
"dom_01JZX8K3M9Q4P7VN2YB6RTDC0E",
)
print(result)curl -X POST 'https://api.mails.ai/v1/domains/dom_01JZX8K3M9Q4P7VN2YB6RTDC0E/verify' \
-H "Authorization: Bearer $MAILS_API_KEY"mails domains verify dom_01JABC{
"name": "mails_domains_verify",
"arguments": {
"domain_id": "dom_01JZX8K3M9Q4P7VN2YB6RTDC0E"
}
}{
"id": "dom_01JZX8K3M9Q4P7VN2YB6RTDC0E",
"domain": "<domain>",
"status": "pending",
"provider": "<provider>",
"dns_records": [
{
"type": "TXT",
"host": "<host>",
"value": "<value>",
"purpose": "spf",
"required": false,
"verified": false,
"instruction": "<instruction>",
"merge_token": "<merge_token>"
}
],
"fail_reason": "<fail_reason>",
"last_check_at": "2026-10-04T12:00:00.000Z",
"verified_at": "2026-10-04T12:00:00.000Z",
"created_at": "2026-10-04T12:00:00.000Z"
}200 The domain with refreshed per-record verification
state.
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_…).
Each call is an attempt: one that does not pass counts toward failed, 20 in a row mark the domain failed, and the count starts over on success or after a day without a call. Polling is rarely needed. We re-check an unverified domain every 15 minutes and a failed one at least daily, without counting, whatever its age or the workspace's plan, and it verifies at the first check after its records resolve.
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?