Skip to main content
import { createClient } from "@mailsai/sdk";

const client = createClient(); // reads MAILS_API_KEY

const result = await client.domains.remove(
  "dom_01JZX8K3M9Q4P7VN2YB6RTDC0E",
);
console.log(result);
{
  "id": "dom_01JZX8K3M9Q4P7VN2YB6RTDC0E",
  "deleted": false
}

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.
DELETE/v1/domains/{id}scope · manage
import { createClient } from "@mailsai/sdk";

const client = createClient(); // reads MAILS_API_KEY

const result = await client.domains.remove(
  "dom_01JZX8K3M9Q4P7VN2YB6RTDC0E",
);
console.log(result);
{
  "id": "dom_01JZX8K3M9Q4P7VN2YB6RTDC0E",
  "deleted": false
}

Path Parameters

idstringrequired

Domain id (dom_…).

It is never sent from another domain instead.

Response

idstring

Id of the removed domain (dom_…): the id in the path.

deletedboolean

Always true. A domain that is not in this workspace answers 404 instead.

Was this page helpful?