Email Routing

email_routing

Methods

Disable Email Routing -> Envelope<>
post/zones/{zone_id}/email/routing/disable

Disable your Email Routing zone. Also removes additional MX records previously required for Email Routing to work.

Enable Email Routing -> Envelope<>
post/zones/{zone_id}/email/routing/enable

Enable you Email Routing zone. Add and lock the necessary MX and SPF records.

Get Email Routing Settings -> Envelope<>
get/zones/{zone_id}/email/routing

Get information about the settings for your Email Routing zone.

Domain types

Settings = { id, enabled, name, 5 more... }
Email Routing

Addresses

email_routing.addresses

Methods

Create A Destination Address -> Envelope<>
post/accounts/{account_id}/email/routing/addresses

Create a destination address to forward your emails to. Destination addresses need to be verified before they can be used.

Delete Destination Address -> Envelope<>
delete/accounts/{account_id}/email/routing/addresses/{destination_address_identifier}

Deletes a specific destination address.

Get A Destination Address -> Envelope<>
get/accounts/{account_id}/email/routing/addresses/{destination_address_identifier}

Gets information for a specific destination email already created.

List Destination Addresses -> V4PagePaginationArray<>
get/accounts/{account_id}/email/routing/addresses

Lists existing destination addresses.

Domain types

Address = { id, created, email, 3 more... }

email_routing.dns

Methods

Enable Email Routing -> Envelope<>
post/zones/{zone_id}/email/routing/dns

Enable you Email Routing zone. Add and lock the necessary MX and SPF records.

Disable Email Routing -> { errors, messages, success } | { errors, messages, success, 2 more... }
delete/zones/{zone_id}/email/routing/dns

Disable your Email Routing zone. Also removes additional MX records previously required for Email Routing to work.

Unlock Email Routing -> Envelope<>
patch/zones/{zone_id}/email/routing/dns

Unlock MX Records previously locked by Email Routing.

Email Routing DNS Settings -> { errors, messages, success, 2 more... } | { errors, messages, success, 2 more... }
get/zones/{zone_id}/email/routing/dns

Show the DNS records needed to configure your Email Routing zone.

Domain types

DNSRecord = { content, name, priority, 2 more... }

email_routing.rules

Methods

Create Routing Rule -> Envelope<>
post/zones/{zone_id}/email/routing/rules

Rules consist of a set of criteria for matching emails (such as an email being sent to a specific custom email address) plus a set of actions to take on the email (like forwarding it to a specific destination address).

Security
API Email + API Key

The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.

Example: X-Auth-Email: user@example.com

The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.

Example: X-Auth-Key: 144c9defac04969c7bfad8efaa8ea194

Parameters
zone_id: string

Identifier

Response fields
errors: Array<>
messages: Array<>
success: true

Whether the API call was successful

result:
Optional
Request example
200Example
Delete Routing Rule -> Envelope<>
delete/zones/{zone_id}/email/routing/rules/{rule_identifier}

Delete a specific routing rule.

Get Routing Rule -> Envelope<>
get/zones/{zone_id}/email/routing/rules/{rule_identifier}

Get information for a specific routing rule already created.

List Routing Rules -> V4PagePaginationArray<>
get/zones/{zone_id}/email/routing/rules

Lists existing routing rules.

Update Routing Rule -> Envelope<>
put/zones/{zone_id}/email/routing/rules/{rule_identifier}

Update actions and matches, or enable/disable specific routing rules.

Domain types

Action = { type, value }
EmailRoutingRule = { id, actions, enabled, 4 more... }
Matcher = { field, type, value }

email_routing.rules.catch_alls

Methods

Get Catch All Rule -> Envelope<{ id, actions, enabled, 3 more... }>
get/zones/{zone_id}/email/routing/rules/catch_all

Get information on the default catch-all routing rule.

Update Catch All Rule -> Envelope<{ id, actions, enabled, 3 more... }>
put/zones/{zone_id}/email/routing/rules/catch_all

Enable or disable catch-all routing rule, or change action to forward to specific destination address.

Domain types

CatchAllAction = { type, value }
CatchAllMatcher = { type }