API Reference

Delete a domain

DELETE /domains/:id — remove a domain and its sending identity.

DELETE/domains/:id

Deletes a domain and removes its sending identity. Requires a key with full access.

Deletion is blocked while a scheduled email still depends on this domain — the request returns a validation_error telling you to cancel that email first.
import { MailBlastr } from 'mailblastr';

const mb = new MailBlastr('mb_xxxxxxxxx');

const { data, error } = await mb.domains.remove('d91a7c4e-1f2b-4a8c-9e3d-7b5f0a2c1d6e');
console.log({ data, error });

Response:

{
  "object": "domain",
  "id": "d91a7c4e-1f2b-4a8c-9e3d-7b5f0a2c1d6e",
  "deleted": true
}

Errors: not_found if the domain does not exist or is not yours, validation_error if a scheduled email still uses it, invalid_access if the key lacks full access. See Errors.