Skip to content
Start here

Get catch-all rule

email_routing.rules.catch_alls.get(CatchAllGetParams**kwargs) -> CatchAllGetResponse
GET/zones/{zone_id}/email/routing/rules/catch_all

Get information on the default catch-all routing rule.

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
Accepted Permissions (at least one required)
Email Routing Rules WriteEmail Routing Rules Read
ParametersExpand Collapse
zone_id: str

Identifier.

maxLength32
ReturnsExpand Collapse
class CatchAllGetResponse:
id: Optional[str]

Routing rule identifier.

maxLength32
actions: Optional[List[CatchAllAction]]

List actions for the catch-all routing rule.

type: Literal["drop", "forward", "worker"]

Type of action for catch-all rule.

One of the following:
"drop"
"forward"
"worker"
value: Optional[List[str]]
enabled: Optional[Literal[true, false]]

Routing rule status.

One of the following:
true
false
matchers: Optional[List[CatchAllMatcher]]

List of matchers for the catch-all routing rule.

type: Literal["all"]

Type of matcher. Default is ‘all’.

name: Optional[str]

Routing rule name.

maxLength256
Deprecatedtag: Optional[str]

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

maxLength32

Get catch-all rule

import os
from cloudflare import Cloudflare

client = Cloudflare(
    api_email=os.environ.get("CLOUDFLARE_EMAIL"),  # This is the default and can be omitted
    api_key=os.environ.get("CLOUDFLARE_API_KEY"),  # This is the default and can be omitted
)
catch_all = client.email_routing.rules.catch_alls.get(
    zone_id="023e105f4ecef8ad9ca31a8372d0c353",
)
print(catch_all.id)
{
  "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": "all"
      }
    ],
    "name": "Send to user@example.net rule.",
    "tag": "a7e6fb77503c41d8a7f3113c6918f10c"
  }
}
Returns Examples
{
  "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": "all"
      }
    ],
    "name": "Send to user@example.net rule.",
    "tag": "a7e6fb77503c41d8a7f3113c6918f10c"
  }
}