---
title: Rules
---

[Skip to content](#%5Ftop) 

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

[Email Routing](https://developers.cloudflare.com/api/typescript/resources/email%5Frouting)

Copy Markdown

Open in **Claude**

Open in **ChatGPT**

Open in **Cursor**

---

**Copy Markdown**

**View as Markdown**

# Rules

##### [List account or zone routing rules](https://developers.cloudflare.com/api/typescript/resources/email%5Frouting/subresources/rules/methods/list)

client.emailRouting.rules.list(RuleListParams { account\_id, zone\_id, enabled, 2 more } params?, RequestOptionsoptions?): V4PagePaginationArray<[AccountRule](https://developers.cloudflare.com/api/typescript/resources/email%5Frouting#%28resource%29%20email%5Frouting.account%5Frules%20%3E%20%28model%29%20account%5Frule%20%3E%20%28schema%29) { id, actions, enabled, 6 more } \>

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

##### [Get routing rule](https://developers.cloudflare.com/api/typescript/resources/email%5Frouting/subresources/rules/methods/get)

client.emailRouting.rules.get(stringruleIdentifier, RuleGetParams { zone\_id } params, RequestOptionsoptions?): [EmailRoutingRule](https://developers.cloudflare.com/api/typescript/resources/email%5Frouting#%28resource%29%20email%5Frouting.rules%20%3E%20%28model%29%20email%5Frouting%5Frule%20%3E%20%28schema%29) { id, actions, enabled, 5 more } 

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

##### [Create routing rule](https://developers.cloudflare.com/api/typescript/resources/email%5Frouting/subresources/rules/methods/create)

client.emailRouting.rules.create(RuleCreateParams { zone\_id, actions, matchers, 5 more } params, RequestOptionsoptions?): [EmailRoutingRule](https://developers.cloudflare.com/api/typescript/resources/email%5Frouting#%28resource%29%20email%5Frouting.rules%20%3E%20%28model%29%20email%5Frouting%5Frule%20%3E%20%28schema%29) { id, actions, enabled, 5 more } 

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

##### [Update routing rule](https://developers.cloudflare.com/api/typescript/resources/email%5Frouting/subresources/rules/methods/update)

client.emailRouting.rules.update(stringruleIdentifier, RuleUpdateParams { zone\_id, actions, matchers, 5 more } params, RequestOptionsoptions?): [EmailRoutingRule](https://developers.cloudflare.com/api/typescript/resources/email%5Frouting#%28resource%29%20email%5Frouting.rules%20%3E%20%28model%29%20email%5Frouting%5Frule%20%3E%20%28schema%29) { id, actions, enabled, 5 more } 

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

##### [Delete routing rule](https://developers.cloudflare.com/api/typescript/resources/email%5Frouting/subresources/rules/methods/delete)

client.emailRouting.rules.delete(stringruleIdentifier, RuleDeleteParams { zone\_id } params, RequestOptionsoptions?): [EmailRoutingRule](https://developers.cloudflare.com/api/typescript/resources/email%5Frouting#%28resource%29%20email%5Frouting.rules%20%3E%20%28model%29%20email%5Frouting%5Frule%20%3E%20%28schema%29) { id, actions, enabled, 5 more } 

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

##### ModelsExpand Collapse 

Action { type, value } 

Actions pattern.

type: "drop" | "forward" | "worker"

Type of supported action.

One of the following:

"drop"

"forward"

"worker"

value?: Array<string\>

EmailRoutingRule { id, actions, enabled, 5 more } 

id?: string

Routing rule identifier.

maxLength32

actions?: Array<[Action](https://developers.cloudflare.com/api/typescript/resources/email%5Frouting#%28resource%29%20email%5Frouting.rules%20%3E%20%28model%29%20action%20%3E%20%28schema%29) { type, value } \>

List actions patterns.

type: "drop" | "forward" | "worker"

Type of supported action.

One of the following:

"drop"

"forward"

"worker"

value?: Array<string\>

enabled?: true | false

Routing rule status.

One of the following:

true

false

matchers?: Array<[Matcher](https://developers.cloudflare.com/api/typescript/resources/email%5Frouting#%28resource%29%20email%5Frouting.rules%20%3E%20%28model%29%20matcher%20%3E%20%28schema%29) { type, field, value } \>

Matching patterns to forward to your actions.

type: "all" | "literal"

Type of matcher.

One of the following:

"all"

"literal"

field?: "to"

Field for type matcher.

value?: string

Value for matcher.

maxLength90

name?: string

Routing rule name.

maxLength256

priority?: number

Priority of the routing rule.

minimum0

source?: "api" | "wrangler"

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

One of the following:

"api"

"wrangler"

Deprecatedtag?: string

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

maxLength32

Matcher { type, field, value } 

Matching pattern to forward your actions.

type: "all" | "literal"

Type of matcher.

One of the following:

"all"

"literal"

field?: "to"

Field for type matcher.

value?: string

Value for matcher.

maxLength90

#### RulesCatch Alls

##### [Get catch-all rule](https://developers.cloudflare.com/api/typescript/resources/email%5Frouting/subresources/rules/subresources/catch%5Falls/methods/get)

client.emailRouting.rules.catchAlls.get(CatchAllGetParams { zone\_id } params, RequestOptionsoptions?): [CatchAllGetResponse](https://developers.cloudflare.com/api/typescript/resources/email%5Frouting#%28resource%29%20email%5Frouting.rules.catch%5Falls%20%3E%20%28model%29%20catch%5Fall%5Fget%5Fresponse%20%3E%20%28schema%29) { id, actions, enabled, 4 more } 

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

##### [Update catch-all rule](https://developers.cloudflare.com/api/typescript/resources/email%5Frouting/subresources/rules/subresources/catch%5Falls/methods/update)

client.emailRouting.rules.catchAlls.update(CatchAllUpdateParams { zone\_id, actions, matchers, 4 more } params, RequestOptionsoptions?): [CatchAllUpdateResponse](https://developers.cloudflare.com/api/typescript/resources/email%5Frouting#%28resource%29%20email%5Frouting.rules.catch%5Falls%20%3E%20%28model%29%20catch%5Fall%5Fupdate%5Fresponse%20%3E%20%28schema%29) { id, actions, enabled, 4 more } 

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

##### ModelsExpand Collapse 

CatchAllAction { type, value } 

Action for the catch-all routing rule.

type: "drop" | "forward" | "worker"

Type of action for catch-all rule.

One of the following:

"drop"

"forward"

"worker"

value?: Array<string\>

CatchAllMatcher { type } 

Matcher for catch-all routing rule.

type: "all"

Type of matcher. Default is ‘all’.

CatchAllGetResponse { id, actions, enabled, 4 more } 

id?: string

Routing rule identifier.

maxLength32

actions?: Array<[CatchAllAction](https://developers.cloudflare.com/api/typescript/resources/email%5Frouting#%28resource%29%20email%5Frouting.rules.catch%5Falls%20%3E%20%28model%29%20catch%5Fall%5Faction%20%3E%20%28schema%29) { type, value } \>

List actions for the catch-all routing rule.

type: "drop" | "forward" | "worker"

Type of action for catch-all rule.

One of the following:

"drop"

"forward"

"worker"

value?: Array<string\>

enabled?: true | false

Routing rule status.

One of the following:

true

false

matchers?: Array<[CatchAllMatcher](https://developers.cloudflare.com/api/typescript/resources/email%5Frouting#%28resource%29%20email%5Frouting.rules.catch%5Falls%20%3E%20%28model%29%20catch%5Fall%5Fmatcher%20%3E%20%28schema%29) { type } \>

List of matchers for the catch-all routing rule.

type: "all"

Type of matcher. Default is ‘all’.

name?: string

Routing rule name.

maxLength256

source?: "api" | "wrangler"

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

One of the following:

"api"

"wrangler"

Deprecatedtag?: string

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

maxLength32

CatchAllUpdateResponse { id, actions, enabled, 4 more } 

id?: string

Routing rule identifier.

maxLength32

actions?: Array<[CatchAllAction](https://developers.cloudflare.com/api/typescript/resources/email%5Frouting#%28resource%29%20email%5Frouting.rules.catch%5Falls%20%3E%20%28model%29%20catch%5Fall%5Faction%20%3E%20%28schema%29) { type, value } \>

List actions for the catch-all routing rule.

type: "drop" | "forward" | "worker"

Type of action for catch-all rule.

One of the following:

"drop"

"forward"

"worker"

value?: Array<string\>

enabled?: true | false

Routing rule status.

One of the following:

true

false

matchers?: Array<[CatchAllMatcher](https://developers.cloudflare.com/api/typescript/resources/email%5Frouting#%28resource%29%20email%5Frouting.rules.catch%5Falls%20%3E%20%28model%29%20catch%5Fall%5Fmatcher%20%3E%20%28schema%29) { type } \>

List of matchers for the catch-all routing rule.

type: "all"

Type of matcher. Default is ‘all’.

name?: string

Routing rule name.

maxLength256

source?: "api" | "wrangler"

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

One of the following:

"api"

"wrangler"

Deprecatedtag?: string

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

maxLength32