# Email Routing ## Get Email Routing settings `email_routing.get(EmailRoutingGetParams**kwargs) -> Settings` **get** `/zones/{zone_id}/email/routing` Get information about the settings for your Email Routing zone. ### Parameters - `zone_id: str` Identifier. ### Returns - `class Settings: …` - `id: str` Email Routing settings identifier. - `enabled: Literal[true, false]` State of the zone settings for Email Routing. - `true` - `false` - `name: str` Domain of your zone. - `created: Optional[datetime]` The date and time the settings have been created. - `modified: Optional[datetime]` The date and time the settings have been modified. - `skip_wizard: Optional[Literal[true, false]]` Flag to check if the user skipped the configuration wizard. - `true` - `false` - `status: Optional[Literal["ready", "unconfigured", "misconfigured", 2 more]]` Show the state of your account, and the type or configuration error. - `"ready"` - `"unconfigured"` - `"misconfigured"` - `"misconfigured/locked"` - `"unlocked"` - `tag: Optional[str]` Email Routing settings tag. (Deprecated, replaced by Email Routing settings identifier) ### Example ```python 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 ) settings = client.email_routing.get( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) print(settings.id) ``` #### Response ```json { "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": "75610dab9e69410a82cf7e400a09ecec", "enabled": true, "name": "example.net", "created": "2014-01-02T02:20:00Z", "modified": "2014-01-02T02:20:00Z", "skip_wizard": true, "status": "ready", "tag": "75610dab9e69410a82cf7e400a09ecec" } } ``` ## Disable Email Routing `email_routing.disable(EmailRoutingDisableParams**kwargs) -> Settings` **post** `/zones/{zone_id}/email/routing/disable` Disable your Email Routing zone. Also removes additional MX records previously required for Email Routing to work. ### Parameters - `zone_id: str` Identifier. - `body: object` ### Returns - `class Settings: …` - `id: str` Email Routing settings identifier. - `enabled: Literal[true, false]` State of the zone settings for Email Routing. - `true` - `false` - `name: str` Domain of your zone. - `created: Optional[datetime]` The date and time the settings have been created. - `modified: Optional[datetime]` The date and time the settings have been modified. - `skip_wizard: Optional[Literal[true, false]]` Flag to check if the user skipped the configuration wizard. - `true` - `false` - `status: Optional[Literal["ready", "unconfigured", "misconfigured", 2 more]]` Show the state of your account, and the type or configuration error. - `"ready"` - `"unconfigured"` - `"misconfigured"` - `"misconfigured/locked"` - `"unlocked"` - `tag: Optional[str]` Email Routing settings tag. (Deprecated, replaced by Email Routing settings identifier) ### Example ```python 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 ) settings = client.email_routing.disable( zone_id="023e105f4ecef8ad9ca31a8372d0c353", body={}, ) print(settings.id) ``` #### Response ```json { "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": "75610dab9e69410a82cf7e400a09ecec", "enabled": true, "name": "example.net", "created": "2014-01-02T02:20:00Z", "modified": "2014-01-02T02:20:00Z", "skip_wizard": true, "status": "ready", "tag": "75610dab9e69410a82cf7e400a09ecec" } } ``` ## Enable Email Routing `email_routing.enable(EmailRoutingEnableParams**kwargs) -> Settings` **post** `/zones/{zone_id}/email/routing/enable` Enable you Email Routing zone. Add and lock the necessary MX and SPF records. ### Parameters - `zone_id: str` Identifier. - `body: object` ### Returns - `class Settings: …` - `id: str` Email Routing settings identifier. - `enabled: Literal[true, false]` State of the zone settings for Email Routing. - `true` - `false` - `name: str` Domain of your zone. - `created: Optional[datetime]` The date and time the settings have been created. - `modified: Optional[datetime]` The date and time the settings have been modified. - `skip_wizard: Optional[Literal[true, false]]` Flag to check if the user skipped the configuration wizard. - `true` - `false` - `status: Optional[Literal["ready", "unconfigured", "misconfigured", 2 more]]` Show the state of your account, and the type or configuration error. - `"ready"` - `"unconfigured"` - `"misconfigured"` - `"misconfigured/locked"` - `"unlocked"` - `tag: Optional[str]` Email Routing settings tag. (Deprecated, replaced by Email Routing settings identifier) ### Example ```python 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 ) settings = client.email_routing.enable( zone_id="023e105f4ecef8ad9ca31a8372d0c353", body={}, ) print(settings.id) ``` #### Response ```json { "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": "75610dab9e69410a82cf7e400a09ecec", "enabled": true, "name": "example.net", "created": "2014-01-02T02:20:00Z", "modified": "2014-01-02T02:20:00Z", "skip_wizard": true, "status": "ready", "tag": "75610dab9e69410a82cf7e400a09ecec" } } ``` ## Domain Types ### Settings - `class Settings: …` - `id: str` Email Routing settings identifier. - `enabled: Literal[true, false]` State of the zone settings for Email Routing. - `true` - `false` - `name: str` Domain of your zone. - `created: Optional[datetime]` The date and time the settings have been created. - `modified: Optional[datetime]` The date and time the settings have been modified. - `skip_wizard: Optional[Literal[true, false]]` Flag to check if the user skipped the configuration wizard. - `true` - `false` - `status: Optional[Literal["ready", "unconfigured", "misconfigured", 2 more]]` Show the state of your account, and the type or configuration error. - `"ready"` - `"unconfigured"` - `"misconfigured"` - `"misconfigured/locked"` - `"unlocked"` - `tag: Optional[str]` Email Routing settings tag. (Deprecated, replaced by Email Routing settings identifier) # DNS ## Email Routing - DNS settings `email_routing.dns.get(DNSGetParams**kwargs) -> DNSGetResponse` **get** `/zones/{zone_id}/email/routing/dns` Show the DNS records needed to configure your Email Routing zone. ### Parameters - `zone_id: str` Identifier. - `subdomain: Optional[str]` Domain of your zone. ### Returns - `DNSGetResponse` - `class EmailEmailRoutingDNSQueryResponse: …` - `errors: List[EmailEmailRoutingDNSQueryResponseError]` - `code: int` - `message: str` - `documentation_url: Optional[str]` - `source: Optional[EmailEmailRoutingDNSQueryResponseErrorSource]` - `pointer: Optional[str]` - `messages: List[EmailEmailRoutingDNSQueryResponseMessage]` - `code: int` - `message: str` - `documentation_url: Optional[str]` - `source: Optional[EmailEmailRoutingDNSQueryResponseMessageSource]` - `pointer: Optional[str]` - `success: Literal[true]` Whether the API call was successful. - `true` - `result: Optional[EmailEmailRoutingDNSQueryResponseResult]` - `errors: Optional[List[EmailEmailRoutingDNSQueryResponseResultError]]` - `code: Optional[str]` - `missing: Optional[DNSRecord]` List of records needed to enable an Email Routing zone. - `content: Optional[str]` DNS record content. - `name: Optional[str]` DNS record name (or @ for the zone apex). - `priority: Optional[float]` Required for MX, SRV and URI records. Unused by other record types. Records with lower priorities are preferred. - `ttl: Optional[Union[float, Literal[1], null]]` Time to live, in seconds, of the DNS record. Must be between 60 and 86400, or 1 for 'automatic'. - `float` - `Literal[1]` Time to live, in seconds, of the DNS record. Must be between 60 and 86400, or 1 for 'automatic'. - `1` - `type: Optional[Literal["A", "AAAA", "CNAME", 15 more]]` DNS record type. - `"A"` - `"AAAA"` - `"CNAME"` - `"HTTPS"` - `"TXT"` - `"SRV"` - `"LOC"` - `"MX"` - `"NS"` - `"CERT"` - `"DNSKEY"` - `"DS"` - `"NAPTR"` - `"SMIMEA"` - `"SSHFP"` - `"SVCB"` - `"TLSA"` - `"URI"` - `record: Optional[List[DNSRecord]]` - `content: Optional[str]` DNS record content. - `name: Optional[str]` DNS record name (or @ for the zone apex). - `priority: Optional[float]` Required for MX, SRV and URI records. Unused by other record types. Records with lower priorities are preferred. - `ttl: Optional[Union[float, Literal[1], null]]` Time to live, in seconds, of the DNS record. Must be between 60 and 86400, or 1 for 'automatic'. - `type: Optional[Literal["A", "AAAA", "CNAME", 15 more]]` DNS record type. - `result_info: Optional[EmailEmailRoutingDNSQueryResponseResultInfo]` - `count: Optional[float]` Total number of results for the requested service. - `page: Optional[float]` Current page within paginated list of results. - `per_page: Optional[float]` Number of results per page of results. - `total_count: Optional[float]` Total results available without any search parameters. - `total_pages: Optional[float]` The number of total pages in the entire result set. - `class EmailDNSSettingsResponseCollection: …` - `errors: List[EmailDNSSettingsResponseCollectionError]` - `code: int` - `message: str` - `documentation_url: Optional[str]` - `source: Optional[EmailDNSSettingsResponseCollectionErrorSource]` - `pointer: Optional[str]` - `messages: List[EmailDNSSettingsResponseCollectionMessage]` - `code: int` - `message: str` - `documentation_url: Optional[str]` - `source: Optional[EmailDNSSettingsResponseCollectionMessageSource]` - `pointer: Optional[str]` - `success: Literal[true]` Whether the API call was successful. - `true` - `result: Optional[List[DNSRecord]]` - `content: Optional[str]` DNS record content. - `name: Optional[str]` DNS record name (or @ for the zone apex). - `priority: Optional[float]` Required for MX, SRV and URI records. Unused by other record types. Records with lower priorities are preferred. - `ttl: Optional[Union[float, Literal[1], null]]` Time to live, in seconds, of the DNS record. Must be between 60 and 86400, or 1 for 'automatic'. - `type: Optional[Literal["A", "AAAA", "CNAME", 15 more]]` DNS record type. - `result_info: Optional[EmailDNSSettingsResponseCollectionResultInfo]` - `count: Optional[float]` Total number of results for the requested service. - `page: Optional[float]` Current page within paginated list of results. - `per_page: Optional[float]` Number of results per page of results. - `total_count: Optional[float]` Total results available without any search parameters. - `total_pages: Optional[float]` The number of total pages in the entire result set. ### Example ```python 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 ) dns = client.email_routing.dns.get( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) print(dns) ``` #### Response ```json { "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": { "errors": [ { "code": "code", "missing": { "content": "route1.mx.cloudflare.net", "name": "example.com", "priority": 12, "ttl": 1, "type": "NS" } } ], "record": [ { "content": "route1.mx.cloudflare.net", "name": "example.com", "priority": 12, "ttl": 1, "type": "NS" } ] }, "result_info": { "count": 1, "page": 1, "per_page": 20, "total_count": 2000, "total_pages": 100 } } ``` ## Enable Email Routing `email_routing.dns.create(DNSCreateParams**kwargs) -> Settings` **post** `/zones/{zone_id}/email/routing/dns` Enable you Email Routing zone. Add and lock the necessary MX and SPF records. ### Parameters - `zone_id: str` Identifier. - `name: Optional[str]` Domain of your zone. ### Returns - `class Settings: …` - `id: str` Email Routing settings identifier. - `enabled: Literal[true, false]` State of the zone settings for Email Routing. - `true` - `false` - `name: str` Domain of your zone. - `created: Optional[datetime]` The date and time the settings have been created. - `modified: Optional[datetime]` The date and time the settings have been modified. - `skip_wizard: Optional[Literal[true, false]]` Flag to check if the user skipped the configuration wizard. - `true` - `false` - `status: Optional[Literal["ready", "unconfigured", "misconfigured", 2 more]]` Show the state of your account, and the type or configuration error. - `"ready"` - `"unconfigured"` - `"misconfigured"` - `"misconfigured/locked"` - `"unlocked"` - `tag: Optional[str]` Email Routing settings tag. (Deprecated, replaced by Email Routing settings identifier) ### Example ```python 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 ) settings = client.email_routing.dns.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) print(settings.id) ``` #### Response ```json { "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": "75610dab9e69410a82cf7e400a09ecec", "enabled": true, "name": "example.net", "created": "2014-01-02T02:20:00Z", "modified": "2014-01-02T02:20:00Z", "skip_wizard": true, "status": "ready", "tag": "75610dab9e69410a82cf7e400a09ecec" } } ``` ## Unlock Email Routing `email_routing.dns.edit(DNSEditParams**kwargs) -> Settings` **patch** `/zones/{zone_id}/email/routing/dns` Unlock MX Records previously locked by Email Routing. ### Parameters - `zone_id: str` Identifier. - `name: Optional[str]` Domain of your zone. ### Returns - `class Settings: …` - `id: str` Email Routing settings identifier. - `enabled: Literal[true, false]` State of the zone settings for Email Routing. - `true` - `false` - `name: str` Domain of your zone. - `created: Optional[datetime]` The date and time the settings have been created. - `modified: Optional[datetime]` The date and time the settings have been modified. - `skip_wizard: Optional[Literal[true, false]]` Flag to check if the user skipped the configuration wizard. - `true` - `false` - `status: Optional[Literal["ready", "unconfigured", "misconfigured", 2 more]]` Show the state of your account, and the type or configuration error. - `"ready"` - `"unconfigured"` - `"misconfigured"` - `"misconfigured/locked"` - `"unlocked"` - `tag: Optional[str]` Email Routing settings tag. (Deprecated, replaced by Email Routing settings identifier) ### Example ```python 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 ) settings = client.email_routing.dns.edit( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) print(settings.id) ``` #### Response ```json { "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": "75610dab9e69410a82cf7e400a09ecec", "enabled": true, "name": "example.net", "created": "2014-01-02T02:20:00Z", "modified": "2014-01-02T02:20:00Z", "skip_wizard": true, "status": "ready", "tag": "75610dab9e69410a82cf7e400a09ecec" } } ``` ## Disable Email Routing `email_routing.dns.delete(DNSDeleteParams**kwargs) -> SyncSinglePage[DNSRecord]` **delete** `/zones/{zone_id}/email/routing/dns` Disable your Email Routing zone. Also removes additional MX records previously required for Email Routing to work. ### Parameters - `zone_id: str` Identifier. ### Returns - `class DNSRecord: …` List of records needed to enable an Email Routing zone. - `content: Optional[str]` DNS record content. - `name: Optional[str]` DNS record name (or @ for the zone apex). - `priority: Optional[float]` Required for MX, SRV and URI records. Unused by other record types. Records with lower priorities are preferred. - `ttl: Optional[Union[float, Literal[1], null]]` Time to live, in seconds, of the DNS record. Must be between 60 and 86400, or 1 for 'automatic'. - `float` - `Literal[1]` Time to live, in seconds, of the DNS record. Must be between 60 and 86400, or 1 for 'automatic'. - `1` - `type: Optional[Literal["A", "AAAA", "CNAME", 15 more]]` DNS record type. - `"A"` - `"AAAA"` - `"CNAME"` - `"HTTPS"` - `"TXT"` - `"SRV"` - `"LOC"` - `"MX"` - `"NS"` - `"CERT"` - `"DNSKEY"` - `"DS"` - `"NAPTR"` - `"SMIMEA"` - `"SSHFP"` - `"SVCB"` - `"TLSA"` - `"URI"` ### Example ```python 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 ) page = client.email_routing.dns.delete( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) page = page.result[0] print(page.content) ``` #### Response ```json { "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 } ``` ## Domain Types ### DNS Record - `class DNSRecord: …` List of records needed to enable an Email Routing zone. - `content: Optional[str]` DNS record content. - `name: Optional[str]` DNS record name (or @ for the zone apex). - `priority: Optional[float]` Required for MX, SRV and URI records. Unused by other record types. Records with lower priorities are preferred. - `ttl: Optional[Union[float, Literal[1], null]]` Time to live, in seconds, of the DNS record. Must be between 60 and 86400, or 1 for 'automatic'. - `float` - `Literal[1]` Time to live, in seconds, of the DNS record. Must be between 60 and 86400, or 1 for 'automatic'. - `1` - `type: Optional[Literal["A", "AAAA", "CNAME", 15 more]]` DNS record type. - `"A"` - `"AAAA"` - `"CNAME"` - `"HTTPS"` - `"TXT"` - `"SRV"` - `"LOC"` - `"MX"` - `"NS"` - `"CERT"` - `"DNSKEY"` - `"DS"` - `"NAPTR"` - `"SMIMEA"` - `"SSHFP"` - `"SVCB"` - `"TLSA"` - `"URI"` ### DNS Get Response - `DNSGetResponse` - `class EmailEmailRoutingDNSQueryResponse: …` - `errors: List[EmailEmailRoutingDNSQueryResponseError]` - `code: int` - `message: str` - `documentation_url: Optional[str]` - `source: Optional[EmailEmailRoutingDNSQueryResponseErrorSource]` - `pointer: Optional[str]` - `messages: List[EmailEmailRoutingDNSQueryResponseMessage]` - `code: int` - `message: str` - `documentation_url: Optional[str]` - `source: Optional[EmailEmailRoutingDNSQueryResponseMessageSource]` - `pointer: Optional[str]` - `success: Literal[true]` Whether the API call was successful. - `true` - `result: Optional[EmailEmailRoutingDNSQueryResponseResult]` - `errors: Optional[List[EmailEmailRoutingDNSQueryResponseResultError]]` - `code: Optional[str]` - `missing: Optional[DNSRecord]` List of records needed to enable an Email Routing zone. - `content: Optional[str]` DNS record content. - `name: Optional[str]` DNS record name (or @ for the zone apex). - `priority: Optional[float]` Required for MX, SRV and URI records. Unused by other record types. Records with lower priorities are preferred. - `ttl: Optional[Union[float, Literal[1], null]]` Time to live, in seconds, of the DNS record. Must be between 60 and 86400, or 1 for 'automatic'. - `float` - `Literal[1]` Time to live, in seconds, of the DNS record. Must be between 60 and 86400, or 1 for 'automatic'. - `1` - `type: Optional[Literal["A", "AAAA", "CNAME", 15 more]]` DNS record type. - `"A"` - `"AAAA"` - `"CNAME"` - `"HTTPS"` - `"TXT"` - `"SRV"` - `"LOC"` - `"MX"` - `"NS"` - `"CERT"` - `"DNSKEY"` - `"DS"` - `"NAPTR"` - `"SMIMEA"` - `"SSHFP"` - `"SVCB"` - `"TLSA"` - `"URI"` - `record: Optional[List[DNSRecord]]` - `content: Optional[str]` DNS record content. - `name: Optional[str]` DNS record name (or @ for the zone apex). - `priority: Optional[float]` Required for MX, SRV and URI records. Unused by other record types. Records with lower priorities are preferred. - `ttl: Optional[Union[float, Literal[1], null]]` Time to live, in seconds, of the DNS record. Must be between 60 and 86400, or 1 for 'automatic'. - `type: Optional[Literal["A", "AAAA", "CNAME", 15 more]]` DNS record type. - `result_info: Optional[EmailEmailRoutingDNSQueryResponseResultInfo]` - `count: Optional[float]` Total number of results for the requested service. - `page: Optional[float]` Current page within paginated list of results. - `per_page: Optional[float]` Number of results per page of results. - `total_count: Optional[float]` Total results available without any search parameters. - `total_pages: Optional[float]` The number of total pages in the entire result set. - `class EmailDNSSettingsResponseCollection: …` - `errors: List[EmailDNSSettingsResponseCollectionError]` - `code: int` - `message: str` - `documentation_url: Optional[str]` - `source: Optional[EmailDNSSettingsResponseCollectionErrorSource]` - `pointer: Optional[str]` - `messages: List[EmailDNSSettingsResponseCollectionMessage]` - `code: int` - `message: str` - `documentation_url: Optional[str]` - `source: Optional[EmailDNSSettingsResponseCollectionMessageSource]` - `pointer: Optional[str]` - `success: Literal[true]` Whether the API call was successful. - `true` - `result: Optional[List[DNSRecord]]` - `content: Optional[str]` DNS record content. - `name: Optional[str]` DNS record name (or @ for the zone apex). - `priority: Optional[float]` Required for MX, SRV and URI records. Unused by other record types. Records with lower priorities are preferred. - `ttl: Optional[Union[float, Literal[1], null]]` Time to live, in seconds, of the DNS record. Must be between 60 and 86400, or 1 for 'automatic'. - `type: Optional[Literal["A", "AAAA", "CNAME", 15 more]]` DNS record type. - `result_info: Optional[EmailDNSSettingsResponseCollectionResultInfo]` - `count: Optional[float]` Total number of results for the requested service. - `page: Optional[float]` Current page within paginated list of results. - `per_page: Optional[float]` Number of results per page of results. - `total_count: Optional[float]` Total results available without any search parameters. - `total_pages: Optional[float]` The number of total pages in the entire result set. # Rules ## List routing rules `email_routing.rules.list(RuleListParams**kwargs) -> SyncV4PagePaginationArray[EmailRoutingRule]` **get** `/zones/{zone_id}/email/routing/rules` Lists existing routing rules. ### Parameters - `zone_id: str` Identifier. - `enabled: Optional[Literal[true, false]]` Filter by enabled routing rules. - `true` - `false` - `page: Optional[float]` Page number of paginated results. - `per_page: Optional[float]` Maximum number of results per page. ### Returns - `class EmailRoutingRule: …` - `id: Optional[str]` Routing rule identifier. - `actions: Optional[List[Action]]` List actions patterns. - `type: Literal["drop", "forward", "worker"]` Type of supported action. - `"drop"` - `"forward"` - `"worker"` - `value: Optional[List[str]]` - `enabled: Optional[Literal[true, false]]` Routing rule status. - `true` - `false` - `matchers: Optional[List[Matcher]]` Matching patterns to forward to your actions. - `type: Literal["all", "literal"]` Type of matcher. - `"all"` - `"literal"` - `field: Optional[Literal["to"]]` Field for type matcher. - `"to"` - `value: Optional[str]` Value for matcher. - `name: Optional[str]` Routing rule name. - `priority: Optional[float]` Priority of the routing rule. - `tag: Optional[str]` Routing rule tag. (Deprecated, replaced by routing rule identifier) ### Example ```python 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 ) page = client.email_routing.rules.list( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) page = page.result[0] print(page.id) ``` #### Response ```json { "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, "tag": "a7e6fb77503c41d8a7f3113c6918f10c" } ], "result_info": { "count": 1, "page": 1, "per_page": 20, "total_count": 1, "total_pages": 100 } } ``` ## Get routing rule `email_routing.rules.get(strrule_identifier, RuleGetParams**kwargs) -> EmailRoutingRule` **get** `/zones/{zone_id}/email/routing/rules/{rule_identifier}` Get information for a specific routing rule already created. ### Parameters - `zone_id: str` Identifier. - `rule_identifier: str` Routing rule identifier. ### Returns - `class EmailRoutingRule: …` - `id: Optional[str]` Routing rule identifier. - `actions: Optional[List[Action]]` List actions patterns. - `type: Literal["drop", "forward", "worker"]` Type of supported action. - `"drop"` - `"forward"` - `"worker"` - `value: Optional[List[str]]` - `enabled: Optional[Literal[true, false]]` Routing rule status. - `true` - `false` - `matchers: Optional[List[Matcher]]` Matching patterns to forward to your actions. - `type: Literal["all", "literal"]` Type of matcher. - `"all"` - `"literal"` - `field: Optional[Literal["to"]]` Field for type matcher. - `"to"` - `value: Optional[str]` Value for matcher. - `name: Optional[str]` Routing rule name. - `priority: Optional[float]` Priority of the routing rule. - `tag: Optional[str]` Routing rule tag. (Deprecated, replaced by routing rule identifier) ### Example ```python 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 ) email_routing_rule = client.email_routing.rules.get( rule_identifier="a7e6fb77503c41d8a7f3113c6918f10c", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) print(email_routing_rule.id) ``` #### Response ```json { "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, "tag": "a7e6fb77503c41d8a7f3113c6918f10c" } } ``` ## Create routing rule `email_routing.rules.create(RuleCreateParams**kwargs) -> EmailRoutingRule` **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). ### Parameters - `zone_id: str` Identifier. - `actions: Iterable[ActionParam]` List actions patterns. - `type: Literal["drop", "forward", "worker"]` Type of supported action. - `"drop"` - `"forward"` - `"worker"` - `value: Optional[List[str]]` - `matchers: Iterable[MatcherParam]` Matching patterns to forward to your actions. - `type: Literal["all", "literal"]` Type of matcher. - `"all"` - `"literal"` - `field: Optional[Literal["to"]]` Field for type matcher. - `"to"` - `value: Optional[str]` Value for matcher. - `enabled: Optional[Literal[true, false]]` Routing rule status. - `true` - `false` - `name: Optional[str]` Routing rule name. - `priority: Optional[float]` Priority of the routing rule. ### Returns - `class EmailRoutingRule: …` - `id: Optional[str]` Routing rule identifier. - `actions: Optional[List[Action]]` List actions patterns. - `type: Literal["drop", "forward", "worker"]` Type of supported action. - `"drop"` - `"forward"` - `"worker"` - `value: Optional[List[str]]` - `enabled: Optional[Literal[true, false]]` Routing rule status. - `true` - `false` - `matchers: Optional[List[Matcher]]` Matching patterns to forward to your actions. - `type: Literal["all", "literal"]` Type of matcher. - `"all"` - `"literal"` - `field: Optional[Literal["to"]]` Field for type matcher. - `"to"` - `value: Optional[str]` Value for matcher. - `name: Optional[str]` Routing rule name. - `priority: Optional[float]` Priority of the routing rule. - `tag: Optional[str]` Routing rule tag. (Deprecated, replaced by routing rule identifier) ### Example ```python 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 ) email_routing_rule = client.email_routing.rules.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", actions=[{ "type": "forward" }], matchers=[{ "type": "literal" }], ) print(email_routing_rule.id) ``` #### Response ```json { "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, "tag": "a7e6fb77503c41d8a7f3113c6918f10c" } } ``` ## Update routing rule `email_routing.rules.update(strrule_identifier, RuleUpdateParams**kwargs) -> EmailRoutingRule` **put** `/zones/{zone_id}/email/routing/rules/{rule_identifier}` Update actions and matches, or enable/disable specific routing rules. ### Parameters - `zone_id: str` Identifier. - `rule_identifier: str` Routing rule identifier. - `actions: Iterable[ActionParam]` List actions patterns. - `type: Literal["drop", "forward", "worker"]` Type of supported action. - `"drop"` - `"forward"` - `"worker"` - `value: Optional[List[str]]` - `matchers: Iterable[MatcherParam]` Matching patterns to forward to your actions. - `type: Literal["all", "literal"]` Type of matcher. - `"all"` - `"literal"` - `field: Optional[Literal["to"]]` Field for type matcher. - `"to"` - `value: Optional[str]` Value for matcher. - `enabled: Optional[Literal[true, false]]` Routing rule status. - `true` - `false` - `name: Optional[str]` Routing rule name. - `priority: Optional[float]` Priority of the routing rule. ### Returns - `class EmailRoutingRule: …` - `id: Optional[str]` Routing rule identifier. - `actions: Optional[List[Action]]` List actions patterns. - `type: Literal["drop", "forward", "worker"]` Type of supported action. - `"drop"` - `"forward"` - `"worker"` - `value: Optional[List[str]]` - `enabled: Optional[Literal[true, false]]` Routing rule status. - `true` - `false` - `matchers: Optional[List[Matcher]]` Matching patterns to forward to your actions. - `type: Literal["all", "literal"]` Type of matcher. - `"all"` - `"literal"` - `field: Optional[Literal["to"]]` Field for type matcher. - `"to"` - `value: Optional[str]` Value for matcher. - `name: Optional[str]` Routing rule name. - `priority: Optional[float]` Priority of the routing rule. - `tag: Optional[str]` Routing rule tag. (Deprecated, replaced by routing rule identifier) ### Example ```python 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 ) email_routing_rule = client.email_routing.rules.update( rule_identifier="a7e6fb77503c41d8a7f3113c6918f10c", zone_id="023e105f4ecef8ad9ca31a8372d0c353", actions=[{ "type": "forward" }], matchers=[{ "type": "literal" }], ) print(email_routing_rule.id) ``` #### Response ```json { "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, "tag": "a7e6fb77503c41d8a7f3113c6918f10c" } } ``` ## Delete routing rule `email_routing.rules.delete(strrule_identifier, RuleDeleteParams**kwargs) -> EmailRoutingRule` **delete** `/zones/{zone_id}/email/routing/rules/{rule_identifier}` Delete a specific routing rule. ### Parameters - `zone_id: str` Identifier. - `rule_identifier: str` Routing rule identifier. ### Returns - `class EmailRoutingRule: …` - `id: Optional[str]` Routing rule identifier. - `actions: Optional[List[Action]]` List actions patterns. - `type: Literal["drop", "forward", "worker"]` Type of supported action. - `"drop"` - `"forward"` - `"worker"` - `value: Optional[List[str]]` - `enabled: Optional[Literal[true, false]]` Routing rule status. - `true` - `false` - `matchers: Optional[List[Matcher]]` Matching patterns to forward to your actions. - `type: Literal["all", "literal"]` Type of matcher. - `"all"` - `"literal"` - `field: Optional[Literal["to"]]` Field for type matcher. - `"to"` - `value: Optional[str]` Value for matcher. - `name: Optional[str]` Routing rule name. - `priority: Optional[float]` Priority of the routing rule. - `tag: Optional[str]` Routing rule tag. (Deprecated, replaced by routing rule identifier) ### Example ```python 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 ) email_routing_rule = client.email_routing.rules.delete( rule_identifier="a7e6fb77503c41d8a7f3113c6918f10c", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) print(email_routing_rule.id) ``` #### Response ```json { "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, "tag": "a7e6fb77503c41d8a7f3113c6918f10c" } } ``` ## Domain Types ### Action - `class Action: …` Actions pattern. - `type: Literal["drop", "forward", "worker"]` Type of supported action. - `"drop"` - `"forward"` - `"worker"` - `value: Optional[List[str]]` ### Email Routing Rule - `class EmailRoutingRule: …` - `id: Optional[str]` Routing rule identifier. - `actions: Optional[List[Action]]` List actions patterns. - `type: Literal["drop", "forward", "worker"]` Type of supported action. - `"drop"` - `"forward"` - `"worker"` - `value: Optional[List[str]]` - `enabled: Optional[Literal[true, false]]` Routing rule status. - `true` - `false` - `matchers: Optional[List[Matcher]]` Matching patterns to forward to your actions. - `type: Literal["all", "literal"]` Type of matcher. - `"all"` - `"literal"` - `field: Optional[Literal["to"]]` Field for type matcher. - `"to"` - `value: Optional[str]` Value for matcher. - `name: Optional[str]` Routing rule name. - `priority: Optional[float]` Priority of the routing rule. - `tag: Optional[str]` Routing rule tag. (Deprecated, replaced by routing rule identifier) ### Matcher - `class Matcher: …` Matching pattern to forward your actions. - `type: Literal["all", "literal"]` Type of matcher. - `"all"` - `"literal"` - `field: Optional[Literal["to"]]` Field for type matcher. - `"to"` - `value: Optional[str]` Value for matcher. # Catch Alls ## 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. ### Parameters - `zone_id: str` Identifier. ### Returns - `class CatchAllGetResponse: …` - `id: Optional[str]` Routing rule identifier. - `actions: Optional[List[CatchAllAction]]` List actions for the catch-all routing rule. - `type: Literal["drop", "forward", "worker"]` Type of action for catch-all rule. - `"drop"` - `"forward"` - `"worker"` - `value: Optional[List[str]]` - `enabled: Optional[Literal[true, false]]` Routing rule status. - `true` - `false` - `matchers: Optional[List[CatchAllMatcher]]` List of matchers for the catch-all routing rule. - `type: Literal["all"]` Type of matcher. Default is 'all'. - `"all"` - `name: Optional[str]` Routing rule name. - `tag: Optional[str]` Routing rule tag. (Deprecated, replaced by routing rule identifier) ### Example ```python 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) ``` #### Response ```json { "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" } } ``` ## Update catch-all rule `email_routing.rules.catch_alls.update(CatchAllUpdateParams**kwargs) -> CatchAllUpdateResponse` **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. ### Parameters - `zone_id: str` Identifier. - `actions: Iterable[CatchAllActionParam]` List actions for the catch-all routing rule. - `type: Literal["drop", "forward", "worker"]` Type of action for catch-all rule. - `"drop"` - `"forward"` - `"worker"` - `value: Optional[List[str]]` - `matchers: Iterable[CatchAllMatcherParam]` List of matchers for the catch-all routing rule. - `type: Literal["all"]` Type of matcher. Default is 'all'. - `"all"` - `enabled: Optional[Literal[true, false]]` Routing rule status. - `true` - `false` - `name: Optional[str]` Routing rule name. ### Returns - `class CatchAllUpdateResponse: …` - `id: Optional[str]` Routing rule identifier. - `actions: Optional[List[CatchAllAction]]` List actions for the catch-all routing rule. - `type: Literal["drop", "forward", "worker"]` Type of action for catch-all rule. - `"drop"` - `"forward"` - `"worker"` - `value: Optional[List[str]]` - `enabled: Optional[Literal[true, false]]` Routing rule status. - `true` - `false` - `matchers: Optional[List[CatchAllMatcher]]` List of matchers for the catch-all routing rule. - `type: Literal["all"]` Type of matcher. Default is 'all'. - `"all"` - `name: Optional[str]` Routing rule name. - `tag: Optional[str]` Routing rule tag. (Deprecated, replaced by routing rule identifier) ### Example ```python 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.update( zone_id="023e105f4ecef8ad9ca31a8372d0c353", actions=[{ "type": "forward" }], matchers=[{ "type": "all" }], ) print(catch_all.id) ``` #### Response ```json { "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" } } ``` ## Domain Types ### Catch All Action - `class CatchAllAction: …` Action for the catch-all routing rule. - `type: Literal["drop", "forward", "worker"]` Type of action for catch-all rule. - `"drop"` - `"forward"` - `"worker"` - `value: Optional[List[str]]` ### Catch All Matcher - `class CatchAllMatcher: …` Matcher for catch-all routing rule. - `type: Literal["all"]` Type of matcher. Default is 'all'. - `"all"` ### Catch All Get Response - `class CatchAllGetResponse: …` - `id: Optional[str]` Routing rule identifier. - `actions: Optional[List[CatchAllAction]]` List actions for the catch-all routing rule. - `type: Literal["drop", "forward", "worker"]` Type of action for catch-all rule. - `"drop"` - `"forward"` - `"worker"` - `value: Optional[List[str]]` - `enabled: Optional[Literal[true, false]]` Routing rule status. - `true` - `false` - `matchers: Optional[List[CatchAllMatcher]]` List of matchers for the catch-all routing rule. - `type: Literal["all"]` Type of matcher. Default is 'all'. - `"all"` - `name: Optional[str]` Routing rule name. - `tag: Optional[str]` Routing rule tag. (Deprecated, replaced by routing rule identifier) ### Catch All Update Response - `class CatchAllUpdateResponse: …` - `id: Optional[str]` Routing rule identifier. - `actions: Optional[List[CatchAllAction]]` List actions for the catch-all routing rule. - `type: Literal["drop", "forward", "worker"]` Type of action for catch-all rule. - `"drop"` - `"forward"` - `"worker"` - `value: Optional[List[str]]` - `enabled: Optional[Literal[true, false]]` Routing rule status. - `true` - `false` - `matchers: Optional[List[CatchAllMatcher]]` List of matchers for the catch-all routing rule. - `type: Literal["all"]` Type of matcher. Default is 'all'. - `"all"` - `name: Optional[str]` Routing rule name. - `tag: Optional[str]` Routing rule tag. (Deprecated, replaced by routing rule identifier) # Addresses ## List destination addresses `email_routing.addresses.list(AddressListParams**kwargs) -> SyncV4PagePaginationArray[Address]` **get** `/accounts/{account_id}/email/routing/addresses` Lists existing destination addresses. ### Parameters - `account_id: str` Identifier. - `direction: Optional[Literal["asc", "desc"]]` Sorts results in an ascending or descending order. - `"asc"` - `"desc"` - `page: Optional[float]` Page number of paginated results. - `per_page: Optional[float]` Maximum number of results per page. - `verified: Optional[Literal[true, false]]` Filter by verified destination addresses. - `true` - `false` ### Returns - `class Address: …` - `id: Optional[str]` Destination address identifier. - `created: Optional[datetime]` The date and time the destination address has been created. - `email: Optional[str]` The contact email address of the user. - `modified: Optional[datetime]` The date and time the destination address was last modified. - `tag: Optional[str]` Destination address tag. (Deprecated, replaced by destination address identifier) - `verified: Optional[datetime]` The date and time the destination address has been verified. Null means not verified yet. ### Example ```python 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 ) page = client.email_routing.addresses.list( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) page = page.result[0] print(page.id) ``` #### Response ```json { "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": "ea95132c15732412d22c1476fa83f27a", "created": "2014-01-02T02:20:00Z", "email": "user@example.com", "modified": "2014-01-02T02:20:00Z", "tag": "ea95132c15732412d22c1476fa83f27a", "verified": "2014-01-02T02:20:00Z" } ], "result_info": { "count": 1, "page": 1, "per_page": 20, "total_count": 1, "total_pages": 100 } } ``` ## Get a destination address `email_routing.addresses.get(strdestination_address_identifier, AddressGetParams**kwargs) -> Address` **get** `/accounts/{account_id}/email/routing/addresses/{destination_address_identifier}` Gets information for a specific destination email already created. ### Parameters - `account_id: str` Identifier. - `destination_address_identifier: str` Destination address identifier. ### Returns - `class Address: …` - `id: Optional[str]` Destination address identifier. - `created: Optional[datetime]` The date and time the destination address has been created. - `email: Optional[str]` The contact email address of the user. - `modified: Optional[datetime]` The date and time the destination address was last modified. - `tag: Optional[str]` Destination address tag. (Deprecated, replaced by destination address identifier) - `verified: Optional[datetime]` The date and time the destination address has been verified. Null means not verified yet. ### Example ```python 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 ) address = client.email_routing.addresses.get( destination_address_identifier="ea95132c15732412d22c1476fa83f27a", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) print(address.id) ``` #### Response ```json { "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": "ea95132c15732412d22c1476fa83f27a", "created": "2014-01-02T02:20:00Z", "email": "user@example.com", "modified": "2014-01-02T02:20:00Z", "tag": "ea95132c15732412d22c1476fa83f27a", "verified": "2014-01-02T02:20:00Z" } } ``` ## Create a destination address `email_routing.addresses.create(AddressCreateParams**kwargs) -> Address` **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. ### Parameters - `account_id: str` Identifier. - `email: str` The contact email address of the user. ### Returns - `class Address: …` - `id: Optional[str]` Destination address identifier. - `created: Optional[datetime]` The date and time the destination address has been created. - `email: Optional[str]` The contact email address of the user. - `modified: Optional[datetime]` The date and time the destination address was last modified. - `tag: Optional[str]` Destination address tag. (Deprecated, replaced by destination address identifier) - `verified: Optional[datetime]` The date and time the destination address has been verified. Null means not verified yet. ### Example ```python 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 ) address = client.email_routing.addresses.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", email="user@example.com", ) print(address.id) ``` #### Response ```json { "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": "ea95132c15732412d22c1476fa83f27a", "created": "2014-01-02T02:20:00Z", "email": "user@example.com", "modified": "2014-01-02T02:20:00Z", "tag": "ea95132c15732412d22c1476fa83f27a", "verified": "2014-01-02T02:20:00Z" } } ``` ## Delete destination address `email_routing.addresses.delete(strdestination_address_identifier, AddressDeleteParams**kwargs) -> Address` **delete** `/accounts/{account_id}/email/routing/addresses/{destination_address_identifier}` Deletes a specific destination address. ### Parameters - `account_id: str` Identifier. - `destination_address_identifier: str` Destination address identifier. ### Returns - `class Address: …` - `id: Optional[str]` Destination address identifier. - `created: Optional[datetime]` The date and time the destination address has been created. - `email: Optional[str]` The contact email address of the user. - `modified: Optional[datetime]` The date and time the destination address was last modified. - `tag: Optional[str]` Destination address tag. (Deprecated, replaced by destination address identifier) - `verified: Optional[datetime]` The date and time the destination address has been verified. Null means not verified yet. ### Example ```python 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 ) address = client.email_routing.addresses.delete( destination_address_identifier="ea95132c15732412d22c1476fa83f27a", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) print(address.id) ``` #### Response ```json { "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": "ea95132c15732412d22c1476fa83f27a", "created": "2014-01-02T02:20:00Z", "email": "user@example.com", "modified": "2014-01-02T02:20:00Z", "tag": "ea95132c15732412d22c1476fa83f27a", "verified": "2014-01-02T02:20:00Z" } } ``` ## Domain Types ### Address - `class Address: …` - `id: Optional[str]` Destination address identifier. - `created: Optional[datetime]` The date and time the destination address has been created. - `email: Optional[str]` The contact email address of the user. - `modified: Optional[datetime]` The date and time the destination address was last modified. - `tag: Optional[str]` Destination address tag. (Deprecated, replaced by destination address identifier) - `verified: Optional[datetime]` The date and time the destination address has been verified. Null means not verified yet.