API referenceDomains

Delete a domain

Deletes a custom domain you own and tears down its authenticated sending.

Endpoint
DELETE https://api.dairo.app/v1/domains/{domain}

Deletes a custom domain you own and tears down its authenticated sending. A domain with no inboxes is removed immediately and returns 204 with an empty body. A domain that still owns inboxes is refused with a structured 409 (code: cascade_confirmation_required) whose error.details carry requiresCascadeConfirmation: true plus the exact inboxes and messages counts a delete would remove, so you can confirm before destroying data. Re-send with cascade=true — as the ?cascade=true query parameter or a JSON body {"cascade": true} (the query wins when both are present) — to delete the domain together with all of its inboxes and their threads, messages, and attachments in one atomic transaction; compliance and audit records are retained with their inbox reference nulled. The {domain} path segment is the domain name, the included dairo.app domain cannot be deleted, and the call requires domains:write with a limit of 20 deletes per hour.

Scope: domains:write. Send the API key as a bearer token; Scopes lists what each one reaches.

Request

cURL
curl -X DELETE "https://api.dairo.app/v1/domains/yourapp.com" \
  -H "Authorization: Bearer $DAIRO_API_KEY"

Path parameters

NameTypeRequiredDescription
domainstringyesThe domain name, such as yourapp.com.

Query parameters

NameTypeRequiredDescription
cascadebooleannoWhen true, also delete every inbox on this domain and all of their messages/threads/attachments in one atomic, org-scoped transaction. Required to delete a domain that still owns inboxes.

Response

204 Success, no body.

Errors

Every error has the same body, {"error": {"type", "code", "message", "param"}}; branch on code. Errors lists every code.

StatusMeaning
400The request is malformed or a value is invalid (invalid_request, invalid_domain, idempotency_key_mismatch).
401The API key is missing or invalid.
403The key lacks the scope this endpoint needs (scope_missing) or may not do this (not_permitted).
404No such resource in this account (resource_not_found).
409The resource already exists or its state does not allow this (duplicate_resource or a condition-specific code).
429Rate limit, plan limit, budget or spend cap reached (rate_limited, plan_limit_reached, budget_exceeded, spend_cap_reached).
500An unexpected error; retry with backoff, then contact support (internal_error).

On this page