Skip to content

Cloudflare MCP Server — 284 tools

The Cloudflare DADL turns Cloudflare's API into an MCP server that Claude, GPT or any MCP-compatible agent can consume directly. One YAML file declares all 284 tools — email, page, zone, worker, account, secondary, and more — and ToolMesh serves them at runtime. No Python boilerplate, no per-endpoint code, no separate MCP server process.

Below: the endpoint coverage matrix, a two-block ToolMesh setup, the full tool reference grouped by Cloudflare feature area, required credential scopes.

Source: Cloudflare REST API v4

Credits: Dunkel Cloud GmbH -- maintainerUpdated: 2026-10-10

Which Cloudflare endpoints are covered?

19% (284 of ~1500 endpoints)

Focus: zones, DNS records, DNSSEC, DNS settings, secondary DNS incoming/outgoing/peers/TSIGs/ACLs, DNS Firewall clusters, Registrar domains/search/pricing/registration, Pages projects/deployments/domains, Workers scripts/routes/secrets/cron/deployments/tails, KV namespaces/keys, R2 buckets/lifecycle/CORS/domains, D1 databases/queries, SSL/TLS certificates/custom hostnames, cache purge/settings, load balancers/pools/monitors, firewall rules/rulesets/rate limits, page rules, Access apps/policies/groups, accounts/members/roles, Email Routing settings/DNS/rules/catch-all/destination addresses, Email Sending send/raw MIME/sending subdomains/DNS status/suppressions/reputation/limits, Email Auth DMARC reports/SPF inspection

Missing: Argo, Spectrum, Stream, Images (transformations), Email Security (Area 1), Email Routing wrangler plan endpoint, Radar email statistics, Waiting Room, Web3, Turnstile, Queues, Hyperdrive, Vectorize, AI Gateway, Durable Objects, Zone Lockdown, IP Access Rules, User-Agent Blocking, Logpush, Notifications, Audit Logs

Last reviewed: 2026-10-10

How do you configure the Cloudflare DADL?

  1. Log in to Cloudflare dashboard at https://dash.cloudflare.com
  2. Go to My Profile (top right) → API Tokens
  3. Click 'Create Token'
  4. Use a template (e.g. 'Edit zone DNS') or create a custom token with specific permissions
  5. Copy the token immediately -- it is shown only once

Environment variable: CREDENTIAL_CLOUDFLARE_API_TOKEN

Authentication docs ↗

API Tokens (scoped) are preferred over the Global API Key. Tokens can be restricted to specific zones and permissions. The Global API Key (X-Auth-Email + X-Auth-Key headers) grants full account access and is only needed for the rare endpoints that reject tokens. Registrar: the registrar/domains endpoints DO work with a scoped API Token, but only if it carries the 'Account > Registrar > Domains' permission (Read for list/get, Edit for update) -- without it Cloudflare returns HTTP 403 (code 10000). Verified working against the live API with a scoped token plus that permission; the Global API Key is not required. The Registrar API beta tools (search_registrar_domains, check_registrar_domains, register_registrar_domain) additionally require the token's Registrar permission at Edit/write level AND a billing profile + default registrant contact configured on the account. Email: routing settings, DNS, rules and catch-all need the zone permission 'Email Routing Rules' (Read/Edit); destination addresses need the account permission 'Email Routing Addresses' (Read/Edit); DMARC/SPF tools need 'DMARC Management' (Read/Edit); Email Sending (send, sending subdomains, suppressions, reputation, limits) needs the account permission 'Email Sending' (Read/Edit) plus a sending subdomain whose DNS status is ready. Verified 2026-09-27 against the live API: routing settings/DNS/rules/catch-all, destination addresses, DMARC status/config, SPF inspection, sending limits, sending-subdomain preview and the suppression CRUD work with a scoped token carrying those permissions; the account-wide rules list still returned 403 with per-zone rule permissions, and reputation returns 404 until Email Sending is activated.

How do you install the Cloudflare MCP server with ToolMesh?

Add to your backends.yaml:

- name: cloudflare
  transport: rest
  dadl: cloudflare.dadl

Set the credential:

CREDENTIAL_CLOUDFLARE_API_TOKEN=your-token-here

What 284 tools does the Cloudflare DADL expose?

