import { createClient } from "@mailsai/sdk";
const client = createClient(); // reads MAILS_API_KEY
const result = await client.domains.list();
console.log(result);from mailsai import create_client
client = create_client() # reads MAILS_API_KEY
result = client.list_domains()
print(result)curl 'https://api.mails.ai/v1/domains' \
-H "Authorization: Bearer $MAILS_API_KEY"mails domains list{ "name": "mails_domains_list", "arguments": {} }{
"data": [
{
"id": "dom_01JZX8K3M9Q4P7VN2YB6RTDC0E",
"domain": "<domain>",
"status": "pending",
"provider": "<provider>",
"dns_records": [
{
"type": null,
"host": null,
"value": null,
"purpose": null,
"required": null,
"verified": null,
"instruction": null,
"merge_token": null
}
],
"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"
}
],
"has_more": false,
"next_cursor": "<next_cursor>"
}200 This workspace's custom domains.
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).
500 Internal server error.List custom domains
import { createClient } from "@mailsai/sdk";
const client = createClient(); // reads MAILS_API_KEY
const result = await client.domains.list();
console.log(result);from mailsai import create_client
client = create_client() # reads MAILS_API_KEY
result = client.list_domains()
print(result)curl 'https://api.mails.ai/v1/domains' \
-H "Authorization: Bearer $MAILS_API_KEY"mails domains list{ "name": "mails_domains_list", "arguments": {} }{
"data": [
{
"id": "dom_01JZX8K3M9Q4P7VN2YB6RTDC0E",
"domain": "<domain>",
"status": "pending",
"provider": "<provider>",
"dns_records": [
{
"type": null,
"host": null,
"value": null,
"purpose": null,
"required": null,
"verified": null,
"instruction": null,
"merge_token": null
}
],
"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"
}
],
"has_more": false,
"next_cursor": "<next_cursor>"
}200 This workspace's custom domains.
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).
500 Internal server error.Was this page helpful?