---
title: Email Routing
---

[Skip to content](#_top)

[API Reference](https://developers.cloudflare.com/api/go)

Copy Markdown

Open in **Claude**Open in **ChatGPT**Open in **Cursor**

---

**Copy Markdown****View as Markdown**

# Email Routing

##### [Get Email Routing settings](https://developers.cloudflare.com/api/go/resources/email_routing/methods/get)

client.EmailRouting.Get(ctx, query) (\*[Settings](<https://developers.cloudflare.com/api/go/resources/email_routing#(resource)%20email_routing%20%3E%20(model)%20settings%20%3E%20(schema)>), error)

GET/zones/{zone\_id}/email/routing

##### [Update Email Routing settings](https://developers.cloudflare.com/api/go/resources/email_routing/methods/edit)

client.EmailRouting.Edit(ctx, params) (\*[Settings](<https://developers.cloudflare.com/api/go/resources/email_routing#(resource)%20email_routing%20%3E%20(model)%20settings%20%3E%20(schema)>), error)

PATCH/zones/{zone\_id}/email/routing

##### [Apply Email Routing settings](https://developers.cloudflare.com/api/go/resources/email_routing/methods/update)

client.EmailRouting.Update(ctx, params) (\*[Settings](<https://developers.cloudflare.com/api/go/resources/email_routing#(resource)%20email_routing%20%3E%20(model)%20settings%20%3E%20(schema)>), error)

PUT/zones/{zone\_id}/email/routing

##### [Disable Email Routing](https://developers.cloudflare.com/api/go/resources/email_routing/methods/disable)

Deprecated

client.EmailRouting.Disable(ctx, body) (\*[Settings](<https://developers.cloudflare.com/api/go/resources/email_routing#(resource)%20email_routing%20%3E%20(model)%20settings%20%3E%20(schema)>), error)

POST/zones/{zone\_id}/email/routing/disable

##### [Enable Email Routing](https://developers.cloudflare.com/api/go/resources/email_routing/methods/enable)

Deprecated

client.EmailRouting.Enable(ctx, body) (\*[Settings](<https://developers.cloudflare.com/api/go/resources/email_routing#(resource)%20email_routing%20%3E%20(model)%20settings%20%3E%20(schema)>), error)

POST/zones/{zone\_id}/email/routing/enable

##### [Unlock Email Routing](https://developers.cloudflare.com/api/go/resources/email_routing/methods/unlock)

Deprecated

client.EmailRouting.Unlock(ctx, params) (\*[Settings](<https://developers.cloudflare.com/api/go/resources/email_routing#(resource)%20email_routing%20%3E%20(model)%20settings%20%3E%20(schema)>), error)

POST/zones/{zone\_id}/email/routing/unlock

##### ModelsExpand Collapse

<details>

<summary>

type Settings struct{…}

</summary>

ID string

Email Routing settings identifier.

maxLength32

<a href="#(resource)%20email_routing%20%3E%20(model)%20settings%20%3E%20(schema)%20%3E%20(property)%20id">Link to this property</a>

<details>

<summary>

Enabled SettingsEnabled

State of the zone settings for Email Routing.

</summary>

One of the following:

const SettingsEnabledTrue SettingsEnabled = true

<a href="#(resource)%20email_routing%20%3E%20(model)%20settings%20%3E%20(schema)%20%3E%20(property)%20enabled%20%3E%20(member)%200">Link to this property</a>

const SettingsEnabledFalse SettingsEnabled = false

<a href="#(resource)%20email_routing%20%3E%20(model)%20settings%20%3E%20(schema)%20%3E%20(property)%20enabled%20%3E%20(member)%201">Link to this property</a>

</details>

<a href="#(resource)%20email_routing%20%3E%20(model)%20settings%20%3E%20(schema)%20%3E%20(property)%20enabled">Link to this property</a>

Name string

Domain of your zone.

<a href="#(resource)%20email_routing%20%3E%20(model)%20settings%20%3E%20(schema)%20%3E%20(property)%20name">Link to this property</a>

Created TimeOptional

The date and time the settings have been created.

formatdate-time

<a href="#(resource)%20email_routing%20%3E%20(model)%20settings%20%3E%20(schema)%20%3E%20(property)%20created">Link to this property</a>

Modified TimeOptional

The date and time the settings have been modified.

formatdate-time

<a href="#(resource)%20email_routing%20%3E%20(model)%20settings%20%3E%20(schema)%20%3E%20(property)%20modified">Link to this property</a>

<details>

<summary>

SkipWizard SettingsSkipWizardOptional

Flag to check if the user skipped the configuration wizard.

</summary>

One of the following:

const SettingsSkipWizardTrue SettingsSkipWizard = true

<a href="#(resource)%20email_routing%20%3E%20(model)%20settings%20%3E%20(schema)%20%3E%20(property)%20skip_wizard%20%3E%20(member)%200">Link to this property</a>

const SettingsSkipWizardFalse SettingsSkipWizard = false

<a href="#(resource)%20email_routing%20%3E%20(model)%20settings%20%3E%20(schema)%20%3E%20(property)%20skip_wizard%20%3E%20(member)%201">Link to this property</a>

</details>

<a href="#(resource)%20email_routing%20%3E%20(model)%20settings%20%3E%20(schema)%20%3E%20(property)%20skip_wizard">Link to this property</a>

<details>

<summary>

Status SettingsStatusOptional

Show the state of your account, and the type or configuration error.

</summary>

One of the following:

const SettingsStatusReady SettingsStatus = "ready"

<a href="#(resource)%20email_routing%20%3E%20(model)%20settings%20%3E%20(schema)%20%3E%20(property)%20status%20%3E%20(member)%200">Link to this property</a>

const SettingsStatusUnconfigured SettingsStatus = "unconfigured"

<a href="#(resource)%20email_routing%20%3E%20(model)%20settings%20%3E%20(schema)%20%3E%20(property)%20status%20%3E%20(member)%201">Link to this property</a>

const SettingsStatusMisconfigured SettingsStatus = "misconfigured"

<a href="#(resource)%20email_routing%20%3E%20(model)%20settings%20%3E%20(schema)%20%3E%20(property)%20status%20%3E%20(member)%202">Link to this property</a>

const SettingsStatusMisconfiguredLocked SettingsStatus = "misconfigured/locked"

<a href="#(resource)%20email_routing%20%3E%20(model)%20settings%20%3E%20(schema)%20%3E%20(property)%20status%20%3E%20(member)%203">Link to this property</a>

const SettingsStatusUnlocked SettingsStatus = "unlocked"

<a href="#(resource)%20email_routing%20%3E%20(model)%20settings%20%3E%20(schema)%20%3E%20(property)%20status%20%3E%20(member)%204">Link to this property</a>

</details>

<a href="#(resource)%20email_routing%20%3E%20(model)%20settings%20%3E%20(schema)%20%3E%20(property)%20status">Link to this property</a>

<details>

<summary>

SupportSubaddress SettingsSupportSubaddressOptional

Whether subaddressing (plus-addressing) is honored when matching incoming mail against routing rules.

</summary>

One of the following:

const SettingsSupportSubaddressTrue SettingsSupportSubaddress = true

<a href="#(resource)%20email_routing%20%3E%20(model)%20settings%20%3E%20(schema)%20%3E%20(property)%20support_subaddress%20%3E%20(member)%200">Link to this property</a>

const SettingsSupportSubaddressFalse SettingsSupportSubaddress = false

<a href="#(resource)%20email_routing%20%3E%20(model)%20settings%20%3E%20(schema)%20%3E%20(property)%20support_subaddress%20%3E%20(member)%201">Link to this property</a>

</details>

<a href="#(resource)%20email_routing%20%3E%20(model)%20settings%20%3E%20(schema)%20%3E%20(property)%20support_subaddress">Link to this property</a>

DeprecatedTag stringOptional

Email Routing settings tag. (Deprecated, replaced by Email Routing settings identifier)

maxLength32

<a href="#(resource)%20email_routing%20%3E%20(model)%20settings%20%3E%20(schema)%20%3E%20(property)%20tag">Link to this property</a>

</details>

[Link to this property](<#(resource)%20email_routing%20%3E%20(model)%20settings%20%3E%20(schema)>)

#### Email RoutingDNS

##### [Email Routing - DNS settings](https://developers.cloudflare.com/api/go/resources/email_routing/subresources/dns/methods/get)

client.EmailRouting.DNS.Get(ctx, params) (\*\[] [DNSRecord](<https://developers.cloudflare.com/api/go/resources/email_routing#(resource)%20email_routing.dns%20%3E%20(model)%20dns_record%20%3E%20(schema)>), error)

GET/zones/{zone\_id}/email/routing/dns

##### [Enable Email Routing](https://developers.cloudflare.com/api/go/resources/email_routing/subresources/dns/methods/create)

client.EmailRouting.DNS.New(ctx, params) (\*[Settings](<https://developers.cloudflare.com/api/go/resources/email_routing#(resource)%20email_routing%20%3E%20(model)%20settings%20%3E%20(schema)>), error)

POST/zones/{zone\_id}/email/routing/dns

##### [Unlock Email Routing DNS records](https://developers.cloudflare.com/api/go/resources/email_routing/subresources/dns/methods/edit)

client.EmailRouting.DNS.Edit(ctx, params) (\*[Settings](<https://developers.cloudflare.com/api/go/resources/email_routing#(resource)%20email_routing%20%3E%20(model)%20settings%20%3E%20(schema)>), error)

PATCH/zones/{zone\_id}/email/routing/dns

##### [Disable Email Routing](https://developers.cloudflare.com/api/go/resources/email_routing/subresources/dns/methods/delete)

client.EmailRouting.DNS.Delete(ctx, body) (\*[Settings](<https://developers.cloudflare.com/api/go/resources/email_routing#(resource)%20email_routing%20%3E%20(model)%20settings%20%3E%20(schema)>), error)

DELETE/zones/{zone\_id}/email/routing/dns

##### ModelsExpand Collapse

<details>

<summary>

type DNSRecord struct{…}

List of records needed to enable an Email Routing zone.

</summary>

Content stringOptional

DNS record content.

<a href="#(resource)%20email_routing.dns%20%3E%20(model)%20dns_record%20%3E%20(schema)%20%3E%20(property)%20content">Link to this property</a>

Name stringOptional

DNS record name (or @ for the zone apex).

maxLength255

<a href="#(resource)%20email_routing.dns%20%3E%20(model)%20dns_record%20%3E%20(schema)%20%3E%20(property)%20name">Link to this property</a>

Priority float64Optional

Required for MX, SRV and URI records. Unused by other record types. Records with lower priorities are preferred.

maximum65535

minimum0

<a href="#(resource)%20email_routing.dns%20%3E%20(model)%20dns_record%20%3E%20(schema)%20%3E%20(property)%20priority">Link to this property</a>

<details>

<summary>

TTL DNSRecordTTLOptional

Time to live, in seconds, of the DNS record. Must be between 60 and 86400, or 1 for ‘automatic’.

</summary>

One of the following:

float64

<a href="#(resource)%20email_routing.dns%20%3E%20(model)%20dns_record%20%3E%20(schema)%20%3E%20(property)%20ttl%20%3E%20(variant)%200">Link to this property</a>

type DNSRecordTTL float64

Time to live, in seconds, of the DNS record. Must be between 60 and 86400, or 1 for ‘automatic’.

<a href="#(resource)%20email_routing.dns%20%3E%20(model)%20dns_record%20%3E%20(schema)%20%3E%20(property)%20ttl%20%3E%20(variant)%201">Link to this property</a>

</details>

<a href="#(resource)%20email_routing.dns%20%3E%20(model)%20dns_record%20%3E%20(schema)%20%3E%20(property)%20ttl">Link to this property</a>

<details>

<summary>

Type DNSRecordTypeOptional

DNS record type.

</summary>

One of the following:

const DNSRecordTypeA DNSRecordType = "A"

<a href="#(resource)%20email_routing.dns%20%3E%20(model)%20dns_record%20%3E%20(schema)%20%3E%20(property)%20type%20%3E%20(member)%200">Link to this property</a>

const DNSRecordTypeAAAA DNSRecordType = "AAAA"

<a href="#(resource)%20email_routing.dns%20%3E%20(model)%20dns_record%20%3E%20(schema)%20%3E%20(property)%20type%20%3E%20(member)%201">Link to this property</a>

const DNSRecordTypeCNAME DNSRecordType = "CNAME"

<a href="#(resource)%20email_routing.dns%20%3E%20(model)%20dns_record%20%3E%20(schema)%20%3E%20(property)%20type%20%3E%20(member)%202">Link to this property</a>

const DNSRecordTypeHTTPS DNSRecordType = "HTTPS"

<a href="#(resource)%20email_routing.dns%20%3E%20(model)%20dns_record%20%3E%20(schema)%20%3E%20(property)%20type%20%3E%20(member)%203">Link to this property</a>

const DNSRecordTypeTXT DNSRecordType = "TXT"

<a href="#(resource)%20email_routing.dns%20%3E%20(model)%20dns_record%20%3E%20(schema)%20%3E%20(property)%20type%20%3E%20(member)%204">Link to this property</a>

const DNSRecordTypeSRV DNSRecordType = "SRV"

<a href="#(resource)%20email_routing.dns%20%3E%20(model)%20dns_record%20%3E%20(schema)%20%3E%20(property)%20type%20%3E%20(member)%205">Link to this property</a>

const DNSRecordTypeLOC DNSRecordType = "LOC"

<a href="#(resource)%20email_routing.dns%20%3E%20(model)%20dns_record%20%3E%20(schema)%20%3E%20(property)%20type%20%3E%20(member)%206">Link to this property</a>

const DNSRecordTypeMX DNSRecordType = "MX"

<a href="#(resource)%20email_routing.dns%20%3E%20(model)%20dns_record%20%3E%20(schema)%20%3E%20(property)%20type%20%3E%20(member)%207">Link to this property</a>

const DNSRecordTypeNS DNSRecordType = "NS"

<a href="#(resource)%20email_routing.dns%20%3E%20(model)%20dns_record%20%3E%20(schema)%20%3E%20(property)%20type%20%3E%20(member)%208">Link to this property</a>

const DNSRecordTypeCERT DNSRecordType = "CERT"

<a href="#(resource)%20email_routing.dns%20%3E%20(model)%20dns_record%20%3E%20(schema)%20%3E%20(property)%20type%20%3E%20(member)%209">Link to this property</a>

const DNSRecordTypeDNSKEY DNSRecordType = "DNSKEY"

<a href="#(resource)%20email_routing.dns%20%3E%20(model)%20dns_record%20%3E%20(schema)%20%3E%20(property)%20type%20%3E%20(member)%2010">Link to this property</a>

const DNSRecordTypeDS DNSRecordType = "DS"

<a href="#(resource)%20email_routing.dns%20%3E%20(model)%20dns_record%20%3E%20(schema)%20%3E%20(property)%20type%20%3E%20(member)%2011">Link to this property</a>

const DNSRecordTypeNAPTR DNSRecordType = "NAPTR"

<a href="#(resource)%20email_routing.dns%20%3E%20(model)%20dns_record%20%3E%20(schema)%20%3E%20(property)%20type%20%3E%20(member)%2012">Link to this property</a>

const DNSRecordTypeSMIMEA DNSRecordType = "SMIMEA"

<a href="#(resource)%20email_routing.dns%20%3E%20(model)%20dns_record%20%3E%20(schema)%20%3E%20(property)%20type%20%3E%20(member)%2013">Link to this property</a>

const DNSRecordTypeSSHFP DNSRecordType = "SSHFP"

<a href="#(resource)%20email_routing.dns%20%3E%20(model)%20dns_record%20%3E%20(schema)%20%3E%20(property)%20type%20%3E%20(member)%2014">Link to this property</a>

const DNSRecordTypeSVCB DNSRecordType = "SVCB"

<a href="#(resource)%20email_routing.dns%20%3E%20(model)%20dns_record%20%3E%20(schema)%20%3E%20(property)%20type%20%3E%20(member)%2015">Link to this property</a>

const DNSRecordTypeTLSA DNSRecordType = "TLSA"

<a href="#(resource)%20email_routing.dns%20%3E%20(model)%20dns_record%20%3E%20(schema)%20%3E%20(property)%20type%20%3E%20(member)%2016">Link to this property</a>

const DNSRecordTypeURI DNSRecordType = "URI"

<a href="#(resource)%20email_routing.dns%20%3E%20(model)%20dns_record%20%3E%20(schema)%20%3E%20(property)%20type%20%3E%20(member)%2017">Link to this property</a>

</details>

<a href="#(resource)%20email_routing.dns%20%3E%20(model)%20dns_record%20%3E%20(schema)%20%3E%20(property)%20type">Link to this property</a>

</details>

[Link to this property](<#(resource)%20email_routing.dns%20%3E%20(model)%20dns_record%20%3E%20(schema)>)

#### Email RoutingRules

##### [List account or zone routing rules](https://developers.cloudflare.com/api/go/resources/email_routing/subresources/rules/methods/list)

client.EmailRouting.Rules.List(ctx, params) (\*V4PagePaginationArray\[[AccountRule](<https://developers.cloudflare.com/api/go/resources/email_routing#(resource)%20email_routing.account_rules%20%3E%20(model)%20account_rule%20%3E%20(schema)>)], error)

GET/{accounts\_or\_zones}/{account\_or\_zone\_id}/email/routing/rules

##### [Get routing rule](https://developers.cloudflare.com/api/go/resources/email_routing/subresources/rules/methods/get)

client.EmailRouting.Rules.Get(ctx, ruleIdentifier, query) (\*[EmailRoutingRule](<https://developers.cloudflare.com/api/go/resources/email_routing#(resource)%20email_routing.rules%20%3E%20(model)%20email_routing_rule%20%3E%20(schema)>), error)

GET/zones/{zone\_id}/email/routing/rules/{rule\_identifier}

##### [Create routing rule](https://developers.cloudflare.com/api/go/resources/email_routing/subresources/rules/methods/create)

client.EmailRouting.Rules.New(ctx, params) (\*[EmailRoutingRule](<https://developers.cloudflare.com/api/go/resources/email_routing#(resource)%20email_routing.rules%20%3E%20(model)%20email_routing_rule%20%3E%20(schema)>), error)

POST/zones/{zone\_id}/email/routing/rules

##### [Update routing rule](https://developers.cloudflare.com/api/go/resources/email_routing/subresources/rules/methods/update)

client.EmailRouting.Rules.Update(ctx, ruleIdentifier, params) (\*[EmailRoutingRule](<https://developers.cloudflare.com/api/go/resources/email_routing#(resource)%20email_routing.rules%20%3E%20(model)%20email_routing_rule%20%3E%20(schema)>), error)

PUT/zones/{zone\_id}/email/routing/rules/{rule\_identifier}

##### [Delete routing rule](https://developers.cloudflare.com/api/go/resources/email_routing/subresources/rules/methods/delete)

client.EmailRouting.Rules.Delete(ctx, ruleIdentifier, body) (\*[EmailRoutingRule](<https://developers.cloudflare.com/api/go/resources/email_routing#(resource)%20email_routing.rules%20%3E%20(model)%20email_routing_rule%20%3E%20(schema)>), error)

DELETE/zones/{zone\_id}/email/routing/rules/{rule\_identifier}

##### ModelsExpand Collapse

<details>

<summary>

type Action struct{…}

Actions pattern.

</summary>

<details>

<summary>

Type ActionType

Type of supported action.

</summary>

One of the following:

const ActionTypeDrop ActionType = "drop"

<a href="#(resource)%20email_routing.rules%20%3E%20(model)%20action%20%3E%20(schema)%20%3E%20(property)%20type%20%3E%20(member)%200">Link to this property</a>

const ActionTypeForward ActionType = "forward"

<a href="#(resource)%20email_routing.rules%20%3E%20(model)%20action%20%3E%20(schema)%20%3E%20(property)%20type%20%3E%20(member)%201">Link to this property</a>

const ActionTypeWorker ActionType = "worker"

<a href="#(resource)%20email_routing.rules%20%3E%20(model)%20action%20%3E%20(schema)%20%3E%20(property)%20type%20%3E%20(member)%202">Link to this property</a>

</details>

<a href="#(resource)%20email_routing.rules%20%3E%20(model)%20action%20%3E%20(schema)%20%3E%20(property)%20type">Link to this property</a>

Value \[]stringOptional

List of values for the action. Currently limited to a single value.

<a href="#(resource)%20email_routing.rules%20%3E%20(model)%20action%20%3E%20(schema)%20%3E%20(property)%20value">Link to this property</a>

</details>

[Link to this property](<#(resource)%20email_routing.rules%20%3E%20(model)%20action%20%3E%20(schema)>)

<details>

<summary>

type EmailRoutingRule struct{…}

</summary>

ID stringOptional

Routing rule identifier.

maxLength32

<a href="#(resource)%20email_routing.rules%20%3E%20(model)%20email_routing_rule%20%3E%20(schema)%20%3E%20(property)%20id">Link to this property</a>

<details>

<summary>

Actions \[]<a href="https://developers.cloudflare.com/api/go/resources/email_routing#(resource)%20email_routing.rules%20%3E%20(model)%20action%20%3E%20(schema)">Action</a>Optional

List actions patterns.

</summary>

<details>

<summary>

Type ActionType

Type of supported action.

</summary>

One of the following:

const ActionTypeDrop ActionType = "drop"

<a href="#(resource)%20email_routing.rules%20%3E%20(model)%20action%20%3E%20(schema)%20%3E%20(property)%20type%20%3E%20(member)%200">Link to this property</a>

const ActionTypeForward ActionType = "forward"

<a href="#(resource)%20email_routing.rules%20%3E%20(model)%20action%20%3E%20(schema)%20%3E%20(property)%20type%20%3E%20(member)%201">Link to this property</a>

const ActionTypeWorker ActionType = "worker"

<a href="#(resource)%20email_routing.rules%20%3E%20(model)%20action%20%3E%20(schema)%20%3E%20(property)%20type%20%3E%20(member)%202">Link to this property</a>

</details>

<a href="#(resource)%20email_routing.rules%20%3E%20(model)%20action%20%3E%20(schema)%20%3E%20(property)%20type">Link to this property</a>

Value \[]stringOptional

List of values for the action. Currently limited to a single value.

<a href="#(resource)%20email_routing.rules%20%3E%20(model)%20action%20%3E%20(schema)%20%3E%20(property)%20value">Link to this property</a>

</details>

<a href="#(resource)%20email_routing.rules%20%3E%20(model)%20email_routing_rule%20%3E%20(schema)%20%3E%20(property)%20actions">Link to this property</a>

<details>

<summary>

Enabled EmailRoutingRuleEnabledOptional

Routing rule status.

</summary>

One of the following:

const EmailRoutingRuleEnabledTrue EmailRoutingRuleEnabled = true

<a href="#(resource)%20email_routing.rules%20%3E%20(model)%20email_routing_rule%20%3E%20(schema)%20%3E%20(property)%20enabled%20%3E%20(member)%200">Link to this property</a>

const EmailRoutingRuleEnabledFalse EmailRoutingRuleEnabled = false

<a href="#(resource)%20email_routing.rules%20%3E%20(model)%20email_routing_rule%20%3E%20(schema)%20%3E%20(property)%20enabled%20%3E%20(member)%201">Link to this property</a>

</details>

<a href="#(resource)%20email_routing.rules%20%3E%20(model)%20email_routing_rule%20%3E%20(schema)%20%3E%20(property)%20enabled">Link to this property</a>

<details>

<summary>

Matchers \[]<a href="https://developers.cloudflare.com/api/go/resources/email_routing#(resource)%20email_routing.rules%20%3E%20(model)%20matcher%20%3E%20(schema)">Matcher</a>Optional

Matching patterns to forward to your actions.

</summary>

<details>

<summary>

Type MatcherType

Type of matcher.

</summary>

One of the following:

const MatcherTypeAll MatcherType = "all"

<a href="#(resource)%20email_routing.rules%20%3E%20(model)%20matcher%20%3E%20(schema)%20%3E%20(property)%20type%20%3E%20(member)%200">Link to this property</a>

const MatcherTypeLiteral MatcherType = "literal"

<a href="#(resource)%20email_routing.rules%20%3E%20(model)%20matcher%20%3E%20(schema)%20%3E%20(property)%20type%20%3E%20(member)%201">Link to this property</a>

</details>

<a href="#(resource)%20email_routing.rules%20%3E%20(model)%20matcher%20%3E%20(schema)%20%3E%20(property)%20type">Link to this property</a>

Field MatcherFieldOptional

Field for type matcher.

<a href="#(resource)%20email_routing.rules%20%3E%20(model)%20matcher%20%3E%20(schema)%20%3E%20(property)%20field">Link to this property</a>

Value stringOptional

Value for matcher.

maxLength90

<a href="#(resource)%20email_routing.rules%20%3E%20(model)%20matcher%20%3E%20(schema)%20%3E%20(property)%20value">Link to this property</a>

</details>

<a href="#(resource)%20email_routing.rules%20%3E%20(model)%20email_routing_rule%20%3E%20(schema)%20%3E%20(property)%20matchers">Link to this property</a>

Name stringOptional

Routing rule name.

maxLength256

<a href="#(resource)%20email_routing.rules%20%3E%20(model)%20email_routing_rule%20%3E%20(schema)%20%3E%20(property)%20name">Link to this property</a>

Priority float64Optional

Priority of the routing rule.

minimum0

<a href="#(resource)%20email_routing.rules%20%3E%20(model)%20email_routing_rule%20%3E%20(schema)%20%3E%20(property)%20priority">Link to this property</a>

<details>

<summary>

Source EmailRoutingRuleSourceOptional

Who manages the rule. <code>api</code> covers dashboard, generic API, and Terraform; <code>wrangler</code> means the rule is managed by a Worker’s wrangler.jsonc. Defaults to <code>api</code> when omitted on write.

</summary>

One of the following:

const EmailRoutingRuleSourceAPI EmailRoutingRuleSource = "api"

<a href="#(resource)%20email_routing.rules%20%3E%20(model)%20email_routing_rule%20%3E%20(schema)%20%3E%20(property)%20source%20%3E%20(member)%200">Link to this property</a>

const EmailRoutingRuleSourceWrangler EmailRoutingRuleSource = "wrangler"

<a href="#(resource)%20email_routing.rules%20%3E%20(model)%20email_routing_rule%20%3E%20(schema)%20%3E%20(property)%20source%20%3E%20(member)%201">Link to this property</a>

</details>

<a href="#(resource)%20email_routing.rules%20%3E%20(model)%20email_routing_rule%20%3E%20(schema)%20%3E%20(property)%20source">Link to this property</a>

DeprecatedTag stringOptional

Routing rule tag. (Deprecated, replaced by routing rule identifier)

maxLength32

<a href="#(resource)%20email_routing.rules%20%3E%20(model)%20email_routing_rule%20%3E%20(schema)%20%3E%20(property)%20tag">Link to this property</a>

</details>

[Link to this property](<#(resource)%20email_routing.rules%20%3E%20(model)%20email_routing_rule%20%3E%20(schema)>)

<details>

<summary>

type Matcher struct{…}

Matching pattern to forward your actions.

</summary>

<details>

<summary>

Type MatcherType

Type of matcher.

</summary>

One of the following:

const MatcherTypeAll MatcherType = "all"

<a href="#(resource)%20email_routing.rules%20%3E%20(model)%20matcher%20%3E%20(schema)%20%3E%20(property)%20type%20%3E%20(member)%200">Link to this property</a>

const MatcherTypeLiteral MatcherType = "literal"

<a href="#(resource)%20email_routing.rules%20%3E%20(model)%20matcher%20%3E%20(schema)%20%3E%20(property)%20type%20%3E%20(member)%201">Link to this property</a>

</details>

<a href="#(resource)%20email_routing.rules%20%3E%20(model)%20matcher%20%3E%20(schema)%20%3E%20(property)%20type">Link to this property</a>

Field MatcherFieldOptional

Field for type matcher.

<a href="#(resource)%20email_routing.rules%20%3E%20(model)%20matcher%20%3E%20(schema)%20%3E%20(property)%20field">Link to this property</a>

Value stringOptional

Value for matcher.

maxLength90

<a href="#(resource)%20email_routing.rules%20%3E%20(model)%20matcher%20%3E%20(schema)%20%3E%20(property)%20value">Link to this property</a>

</details>

[Link to this property](<#(resource)%20email_routing.rules%20%3E%20(model)%20matcher%20%3E%20(schema)>)

#### Email RoutingRulesCatch Alls

##### [Get catch-all rule](https://developers.cloudflare.com/api/go/resources/email_routing/subresources/rules/subresources/catch_alls/methods/get)

client.EmailRouting.Rules.CatchAlls.Get(ctx, query) (\*[RuleCatchAllGetResponse](<https://developers.cloudflare.com/api/go/resources/email_routing#(resource)%20email_routing.rules.catch_alls%20%3E%20(model)%20RuleCatchAllGetResponse%20%3E%20(schema)>), error)

GET/zones/{zone\_id}/email/routing/rules/catch\_all

##### [Update catch-all rule](https://developers.cloudflare.com/api/go/resources/email_routing/subresources/rules/subresources/catch_alls/methods/update)

client.EmailRouting.Rules.CatchAlls.Update(ctx, params) (\*[RuleCatchAllUpdateResponse](<https://developers.cloudflare.com/api/go/resources/email_routing#(resource)%20email_routing.rules.catch_alls%20%3E%20(model)%20RuleCatchAllUpdateResponse%20%3E%20(schema)>), error)

PUT/zones/{zone\_id}/email/routing/rules/catch\_all

##### ModelsExpand Collapse

<details>

<summary>

type CatchAllAction struct{…}

Action for the catch-all routing rule.

</summary>

<details>

<summary>

Type CatchAllActionType

Type of action for catch-all rule.

</summary>

One of the following:

const CatchAllActionTypeDrop CatchAllActionType = "drop"

<a href="#(resource)%20email_routing.rules.catch_alls%20%3E%20(model)%20catch_all_action%20%3E%20(schema)%20%3E%20(property)%20type%20%3E%20(member)%200">Link to this property</a>

const CatchAllActionTypeForward CatchAllActionType = "forward"

<a href="#(resource)%20email_routing.rules.catch_alls%20%3E%20(model)%20catch_all_action%20%3E%20(schema)%20%3E%20(property)%20type%20%3E%20(member)%201">Link to this property</a>

const CatchAllActionTypeWorker CatchAllActionType = "worker"

<a href="#(resource)%20email_routing.rules.catch_alls%20%3E%20(model)%20catch_all_action%20%3E%20(schema)%20%3E%20(property)%20type%20%3E%20(member)%202">Link to this property</a>

</details>

<a href="#(resource)%20email_routing.rules.catch_alls%20%3E%20(model)%20catch_all_action%20%3E%20(schema)%20%3E%20(property)%20type">Link to this property</a>

Value \[]stringOptional

List of values for the action. Currently limited to a single value.

<a href="#(resource)%20email_routing.rules.catch_alls%20%3E%20(model)%20catch_all_action%20%3E%20(schema)%20%3E%20(property)%20value">Link to this property</a>

</details>

[Link to this property](<#(resource)%20email_routing.rules.catch_alls%20%3E%20(model)%20catch_all_action%20%3E%20(schema)>)

<details>

<summary>

type CatchAllMatcher struct{…}

Matcher for catch-all routing rule.

</summary>

Type CatchAllMatcherType

Type of matcher. Default is ‘all’.

<a href="#(resource)%20email_routing.rules.catch_alls%20%3E%20(model)%20catch_all_matcher%20%3E%20(schema)%20%3E%20(property)%20type">Link to this property</a>

</details>

[Link to this property](<#(resource)%20email_routing.rules.catch_alls%20%3E%20(model)%20catch_all_matcher%20%3E%20(schema)>)

#### Email RoutingAccount Rules

##### [List account or zone routing rules](https://developers.cloudflare.com/api/go/resources/email_routing/subresources/account_rules/methods/list)

client.EmailRouting.AccountRules.List(ctx, params) (\*V4PagePaginationArray\[[AccountRule](<https://developers.cloudflare.com/api/go/resources/email_routing#(resource)%20email_routing.account_rules%20%3E%20(model)%20account_rule%20%3E%20(schema)>)], error)

GET/{accounts\_or\_zones}/{account\_or\_zone\_id}/email/routing/rules

##### ModelsExpand Collapse

<details>

<summary>

type AccountRule struct{…}

</summary>

ID stringOptional

Routing rule identifier.

maxLength32

<a href="#(resource)%20email_routing.account_rules%20%3E%20(model)%20account_rule%20%3E%20(schema)%20%3E%20(property)%20id">Link to this property</a>

<details>

<summary>

Actions \[]<a href="https://developers.cloudflare.com/api/go/resources/email_routing#(resource)%20email_routing.rules%20%3E%20(model)%20action%20%3E%20(schema)">Action</a>Optional

List actions patterns.

</summary>

<details>

<summary>

Type ActionType

Type of supported action.

</summary>

One of the following:

const ActionTypeDrop ActionType = "drop"

<a href="#(resource)%20email_routing.rules%20%3E%20(model)%20action%20%3E%20(schema)%20%3E%20(property)%20type%20%3E%20(member)%200">Link to this property</a>

const ActionTypeForward ActionType = "forward"

<a href="#(resource)%20email_routing.rules%20%3E%20(model)%20action%20%3E%20(schema)%20%3E%20(property)%20type%20%3E%20(member)%201">Link to this property</a>

const ActionTypeWorker ActionType = "worker"

<a href="#(resource)%20email_routing.rules%20%3E%20(model)%20action%20%3E%20(schema)%20%3E%20(property)%20type%20%3E%20(member)%202">Link to this property</a>

</details>

<a href="#(resource)%20email_routing.rules%20%3E%20(model)%20action%20%3E%20(schema)%20%3E%20(property)%20type">Link to this property</a>

Value \[]stringOptional

List of values for the action. Currently limited to a single value.

<a href="#(resource)%20email_routing.rules%20%3E%20(model)%20action%20%3E%20(schema)%20%3E%20(property)%20value">Link to this property</a>

</details>

<a href="#(resource)%20email_routing.account_rules%20%3E%20(model)%20account_rule%20%3E%20(schema)%20%3E%20(property)%20actions">Link to this property</a>

<details>

<summary>

Enabled AccountRuleEnabledOptional

Routing rule status.

</summary>

One of the following:

const AccountRuleEnabledTrue AccountRuleEnabled = true

<a href="#(resource)%20email_routing.account_rules%20%3E%20(model)%20account_rule%20%3E%20(schema)%20%3E%20(property)%20enabled%20%3E%20(member)%200">Link to this property</a>

const AccountRuleEnabledFalse AccountRuleEnabled = false

<a href="#(resource)%20email_routing.account_rules%20%3E%20(model)%20account_rule%20%3E%20(schema)%20%3E%20(property)%20enabled%20%3E%20(member)%201">Link to this property</a>

</details>

<a href="#(resource)%20email_routing.account_rules%20%3E%20(model)%20account_rule%20%3E%20(schema)%20%3E%20(property)%20enabled">Link to this property</a>

<details>

<summary>

Matchers \[]<a href="https://developers.cloudflare.com/api/go/resources/email_routing#(resource)%20email_routing.rules%20%3E%20(model)%20matcher%20%3E%20(schema)">Matcher</a>Optional

Matching patterns to forward to your actions.

</summary>

<details>

<summary>

Type MatcherType

Type of matcher.

</summary>

One of the following:

const MatcherTypeAll MatcherType = "all"

<a href="#(resource)%20email_routing.rules%20%3E%20(model)%20matcher%20%3E%20(schema)%20%3E%20(property)%20type%20%3E%20(member)%200">Link to this property</a>

const MatcherTypeLiteral MatcherType = "literal"

<a href="#(resource)%20email_routing.rules%20%3E%20(model)%20matcher%20%3E%20(schema)%20%3E%20(property)%20type%20%3E%20(member)%201">Link to this property</a>

</details>

<a href="#(resource)%20email_routing.rules%20%3E%20(model)%20matcher%20%3E%20(schema)%20%3E%20(property)%20type">Link to this property</a>

Field MatcherFieldOptional

Field for type matcher.

<a href="#(resource)%20email_routing.rules%20%3E%20(model)%20matcher%20%3E%20(schema)%20%3E%20(property)%20field">Link to this property</a>

Value stringOptional

Value for matcher.

maxLength90

<a href="#(resource)%20email_routing.rules%20%3E%20(model)%20matcher%20%3E%20(schema)%20%3E%20(property)%20value">Link to this property</a>

</details>

<a href="#(resource)%20email_routing.account_rules%20%3E%20(model)%20account_rule%20%3E%20(schema)%20%3E%20(property)%20matchers">Link to this property</a>

Name stringOptional

Routing rule name.

maxLength256

<a href="#(resource)%20email_routing.account_rules%20%3E%20(model)%20account_rule%20%3E%20(schema)%20%3E%20(property)%20name">Link to this property</a>

Priority float64Optional

Priority of the routing rule.

minimum0

<a href="#(resource)%20email_routing.account_rules%20%3E%20(model)%20account_rule%20%3E%20(schema)%20%3E%20(property)%20priority">Link to this property</a>

<details>

<summary>

Source AccountRuleSourceOptional

Who manages the rule. <code>api</code> covers dashboard, generic API, and Terraform; <code>wrangler</code> means the rule is managed by a Worker’s wrangler.jsonc. Defaults to <code>api</code> when omitted on write.

</summary>

One of the following:

const AccountRuleSourceAPI AccountRuleSource = "api"

<a href="#(resource)%20email_routing.account_rules%20%3E%20(model)%20account_rule%20%3E%20(schema)%20%3E%20(property)%20source%20%3E%20(member)%200">Link to this property</a>

const AccountRuleSourceWrangler AccountRuleSource = "wrangler"

<a href="#(resource)%20email_routing.account_rules%20%3E%20(model)%20account_rule%20%3E%20(schema)%20%3E%20(property)%20source%20%3E%20(member)%201">Link to this property</a>

</details>

<a href="#(resource)%20email_routing.account_rules%20%3E%20(model)%20account_rule%20%3E%20(schema)%20%3E%20(property)%20source">Link to this property</a>

DeprecatedTag stringOptional

Routing rule tag. (Deprecated, replaced by routing rule identifier)

maxLength32

<a href="#(resource)%20email_routing.account_rules%20%3E%20(model)%20account_rule%20%3E%20(schema)%20%3E%20(property)%20tag">Link to this property</a>

<details>

<summary>

Zone AccountRuleZoneOptional

Zone information for the routing rule.

</summary>

Name stringOptional

Zone name.

<a href="#(resource)%20email_routing.account_rules%20%3E%20(model)%20account_rule%20%3E%20(schema)%20%3E%20(property)%20zone%20%3E%20(property)%20name">Link to this property</a>

Tag stringOptional

Zone tag.

maxLength32

<a href="#(resource)%20email_routing.account_rules%20%3E%20(model)%20account_rule%20%3E%20(schema)%20%3E%20(property)%20zone%20%3E%20(property)%20tag">Link to this property</a>

</details>

<a href="#(resource)%20email_routing.account_rules%20%3E%20(model)%20account_rule%20%3E%20(schema)%20%3E%20(property)%20zone">Link to this property</a>

</details>

[Link to this property](<#(resource)%20email_routing.account_rules%20%3E%20(model)%20account_rule%20%3E%20(schema)>)

#### Email RoutingAddresses

##### [List destination addresses](https://developers.cloudflare.com/api/go/resources/email_routing/subresources/addresses/methods/list)

client.EmailRouting.Addresses.List(ctx, params) (\*V4PagePaginationArray\[[Address](<https://developers.cloudflare.com/api/go/resources/email_routing#(resource)%20email_routing.addresses%20%3E%20(model)%20address%20%3E%20(schema)>)], error)

GET/accounts/{account\_id}/email/routing/addresses

##### [Get a destination address](https://developers.cloudflare.com/api/go/resources/email_routing/subresources/addresses/methods/get)

client.EmailRouting.Addresses.Get(ctx, destinationAddressIdentifier, query) (\*[Address](<https://developers.cloudflare.com/api/go/resources/email_routing#(resource)%20email_routing.addresses%20%3E%20(model)%20address%20%3E%20(schema)>), error)

GET/accounts/{account\_id}/email/routing/addresses/{destination\_address\_identifier}

##### [Create a destination address](https://developers.cloudflare.com/api/go/resources/email_routing/subresources/addresses/methods/create)

client.EmailRouting.Addresses.New(ctx, params) (\*[Address](<https://developers.cloudflare.com/api/go/resources/email_routing#(resource)%20email_routing.addresses%20%3E%20(model)%20address%20%3E%20(schema)>), error)

POST/accounts/{account\_id}/email/routing/addresses

##### [Update destination address](https://developers.cloudflare.com/api/go/resources/email_routing/subresources/addresses/methods/edit)

client.EmailRouting.Addresses.Edit(ctx, destinationAddressIdentifier, params) (\*[Address](<https://developers.cloudflare.com/api/go/resources/email_routing#(resource)%20email_routing.addresses%20%3E%20(model)%20address%20%3E%20(schema)>), error)

PATCH/accounts/{account\_id}/email/routing/addresses/{destination\_address\_identifier}

##### [Delete destination address](https://developers.cloudflare.com/api/go/resources/email_routing/subresources/addresses/methods/delete)

client.EmailRouting.Addresses.Delete(ctx, destinationAddressIdentifier, body) (\*[Address](<https://developers.cloudflare.com/api/go/resources/email_routing#(resource)%20email_routing.addresses%20%3E%20(model)%20address%20%3E%20(schema)>), error)

DELETE/accounts/{account\_id}/email/routing/addresses/{destination\_address\_identifier}

##### ModelsExpand Collapse

<details>

<summary>

type Address struct{…}

</summary>

ID stringOptional

Destination address identifier.

maxLength32

<a href="#(resource)%20email_routing.addresses%20%3E%20(model)%20address%20%3E%20(schema)%20%3E%20(property)%20id">Link to this property</a>

Created TimeOptional

The date and time the destination address has been created.

formatdate-time

<a href="#(resource)%20email_routing.addresses%20%3E%20(model)%20address%20%3E%20(schema)%20%3E%20(property)%20created">Link to this property</a>

Email stringOptional

The contact email address of the user.

maxLength90

<a href="#(resource)%20email_routing.addresses%20%3E%20(model)%20address%20%3E%20(schema)%20%3E%20(property)%20email">Link to this property</a>

Modified TimeOptional

The date and time the destination address was last modified.

formatdate-time

<a href="#(resource)%20email_routing.addresses%20%3E%20(model)%20address%20%3E%20(schema)%20%3E%20(property)%20modified">Link to this property</a>

DeprecatedTag stringOptional

Destination address tag. (Deprecated, replaced by destination address identifier)

maxLength32

<a href="#(resource)%20email_routing.addresses%20%3E%20(model)%20address%20%3E%20(schema)%20%3E%20(property)%20tag">Link to this property</a>

Verified TimeOptional

The date and time the destination address has been verified. Null means not verified yet.

formatdate-time

<a href="#(resource)%20email_routing.addresses%20%3E%20(model)%20address%20%3E%20(schema)%20%3E%20(property)%20verified">Link to this property</a>

</details>

[Link to this property](<#(resource)%20email_routing.addresses%20%3E%20(model)%20address%20%3E%20(schema)>)