GETlist_accountsList all accounts you have access to. The returned id is the account_id that every account-scoped tool requires (Pages, Workers, KV, R2, D1, Access, Email Sending) -- call this first when you do not know it; most users see exactly one account.
GETget_accountGet account details
PUTupdate_accountUpdate account settings
GETlist_account_membersList all account members
GETget_account_memberGet account member details
POSTadd_account_memberAdd a member to an account
PUTupdate_account_memberUpdate account member roles
DELETEremove_account_memberRemove a member from an account
GETlist_account_rolesList all available roles for an account
GETget_account_roleGet role details and permissions
GETverify_tokenVerify the API token used for this request: returns its id and status (active/expired/disabled) plus validity window. Confirms auth works; does NOT list the token's own permissions (use GET /user/tokens/{id} for that).
GETlist_token_permission_groupsList the catalog of grantable API token permission groups (id, name, scopes). Use to find the exact group ID to attach when creating a token via the API -- e.g. filter name=Registrar to locate the registrar read vs write groups. Returns the global catalog, NOT the current token's permissions. Needs the token permission User > API Tokens (Read); without it Cloudflare answers HTTP 403 code 9109.
GETlist_zonesList, search, sort, and filter zones. Returns zone_id needed for all zone-scoped endpoints.
GETget_zoneGet zone details
POSTcreate_zoneCreate a new zone (add a domain to Cloudflare)
PATCHupdate_zoneEdit zone properties (paused, type, vanity nameservers)
DELETEdelete_zoneDelete a zone and all associated settings. Irreversible.
PUTcheck_zone_activationTrigger activation check for a PENDING zone. Rate limited (5min paygo/enterprise, 1hr free).
GETlist_zone_settingsGet all zone settings
GETget_zone_settingGet a single zone setting by ID
PATCHupdate_zone_settingUpdate a single zone setting
GETget_zone_holdGet zone hold status and metadata
POSTcreate_zone_holdEnforce a zone hold (block zone creation with this hostname)
DELETEdelete_zone_holdRemove zone hold (permanently or temporarily)
GETlist_zone_plansList available plans the zone can subscribe to
GETget_zone_subscriptionGet zone subscription details
POSTcreate_zone_subscriptionCreate zone subscription (plan/add-on)
GETlist_registrar_domainsList all domains managed by Cloudflare Registrar in this account. Returns name, status, expiry, current registrar, and lock/auto-renew/privacy flags. Does not include zones that are merely using Cloudflare DNS.
GETget_registrar_domainGet details for a single Cloudflare Registrar domain (status, expiry, contacts, nameservers, lock/auto-renew/privacy). Response is trimmed to key fields; pass a jq filter to override if you need the raw WHOIS object.
PUTupdate_registrar_domainUpdate an existing Cloudflare Registrar domain. Only auto_renew, privacy (WHOIS redaction), and locked (registrar transfer lock) are editable here; nameservers are managed on the zone. To register a NEW domain use register_registrar_domain instead.
GETsearch_registrar_domainsSearch for registrable domain suggestions by keyword/phrase (Registrar API beta). Returns candidate domains across TLDs WITH availability and pricing (registration_cost/renewal_cost), same per-domain shape as check_registrar_domains.
POSTcheck_registrar_domainsCheck availability AND pricing for up to 20 domains at once (Registrar API beta). For each domain returns registrable, tier, reason (when not registrable), and pricing (currency, registration_cost, renewal_cost) at Cloudflare's at-cost wholesale rate.
POSTregister_registrar_domainRegister a NEW domain via Cloudflare Registrar (Registrar API beta). PLACES A PAID ORDER charged to the account billing profile, using the account's default registrant contact. Run check_registrar_domains first to confirm availability and price. Irreversible billing action.
GETlist_dns_recordsList, search, sort, and filter DNS records for a zone
GETget_dns_recordGet a single DNS record
POSTcreate_dns_recordCreate a new DNS record
PATCHupdate_dns_recordUpdate (partial) a DNS record
PUToverwrite_dns_recordOverwrite (full replace) a DNS record
DELETEdelete_dns_recordDelete a DNS record
POSTbatch_dns_recordsBatch create/update/delete DNS records atomically in one transaction
POSTimport_dns_recordsImport DNS records from a BIND config file
GETexport_dns_recordsExport DNS records as BIND zone file
POSTscan_dns_recordsScan for common DNS records and auto-add them
GETget_dnssecGet DNSSEC status and configuration
PATCHupdate_dnssecEnable or disable DNSSEC
DELETEdelete_dnssecDelete DNSSEC records
GETget_zone_dns_settingsGet DNS settings for a zone
PATCHupdate_zone_dns_settingsUpdate DNS settings for a zone
GETget_account_dns_settingsGet DNS settings for an account
PATCHupdate_account_dns_settingsUpdate DNS settings for an account
GETget_dns_analyticsGet summarized aggregate DNS metrics over a time period
GETget_dns_analytics_by_timeGet aggregate DNS metrics grouped by time interval
GETget_secondary_dns_incomingGet the incoming (secondary) zone transfer configuration. Cloudflare pulls this zone from your external primary.
POSTcreate_secondary_dns_incomingCreate the incoming (secondary) zone transfer config so Cloudflare pulls the zone from your primary. peers references account-scoped peer tags.
PUTupdate_secondary_dns_incomingUpdate the incoming (secondary) zone transfer configuration
DELETEdelete_secondary_dns_incomingDelete the incoming (secondary) zone transfer configuration
POSTforce_axfr_secondary_dnsForce an immediate AXFR (full zone transfer) from the primary for a secondary zone
GETget_secondary_dns_outgoingGet the outgoing (primary) zone transfer configuration. Cloudflare serves this zone as primary and notifies external secondaries.
POSTcreate_secondary_dns_outgoingCreate the outgoing (primary) zone transfer config so external secondaries can pull this zone from Cloudflare. peers references account-scoped peer tags.
PUTupdate_secondary_dns_outgoingUpdate the outgoing (primary) zone transfer configuration
DELETEdelete_secondary_dns_outgoingDelete the outgoing (primary) zone transfer configuration
POSTenable_secondary_dns_outgoingEnable outgoing zone transfers (resume notifying external secondaries)
POSTdisable_secondary_dns_outgoingDisable outgoing zone transfers (stop notifying external secondaries)
POSTforce_notify_secondary_dns_outgoingSend a DNS NOTIFY to all external secondaries to prompt an immediate pull
GETget_secondary_dns_outgoing_statusGet the enabled/disabled status of outgoing zone transfers
GETlist_dns_peersList all secondary DNS peers (nameservers) for an account. Peer tags are referenced from zone incoming/outgoing configs.
GETget_dns_peerGet a single secondary DNS peer
POSTcreate_dns_peerCreate a secondary DNS peer (a primary/secondary nameserver Cloudflare transfers with)
PUTupdate_dns_peerUpdate a secondary DNS peer
DELETEdelete_dns_peerDelete a secondary DNS peer
GETlist_dns_tsigsList all secondary DNS TSIG keys for an account
GETget_dns_tsigGet a single secondary DNS TSIG key
POSTcreate_dns_tsigCreate a TSIG key for authenticated zone transfers
PUTupdate_dns_tsigUpdate a secondary DNS TSIG key
DELETEdelete_dns_tsigDelete a secondary DNS TSIG key
GETlist_dns_aclsList all secondary DNS ACLs (IP-range allowlists) for an account
GETget_dns_aclGet a single secondary DNS ACL
POSTcreate_dns_aclCreate a secondary DNS ACL restricting which peer IP ranges may transfer
PUTupdate_dns_aclUpdate a secondary DNS ACL
DELETEdelete_dns_aclDelete a secondary DNS ACL
GETlist_dns_firewall_clustersList all DNS Firewall clusters (account-scoped recursive resolvers). Distinct from authoritative zone DNS and from zone firewall rules.
GETget_dns_firewall_clusterGet a DNS Firewall cluster's configuration, including the anycast dns_firewall_ips to point clients at
POSTcreate_dns_firewall_clusterCreate a DNS Firewall cluster. upstream_ips are your origin resolvers; the response returns anycast IPs to use as your nameservers.
PATCHupdate_dns_firewall_clusterUpdate a DNS Firewall cluster's configuration (rate limits, cache TTLs, upstreams, mitigation)
DELETEdelete_dns_firewall_clusterDelete a DNS Firewall cluster
GETlist_pages_projectsList all Cloudflare Pages projects. Requires account_id -- the Cloudflare account ID from list_accounts (field id), not a zone_id.
GETget_pages_projectGet a Pages project by name. Requires account_id -- the Cloudflare account ID from list_accounts (field id), not a zone_id.
POSTcreate_pages_projectCreate a new Pages project. Requires account_id -- the Cloudflare account ID from list_accounts (field id), not a zone_id.
PATCHupdate_pages_projectUpdate Pages project attributes. Requires account_id -- the Cloudflare account ID from list_accounts (field id), not a zone_id.
DELETEdelete_pages_projectDelete a Pages project and all deployments. Irreversible. Requires account_id -- the Cloudflare account ID from list_accounts (field id), not a zone_id.
POSTpurge_pages_build_cachePurge all cached build artifacts for a Pages project. Requires account_id -- the Cloudflare account ID from list_accounts (field id), not a zone_id.
GETlist_pages_deploymentsList all deployments for a Pages project. Requires account_id -- the Cloudflare account ID from list_accounts (field id), not a zone_id.
GETget_pages_deploymentGet a specific deployment. Requires account_id -- the Cloudflare account ID from list_accounts (field id), not a zone_id.
POSTcreate_pages_deploymentCreate a new deployment (direct upload via multipart or trigger Git build). Requires account_id -- the Cloudflare account ID from list_accounts (field id), not a zone_id.
DELETEdelete_pages_deploymentDelete a deployment. Requires account_id -- the Cloudflare account ID from list_accounts (field id), not a zone_id.
POSTretry_pages_deploymentRetry a failed deployment. Requires account_id -- the Cloudflare account ID from list_accounts (field id), not a zone_id.
POSTrollback_pages_deploymentRollback production to a previous deployment. Requires account_id -- the Cloudflare account ID from list_accounts (field id), not a zone_id.
GETget_pages_deployment_logsGet build/deployment logs for a specific deployment. Requires account_id -- the Cloudflare account ID from list_accounts (field id), not a zone_id.
GETlist_pages_domainsList all custom domains for a Pages project. Requires account_id -- the Cloudflare account ID from list_accounts (field id), not a zone_id.
GETget_pages_domainGet a specific Pages domain. Requires account_id -- the Cloudflare account ID from list_accounts (field id), not a zone_id.
POSTadd_pages_domainAdd a custom domain to a Pages project. Requires account_id -- the Cloudflare account ID from list_accounts (field id), not a zone_id.
PATCHretry_pages_domain_validationRetry domain validation for a Pages custom domain. Requires account_id -- the Cloudflare account ID from list_accounts (field id), not a zone_id.
DELETEdelete_pages_domainRemove a custom domain from a Pages project. Requires account_id -- the Cloudflare account ID from list_accounts (field id), not a zone_id.
GETlist_worker_scriptsList all uploaded Worker scripts
GETget_worker_scriptFetch raw Worker script content
PUTupload_worker_scriptUpload or update a Worker script (multipart: module content + metadata with bindings)
DELETEdelete_worker_scriptDelete a Worker script
GETget_worker_script_contentFetch Worker script content only (without metadata)
PUTupdate_worker_script_contentUpdate Worker script content without changing settings/bindings
GETlist_worker_routesList all Worker routes for a zone
GETget_worker_routeGet a specific Worker route
POSTcreate_worker_routeCreate a Worker route (map URL pattern to a Worker script)
PUTupdate_worker_routeUpdate a Worker route
DELETEdelete_worker_routeDelete a Worker route
GETlist_worker_cron_triggersList cron triggers for a Worker
PUTupdate_worker_cron_triggersSet cron triggers for a Worker (replaces all existing triggers)
GETlist_worker_secretsList secrets bound to a Worker (names only, values not returned)
PUTput_worker_secretAdd or update a secret binding for a Worker
DELETEdelete_worker_secretRemove a secret binding from a Worker
GETlist_worker_deploymentsList deployments for a Worker (latest first)
POSTcreate_worker_deploymentCreate a Worker deployment (percentage-based rollout)
GETlist_worker_tailsList active tails (live log streams) for a Worker
POSTcreate_worker_tailStart a tail to receive live logs and exceptions from a Worker
DELETEdelete_worker_tailDelete a Worker tail
GETget_worker_subdomainCheck workers.dev subdomain status for a Worker
POSTset_worker_subdomainEnable or disable workers.dev subdomain for a Worker
GETlist_kv_namespacesList all Workers KV namespaces
GETget_kv_namespaceGet a KV namespace
POSTcreate_kv_namespaceCreate a KV namespace
PUTrename_kv_namespaceRename a KV namespace
DELETEdelete_kv_namespaceDelete a KV namespace and all its keys
GETlist_kv_keysList keys in a KV namespace
GETkv_read_valueRead a value from KV by key name
PUTkv_write_valueWrite a key-value pair to KV. Eventually consistent (up to 60s propagation).
DELETEkv_delete_valueDelete a key from KV
GETkv_get_metadataGet metadata for a KV key
PUTkv_bulk_writeWrite multiple key-value pairs to KV in one request
POSTkv_bulk_deleteDelete multiple keys from KV in one request
POSTkv_bulk_readRead multiple keys from KV in one request (up to 100)
GETlist_r2_bucketsList all R2 buckets
GETget_r2_bucketGet R2 bucket properties
POSTcreate_r2_bucketCreate an R2 bucket
DELETEdelete_r2_bucketDelete an R2 bucket (must be empty)
GETget_r2_lifecycleGet R2 bucket lifecycle rules
PUTset_r2_lifecycleSet R2 bucket lifecycle rules
GETget_r2_corsGet R2 bucket CORS policy
PUTset_r2_corsSet R2 bucket CORS policy
DELETEdelete_r2_corsDelete R2 bucket CORS policy
GETlist_r2_custom_domainsList custom domains for an R2 bucket
POSTadd_r2_custom_domainAdd a custom domain to an R2 bucket
DELETEdelete_r2_custom_domainRemove a custom domain from an R2 bucket
GETget_r2_managed_domainGet r2.dev public domain status
PUTset_r2_managed_domainEnable or disable r2.dev public access
GETlist_d1_databasesList all D1 databases
GETget_d1_databaseGet D1 database details
POSTcreate_d1_databaseCreate a D1 database
DELETEdelete_d1_databaseDelete a D1 database
POSTd1_queryExecute SQL query on D1 (results as objects)
POSTd1_raw_queryExecute SQL query on D1 (results as arrays, more compact)
POSTd1_exportExport D1 database as SQL dump
POSTd1_importImport SQL into a D1 database
GETd1_time_travel_bookmarkGet current or historical D1 database bookmark (point-in-time)
POSTd1_time_travel_restoreRestore D1 database to a point in time. Overwrites current state.
GETlist_custom_certificatesList all custom SSL certificates for a zone
GETget_custom_certificateGet custom certificate details
POSTupload_custom_certificateUpload a new custom SSL certificate
PATCHupdate_custom_certificateUpdate a custom SSL certificate or private key
DELETEdelete_custom_certificateRemove a custom SSL certificate
PUTprioritize_certificatesSet priority order for custom certificates
GETlist_certificate_packsList all certificate packs for a zone
GETget_certificate_packGet a specific certificate pack
POSTorder_certificate_packOrder an advanced certificate pack
DELETEdelete_certificate_packDelete a certificate pack
GETlist_custom_hostnamesList all custom hostnames for a zone
GETget_custom_hostnameGet custom hostname details including SSL status and verification
POSTcreate_custom_hostnameCreate a custom hostname and request SSL certificate
PATCHupdate_custom_hostnameUpdate custom hostname SSL config or trigger DCV
DELETEdelete_custom_hostnameDelete a custom hostname and revoke its SSL certificates
GETget_ssl_recommendationGet SSL/TLS mode recommendation for a zone
GETget_ssl_verificationGet SSL verification info and DCV status
GETget_universal_ssl_settingsGet Universal SSL settings for a zone
PATCHupdate_universal_ssl_settingsUpdate Universal SSL settings (enable/disable)
POSTpurge_cachePurge cached content. Use purge_everything for full purge, or files/tags/hosts/prefixes for selective.
GETget_cache_reserveGet Cache Reserve status
PATCHupdate_cache_reserveEnable or disable Cache Reserve
GETget_tiered_cacheGet Smart Tiered Cache setting
PATCHupdate_tiered_cacheEnable or disable Smart Tiered Cache
GETlist_load_balancersList all load balancers for a zone
GETget_load_balancerGet load balancer details
POSTcreate_load_balancerCreate a load balancer
PUTupdate_load_balancerUpdate a load balancer
DELETEdelete_load_balancerDelete a load balancer
GETlist_lb_poolsList all load balancer pools
GETget_lb_poolGet load balancer pool details
POSTcreate_lb_poolCreate a load balancer pool
PUTupdate_lb_poolUpdate a load balancer pool
DELETEdelete_lb_poolDelete a load balancer pool
GETget_lb_pool_healthGet pool health status
GETlist_lb_monitorsList all load balancer monitors
GETget_lb_monitorGet load balancer monitor details
POSTcreate_lb_monitorCreate a load balancer health monitor
PUTupdate_lb_monitorUpdate a load balancer monitor
DELETEdelete_lb_monitorDelete a load balancer monitor
GETlist_firewall_rulesList firewall rules for a zone
GETget_firewall_ruleGet a specific firewall rule
POSTcreate_firewall_rulesCreate one or more firewall rules
PUTupdate_firewall_ruleUpdate a firewall rule
DELETEdelete_firewall_ruleDelete a firewall rule
GETlist_account_rulesetsList all account-level rulesets
GETlist_zone_rulesetsList all zone-level rulesets
GETget_zone_rulesetGet a specific zone ruleset
POSTcreate_zone_rulesetCreate a zone ruleset
PUTupdate_zone_rulesetUpdate/deploy a zone ruleset (replaces all rules)
DELETEdelete_zone_rulesetDelete a zone ruleset
GETget_zone_ruleset_phaseGet the entry point ruleset for a phase (e.g. http_ratelimit, http_request_firewall_custom)
PUTupdate_zone_ruleset_phaseUpdate the entry point ruleset for a phase
GETlist_page_rulesList all page rules for a zone
GETget_page_ruleGet a specific page rule
POSTcreate_page_ruleCreate a page rule
PUTupdate_page_ruleReplace a page rule entirely
DELETEdelete_page_ruleDelete a page rule
GETlist_access_appsList all Cloudflare Access applications
GETget_access_appGet Access application details
POSTcreate_access_appCreate an Access application
PUTupdate_access_appUpdate an Access application
DELETEdelete_access_appDelete an Access application
GETlist_access_policiesList all reusable Access policies
GETget_access_policyGet a reusable Access policy
POSTcreate_access_policyCreate a reusable Access policy
PUTupdate_access_policyUpdate a reusable Access policy
DELETEdelete_access_policyDelete a reusable Access policy
GETlist_access_app_policiesList policies for a specific Access application
GETget_access_app_policyGet a specific policy for an Access application
POSTcreate_access_app_policyCreate a policy for a specific Access application
PUTupdate_access_app_policyUpdate a policy for an Access application
DELETEdelete_access_app_policyDelete a policy for an Access application
GETlist_access_groupsList all Access groups
GETget_access_groupGet Access group details
POSTcreate_access_groupCreate an Access group
PUTupdate_access_groupUpdate an Access group
DELETEdelete_access_groupDelete an Access group
GETget_email_routing_settingsGet the Email Routing state of a zone: enabled, status (ready | unconfigured | misconfigured | misconfigured/locked | unlocked), support_subaddress (plus-addressing), skip_wizard, created/modified. Call this first -- routing rules only take effect while status is 'ready'.
PATCHupdate_email_routing_settingsUpdate Email Routing zone settings: support_subaddress (honor plus-addressing like user+tag@zone when matching rules) and skip_wizard. Omitted fields keep their value. Cannot switch routing on or off -- use enable_email_routing / disable_email_routing for that.
GETget_email_routing_dns_recordsShow the DNS records Email Routing needs on this zone -- MX route1/2/3.mx.cloudflare.net, an SPF TXT record at the apex and the DKIM TXT record cf2024-1._domainkey -- each as {type, name, content, priority, ttl}. Works for zones where routing is not enabled yet (shows what enable_email_routing would create and lock).
POSTenable_email_routingEnable Email Routing on a zone: Cloudflare adds AND LOCKS the required MX records and the SPF TXT record at the zone apex. Existing foreign MX records must be removed first, otherwise the zone ends up with status 'misconfigured'. Returns the settings object -- check that status == 'ready'.
DELETEdisable_email_routingDisable Email Routing on a zone and REMOVE the MX/SPF records it added. Incoming mail to the zone stops being routed immediately; routing rules and destination addresses are kept but become inactive.
PATCHunlock_email_routing_dnsUnlock the MX records that Email Routing locked so they can be edited with the DNS tools (status becomes 'unlocked'). Editing them can break routing; run enable_email_routing again to restore and re-lock the records.
GETlist_email_routing_rulesList the custom-address routing rules of a zone: id, name, enabled, priority, matchers [{type: literal | all, field: to, value}], actions [{type: forward | drop | worker, value: [target]}], source (api | wrangler). The catch-all rule is included as well (matchers [{type: all}], priority 2147483647) -- manage it via get/update_email_routing_catch_all, not via update_email_routing_rule.
GETget_email_routing_ruleGet one routing rule by id (matchers, actions, enabled, priority, source).
POSTcreate_email_routing_ruleCreate a routing rule for a custom address of the zone. matchers: [{type: 'literal', field: 'to', value: 'alias@yourzone.tld'}]. actions: [{type: 'forward', value: ['dest@example.net']}] forwards to exactly ONE destination address that is already VERIFIED in the account (create_email_destination_address + link click), [{type: 'drop'}] discards the mail, [{type: 'worker', value: ['script-name']}] hands it to an Email Worker. Lower priority number wins when several rules match. Requires Email Routing to be enabled on the zone.
PUTupdate_email_routing_ruleReplace a routing rule (PUT = full replace: matchers AND actions are required again, omitted name/enabled/priority fall back to their defaults). Use it to change the forward target, disable a rule, or re-prioritize. Forward actions need exactly one verified destination address.
DELETEdelete_email_routing_ruleDelete a routing rule. Mail to that custom address is no longer matched and falls through to the catch-all rule (which drops by default).
GETget_email_routing_catch_allGet the zone's catch-all rule -- what happens to mail for addresses no custom rule matches: enabled, actions [{type: forward | drop | worker, value}], matchers [{type: all}].
PUTupdate_email_routing_catch_allSet the zone's catch-all rule: enable or disable it and choose the action -- forward all unmatched mail to one verified destination address ([{type: 'forward', value: ['dest@example.net']}]), drop it ([{type: 'drop'}]), or route it to an Email Worker ([{type: 'worker', value: ['script-name']}]). matchers must be [{type: 'all'}]. PUT = full replace.
GETlist_email_destination_addressesList the Email Routing destination addresses of the account (the mailboxes forward rules may deliver to): id, email, verified (timestamp, or null while the recipient has not clicked the verification link), created, modified. Without the verified filter ALL addresses are returned (verified and pending); verified=true or verified=false narrows the list. account_id is required; get it via list_accounts.
GETget_email_destination_addressGet one destination address by id, including its verified timestamp (null = not yet verified).
POSTcreate_email_destination_addressRegister a destination address for forwarding. Cloudflare immediately emails a verification link to that address; until the recipient clicks it, verified stays null and routing rules that forward to it are rejected. Returns the address object (id, email, verified: null).
PATCHupdate_email_destination_addressChange a destination address status. With a regular API token this can only reset a verified address to 'unverified' (forcing re-verification); setting 'verified' requires Cloudflare admin privileges and is rejected otherwise.
DELETEdelete_email_destination_addressDelete a destination address. Routing rules that forward to it stop working -- update or delete those rules first. Cloudflare refuses to delete an address that was created only moments ago (HTTP 429 code 2032 'created too recently') -- wait a few minutes and retry.
GETlist_email_routing_rules_across_zonesList the routing rules of ALL zones in the account in one call; each rule carries zone {name, tag} in addition to id, name, enabled, priority, matchers, actions. Use it to audit which custom addresses forward where without iterating zones. Permission caveat: a token whose Email Routing Rules permission is granted per zone gets HTTP 403 (code 10000) here even though the per-zone list_email_routing_rules works -- fall back to iterating zones in that case.
POSTsend_emailSend an outbound email through Cloudflare Email Sending. from must be an address on an ENABLED sending subdomain of the account (create_email_sending_subdomain, DNS status 'ready'); recipients can be any external addresses. Every address value is either a plain string 'user@example.com' or {address, name}; to/cc/bcc take arrays of those and at least one of the three is required. Provide subject and at least one of text/html. Returns {message_id, delivered[], queued[], permanent_bounces[], suppressed_recipients[]}. Each send counts against the daily quota (get_email_sending_limits).
POSTsend_email_rawSend a pre-built RFC 5322 MIME message (headers + body, optionally multipart) through Email Sending. from and recipients form the SMTP envelope and must be plain addresses; the message's From header must still use an enabled sending subdomain. Prefer send_email unless you need full control over the MIME structure. Returns {message_id, delivered[], queued[], permanent_bounces[], suppressed_recipients[]}.
GETget_email_sending_limitsGet the account's Email Sending quota and current usage: {quota: {value, unit: day | hour}, usage: {sent, over_quota, resets_at}}. quota and usage are null while no quota is resolved yet (Email Sending not activated). Check before bulk sends.
GETget_email_sending_reputationGet the account's Email Sending reputation: status (healthy | warning | at_risk | suspended), status_since, evaluated_at, grace_started_at, and the active_policy thresholds (complaint, customer_bounce and spam_rejection rates with warning_at/at_risk_at/minimum_denominator, suspension_after_hours). While suspended, sends are rejected. Accounts that have not activated Email Sending get HTTP 404 (code 10001 'Unable to authenticate request') from this endpoint even with the right permission -- check get_email_sending_limits (quota null) first.
GETget_email_sending_messageFetch the raw RFC 5322 MIME of a message sent via Email Sending, by the message_id returned from send_email / send_email_raw. The body is message/rfc822 (not JSON), so ToolMesh returns a file-broker download URL. Only available for subdomains with preview_enabled=true (activity-log preview).
GETlist_email_sending_suppressionsList active Email Sending suppressions (addresses that will NOT be delivered to): id, email, reason (manual | complaint | hard_bounce | soft_bounce | policy), scope ({type: 'account'} or {type: 'sending_domain', value}), expires_at (null = permanent), read_only, note. Sending-domain suppressions come first, then account-wide ones. CURSOR pagination unlike the rest of the API: the result is {suppressions: [...], next_cursor}; pass next_cursor as cursor to fetch the next page (page/per_page paging does not apply).
GETget_email_sending_suppressionGet one Email Sending suppression by id (email, reason, scope, expires_at, read_only, note).
POSTcreate_email_sending_suppressionSuppress an address so Email Sending never delivers to it -- for every sending domain of the account by default, or for one sending domain via scope {type: 'sending_domain', value: 'mail.example.com'}. Creating an already active suppression returns its existing id. Scope is immutable afterwards (delete and recreate to change it). Returns {id, scope}.
POSTbulk_create_email_sending_suppressionsImport up to 1,000 Email Sending suppressions in one request. items: [{email, expires_at?, note?, scope?}] with the same semantics as create_email_sending_suppression; duplicates (same email + scope) are deduplicated. Returns counts (total, processed, deduplicated, invalid, skipped, errors) and per-item results {index, email, status: processed | invalid | error | skipped, id?, error?} in request order.
PATCHupdate_email_sending_suppressionUpdate the expiry or note of a suppression. Send expires_at as null to make it permanent, note as '' to clear it; omitted fields stay unchanged. Scope cannot be changed (400 scope_immutable) and read_only suppressions (reason policy) cannot be edited.
DELETEdelete_email_sending_suppressionDelete a suppression so the address can receive Email Sending mail again.
GETlist_email_sending_subdomainsList the sending-enabled (sub)domains of a zone: tag (this is the subdomain_id for the other subdomain tools), name, enabled, dkim_selector, return_path_domain, preview_enabled, drop_suppressed_recipients. A zone has none until create_email_sending_subdomain is called.
GETget_email_sending_subdomainGet one sending subdomain by id (the tag field of list_email_sending_subdomains).
POSTcreate_email_sending_subdomainEnable Email Sending on a domain of the zone, e.g. 'mail.example.com' or the apex 'example.com' ('*.example.com' wildcards need the wildcard entitlement). Cloudflare creates and locks the DKIM, SPF, DMARC and return-path DNS records and returns the subdomain (tag = subdomain_id). Run preview_email_sending_subdomain first to detect conflicts with existing MX/SPF/DMARC records, then confirm readiness with get_email_sending_subdomain_dns_status. Also re-enables a previously deleted subdomain.
POSTpreview_email_sending_subdomainDry run for create_email_sending_subdomain: returns the DNS records Cloudflare would create for the name plus errors[] with codes such as mx.missing, mx.foreign, spf.multiple, dkim.conflict, dmarc.incompatible, sending_subdomain.conflict (each with the existing/missing/multiple records involved). Nothing is created or modified.
PATCHupdate_email_sending_subdomainUpdate a sending subdomain (at least one field required): preview_enabled lets sent messages be previewed in the activity log (needed for get_email_sending_message); drop_suppressed_recipients=true makes send_email drop suppressed recipients and deliver to the rest instead of failing the whole request.
DELETEdelete_email_sending_subdomainDisable sending on the subdomain and remove its sending DNS records (DKIM/SPF/DMARC/return-path). Email Routing on the same name is unaffected. Sends with a from address on this subdomain fail afterwards.
GETget_email_sending_subdomain_dnsReturn the DNS records a sending subdomain is expected to have (desired state as {type, name, content, priority, ttl}) -- no live comparison; use get_email_sending_subdomain_dns_status for that.
GETget_email_sending_subdomain_dns_statusLive DNS health of a sending subdomain: status (ready | unconfigured | unlocked | misconfigured), the desired records, and errors[] (mx.missing, mx.foreign, spf.missing, spf.foreign, spf.multiple, dkim.missing, dkim.conflict, dmarc.missing, dmarc.multiple, dmarc.incompatible, domainkey.delegated, sending_subdomain.conflict). Call this before fix_email_sending_subdomain_dns.
POSTfix_email_sending_subdomain_dnsIdempotently repair a sending subdomain's DNS: re-creates missing sending records and re-applies the lock on unlocked ones. Refuses with HTTP 409 while foreign MX, multiple SPF, multiple DMARC or multiple DKIM records exist at the relevant names -- clean those up with the DNS tools first. Returns the same shape as get_email_sending_subdomain_dns_status.
GETget_email_sending_subdomain_complaintsNumber of spam complaints matched to a sending subdomain in the half-open window [start_at, end_at), at most seven days long. Returns {complaints}.
GETget_dmarc_reports_statusGet the zone's DMARC Management state: enabled (Cloudflare collects DMARC aggregate reports through its RUA address), rua_prefix, status (missing-dmarc-report | multiple-dmarc-reports | missing-dmarc-rua | cname-on-dmarc-record | unauthorized-reporting-domain; the field is absent when DMARC is configured correctly), approved_sources (sending sources seen in reports, with resolved IPs) and records -- the zone's live SPF, DKIM, DMARC and BIMI TXT/CNAME records grouped by type. A good first call for any email-deliverability audit of a zone.
PATCHconfigure_dmarc_reportsEnable or disable Cloudflare DMARC report collection for the zone (at least one of enabled/skip_wizard required). enabled=true ensures the zone's DMARC TXT record carries Cloudflare's rua= reporting address (creating it if needed) so aggregate reports flow into DMARC Management. Returns the same shape as get_dmarc_reports_status.
GETinspect_spf_recordParse one SPF TXT record of the zone into a component tree: every mechanism (A, MX, IP4, IP6, INCLUDE, REDIRECT, EXISTS, PTR, ALL) with its qualifier result, nested includes resolved recursively, lookup_count per component and total_lookups (RFC 7208 allows 10), plus errors[] (lookup_failed, spf_not_found, invalid_spf, invalid_domain, loop_detected, invalid_mechanism, ...). id is the DNS record id of the SPF TXT record -- find it with list_dns_records(type='TXT').