import { createClient } from "@mailsai/sdk";
const client = createClient(); // reads MAILS_API_KEY
const result = await client.domains.remove(
"dom_01JZX8K3M9Q4P7VN2YB6RTDC0E",
);
console.log(result);from mailsai import create_client
client = create_client() # reads MAILS_API_KEY
result = client.delete_domain(
"dom_01JZX8K3M9Q4P7VN2YB6RTDC0E",
)
print(result)curl -X DELETE 'https://api.mails.ai/v1/domains/dom_01JZX8K3M9Q4P7VN2YB6RTDC0E' \
-H "Authorization: Bearer $MAILS_API_KEY"mails domains delete dom_01JABC --yes{
"name": "mails_domains_delete",
"arguments": {
"domain_id": "dom_01JZX8K3M9Q4P7VN2YB6RTDC0E"
}
}{
"id": "dom_01JZX8K3M9Q4P7VN2YB6RTDC0E",
"deleted": false
}200 Deletion confirmation.
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.Remove a domain
Agents with addresses on this domain stop sending: every send from them is refused with 422
domain_not_verified until the domain is added and verified again, or the agent is recreated on your workspace's mails.ai subdomain.import { createClient } from "@mailsai/sdk";
const client = createClient(); // reads MAILS_API_KEY
const result = await client.domains.remove(
"dom_01JZX8K3M9Q4P7VN2YB6RTDC0E",
);
console.log(result);from mailsai import create_client
client = create_client() # reads MAILS_API_KEY
result = client.delete_domain(
"dom_01JZX8K3M9Q4P7VN2YB6RTDC0E",
)
print(result)curl -X DELETE 'https://api.mails.ai/v1/domains/dom_01JZX8K3M9Q4P7VN2YB6RTDC0E' \
-H "Authorization: Bearer $MAILS_API_KEY"mails domains delete dom_01JABC --yes{
"name": "mails_domains_delete",
"arguments": {
"domain_id": "dom_01JZX8K3M9Q4P7VN2YB6RTDC0E"
}
}{
"id": "dom_01JZX8K3M9Q4P7VN2YB6RTDC0E",
"deleted": false
}200 Deletion confirmation.
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.Was this page helpful?