---
title: List account or zone routing rules
---

[Skip to content](#%5Ftop) 

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

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

[Account Rules](https://developers.cloudflare.com/api/resources/email%5Frouting/subresources/account%5Frules)

Copy Markdown

Open in **Claude**

Open in **ChatGPT**

Open in **Cursor**

---

**Copy Markdown**

**View as Markdown**

# List account or zone routing rules

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

Lists existing routing rules across all zones in the account or zone.

##### 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`

##### Path ParametersExpand Collapse 

account\_id: optional string

The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.

zone\_id: optional string

The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.

##### Query ParametersExpand Collapse 

enabled: optional true or false

Filter by enabled routing rules.

One of the following:

true

false

page: optional number

Page number of paginated results.

minimum1

per\_page: optional number

Maximum number of results per page.

maximum50

minimum5

##### ReturnsExpand Collapse 

errors: array of object { code, message, documentation\_url, source } 

code: number

minimum1000

message: string

documentation\_url: optional string

source: optional object { pointer } 

pointer: optional string

messages: array of object { code, message, documentation\_url, source } 

code: number

minimum1000

message: string

documentation\_url: optional string

source: optional object { pointer } 

pointer: optional string

success: true

Whether the API call was successful.

result: optional array of [AccountRule](https://developers.cloudflare.com/api/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 } 

id: optional string

Routing rule identifier.

maxLength32

actions: optional array of [Action](https://developers.cloudflare.com/api/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" or "forward" or "worker"

Type of supported action.

One of the following:

"drop"

"forward"

"worker"

value: optional array of string

enabled: optional true or false

Routing rule status.

One of the following:

true

false

matchers: optional array of [Matcher](https://developers.cloudflare.com/api/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" or "literal"

Type of matcher.

One of the following:

"all"

"literal"

field: optional "to"

Field for type matcher.

value: optional string

Value for matcher.

maxLength90

name: optional string

Routing rule name.

maxLength256

priority: optional number

Priority of the routing rule.

minimum0

source: optional "api" or "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: optional string

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

maxLength32

zone: optional object { name, tag } 

Zone information for the routing rule.

name: optional string

Zone name.

tag: optional string

Zone tag.

maxLength32

result\_info: optional object { count, page, per\_page, 2 more } 

count: optional number

Total number of results for the requested service.

page: optional number

Current page within paginated list of results.

per\_page: optional number

Number of results per page of results.

total\_count: optional number

Total results available without any search parameters.

total\_pages: optional number

The number of total pages in the entire result set.

### List account or zone routing rules

HTTP

HTTPHTTP

TypeScriptTypeScript

PythonPython

GoGo

TerraformTerraform

```
curl https://api.cloudflare.com/client/v4/$ACCOUNTS_OR_ZONES/$ACCOUNT_OR_ZONE_ID/email/routing/rules \
    -H "X-Auth-Email: $CLOUDFLARE_EMAIL" \
    -H "X-Auth-Key: $CLOUDFLARE_API_KEY"
```

200 example

```
{
  "errors": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "success": true,
  "result": [
    {
      "id": "a7e6fb77503c41d8a7f3113c6918f10c",
      "actions": [
        {
          "type": "forward",
          "value": [
            "destinationaddress@example.net"
          ]
        }
      ],
      "enabled": true,
      "matchers": [
        {
          "type": "literal",
          "field": "to",
          "value": "test@example.com"
        }
      ],
      "name": "Send to user@example.net rule.",
      "priority": 0,
      "source": "api",
      "tag": "a7e6fb77503c41d8a7f3113c6918f10c",
      "zone": {
        "name": "example.com",
        "tag": "023e105f4ecef8ad9ca31a8372d0c353"
      }
    }
  ],
  "result_info": {
    "count": 1,
    "page": 1,
    "per_page": 20,
    "total_count": 1,
    "total_pages": 100
  }
}
```

##### Returns Examples

200 example

```
{
  "errors": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "success": true,
  "result": [
    {
      "id": "a7e6fb77503c41d8a7f3113c6918f10c",
      "actions": [
        {
          "type": "forward",
          "value": [
            "destinationaddress@example.net"
          ]
        }
      ],
      "enabled": true,
      "matchers": [
        {
          "type": "literal",
          "field": "to",
          "value": "test@example.com"
        }
      ],
      "name": "Send to user@example.net rule.",
      "priority": 0,
      "source": "api",
      "tag": "a7e6fb77503c41d8a7f3113c6918f10c",
      "zone": {
        "name": "example.com",
        "tag": "023e105f4ecef8ad9ca31a8372d0c353"
      }
    }
  ],
  "result_info": {
    "count": 1,
    "page": 1,
    "per_page": 20,
    "total_count": 1,
    "total_pages": 100
  }
}
```