Summary
Add a custom domain and return SPF, DKIM, DMARC, and MX records plus a verify TXT. Free includes 1. Starter includes 15 and Pro includes 200. A domain past that cap returns HTTP 402 plan_limit_exceeded with upgrade_url. A hostname in a zone Cooper's operator manages returns HTTP 409 domain_reserved. Free cannot buy extra domains. GET /api/v1/domains lists them. GET /api/v1/domains/:id shows status (pending until DNS matches, then verified), mail, status_detail, dns.mode, and warnings. Each record includes status (valid, missing, or invalid), found from the last check, and hint. hint is null when the record is valid or no specific mistake was found. Otherwise hint is {code, message, found_at} and says what to change. warnings is an empty array when none. existing_mail_provider means this hostname already has MX at another provider, and the message suggests a subdomain such as agents.example.com. spf_dash_all, dmarc_reject, and multiple_spf name an SPF or DMARC record that would block or split mail. Which records are valid, missing, or invalid is unchanged. The same domain or client_id returns the original row. Cooper writes the records only when an operator-family account adds a hostname that is already an active Cloudflare zone on the operator account, and never registers a domain or creates a zone. When custom-domain mail is on and the hostname is not a zone on that account, dns.mode is external and the records are what you publish at your DNS host, including host, type, value, priority, and ttl. The daily cron GET /api/v1/internal/digests/flush checks DNS and sends domain.verified. When usage is at 80 percent of a plan limit, the response includes notices. Mail on a custom domain stays off until custom-domain mail is enabled. {{domainMailNotice}}
Request
{
"domain": "agents.example.com",
"client_id": "zone-1"
}Response
The OpenAPI document does not declare a JSON response schema for this call. The summary is the contract.Errors
- HTTP 402 plan_limit_exceeded
- HTTP 409 domain_reserved
Idempotency
client_id makes this write idempotent. Sending the same client_id again returns the original object instead of creating a duplicate.