# Settings # Allow Policies ## List email allow policies `email_security.settings.allow_policies.list(AllowPolicyListParams**kwargs) -> SyncV4PagePaginationArray[AllowPolicyListResponse]` **get** `/accounts/{account_id}/email-security/settings/allow_policies` Lists, searches, and sorts an account’s email allow policies. ### Parameters - `account_id: str` Account Identifier - `direction: Optional[Literal["asc", "desc"]]` The sorting direction. - `"asc"` - `"desc"` - `is_acceptable_sender: Optional[bool]` - `is_exempt_recipient: Optional[bool]` - `is_recipient: Optional[bool]` - `is_sender: Optional[bool]` - `is_spoof: Optional[bool]` - `is_trusted_sender: Optional[bool]` - `order: Optional[Literal["pattern", "created_at"]]` The field to sort by. - `"pattern"` - `"created_at"` - `page: Optional[int]` The page number of paginated results. - `pattern: Optional[str]` - `pattern_type: Optional[Literal["EMAIL", "DOMAIN", "IP", "UNKNOWN"]]` - `"EMAIL"` - `"DOMAIN"` - `"IP"` - `"UNKNOWN"` - `per_page: Optional[int]` The number of results per page. - `search: Optional[str]` Allows searching in multiple properties of a record simultaneously. This parameter is intended for human users, not automation. Its exact behavior is intentionally left unspecified and is subject to change in the future. - `verify_sender: Optional[bool]` ### Returns - `class AllowPolicyListResponse: …` - `id: int` The unique identifier for the allow policy. - `created_at: datetime` - `is_acceptable_sender: bool` Messages from this sender will be exempted from Spam, Spoof and Bulk dispositions. Note: This will not exempt messages with Malicious or Suspicious dispositions. - `is_exempt_recipient: bool` Messages to this recipient will bypass all detections. - `is_regex: bool` - `is_trusted_sender: bool` Messages from this sender will bypass all detections and link following. - `last_modified: datetime` - `pattern: str` - `pattern_type: Literal["EMAIL", "DOMAIN", "IP", "UNKNOWN"]` - `"EMAIL"` - `"DOMAIN"` - `"IP"` - `"UNKNOWN"` - `verify_sender: bool` Enforce DMARC, SPF or DKIM authentication. When on, Email Security only honors policies that pass authentication. - `comments: Optional[str]` - `is_recipient: Optional[bool]` - `is_sender: Optional[bool]` - `is_spoof: Optional[bool]` ### 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_security.settings.allow_policies.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" } } ], "result": [ { "id": 2401, "created_at": "2019-12-27T18:11:19.117Z", "is_acceptable_sender": true, "is_exempt_recipient": true, "is_regex": true, "is_trusted_sender": true, "last_modified": "2019-12-27T18:11:19.117Z", "pattern": "x", "pattern_type": "EMAIL", "verify_sender": true, "comments": "comments", "is_recipient": true, "is_sender": true, "is_spoof": true } ], "result_info": { "count": 1, "page": 1, "per_page": 20, "total_count": 2000 }, "success": true } ``` ## Get an email allow policy `email_security.settings.allow_policies.get(intpolicy_id, AllowPolicyGetParams**kwargs) -> AllowPolicyGetResponse` **get** `/accounts/{account_id}/email-security/settings/allow_policies/{policy_id}` Retrieves details for a specific email allow policy, including its matching criteria and scope. ### Parameters - `account_id: str` Account Identifier - `policy_id: int` The unique identifier for the allow policy. ### Returns - `class AllowPolicyGetResponse: …` - `id: int` The unique identifier for the allow policy. - `created_at: datetime` - `is_acceptable_sender: bool` Messages from this sender will be exempted from Spam, Spoof and Bulk dispositions. Note: This will not exempt messages with Malicious or Suspicious dispositions. - `is_exempt_recipient: bool` Messages to this recipient will bypass all detections. - `is_regex: bool` - `is_trusted_sender: bool` Messages from this sender will bypass all detections and link following. - `last_modified: datetime` - `pattern: str` - `pattern_type: Literal["EMAIL", "DOMAIN", "IP", "UNKNOWN"]` - `"EMAIL"` - `"DOMAIN"` - `"IP"` - `"UNKNOWN"` - `verify_sender: bool` Enforce DMARC, SPF or DKIM authentication. When on, Email Security only honors policies that pass authentication. - `comments: Optional[str]` - `is_recipient: Optional[bool]` - `is_sender: Optional[bool]` - `is_spoof: Optional[bool]` ### 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 ) allow_policy = client.email_security.settings.allow_policies.get( policy_id=2401, account_id="023e105f4ecef8ad9ca31a8372d0c353", ) print(allow_policy.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" } } ], "result": { "id": 2401, "created_at": "2019-12-27T18:11:19.117Z", "is_acceptable_sender": true, "is_exempt_recipient": true, "is_regex": true, "is_trusted_sender": true, "last_modified": "2019-12-27T18:11:19.117Z", "pattern": "x", "pattern_type": "EMAIL", "verify_sender": true, "comments": "comments", "is_recipient": true, "is_sender": true, "is_spoof": true }, "success": true } ``` ## Create an email allow policy `email_security.settings.allow_policies.create(AllowPolicyCreateParams**kwargs) -> AllowPolicyCreateResponse` **post** `/accounts/{account_id}/email-security/settings/allow_policies` Creates a new email allow policy that permits specific senders, domains, or patterns to bypass security scanning. ### Parameters - `account_id: str` Account Identifier - `is_acceptable_sender: bool` Messages from this sender will be exempted from Spam, Spoof and Bulk dispositions. Note: This will not exempt messages with Malicious or Suspicious dispositions. - `is_exempt_recipient: bool` Messages to this recipient will bypass all detections. - `is_regex: bool` - `is_trusted_sender: bool` Messages from this sender will bypass all detections and link following. - `pattern: str` - `pattern_type: Literal["EMAIL", "DOMAIN", "IP", "UNKNOWN"]` - `"EMAIL"` - `"DOMAIN"` - `"IP"` - `"UNKNOWN"` - `verify_sender: bool` Enforce DMARC, SPF or DKIM authentication. When on, Email Security only honors policies that pass authentication. - `comments: Optional[str]` - `is_recipient: Optional[bool]` - `is_sender: Optional[bool]` - `is_spoof: Optional[bool]` ### Returns - `class AllowPolicyCreateResponse: …` - `id: int` The unique identifier for the allow policy. - `created_at: datetime` - `is_acceptable_sender: bool` Messages from this sender will be exempted from Spam, Spoof and Bulk dispositions. Note: This will not exempt messages with Malicious or Suspicious dispositions. - `is_exempt_recipient: bool` Messages to this recipient will bypass all detections. - `is_regex: bool` - `is_trusted_sender: bool` Messages from this sender will bypass all detections and link following. - `last_modified: datetime` - `pattern: str` - `pattern_type: Literal["EMAIL", "DOMAIN", "IP", "UNKNOWN"]` - `"EMAIL"` - `"DOMAIN"` - `"IP"` - `"UNKNOWN"` - `verify_sender: bool` Enforce DMARC, SPF or DKIM authentication. When on, Email Security only honors policies that pass authentication. - `comments: Optional[str]` - `is_recipient: Optional[bool]` - `is_sender: Optional[bool]` - `is_spoof: Optional[bool]` ### 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 ) allow_policy = client.email_security.settings.allow_policies.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", is_acceptable_sender=False, is_exempt_recipient=False, is_regex=False, is_trusted_sender=True, pattern="test@example.com", pattern_type="EMAIL", verify_sender=True, ) print(allow_policy.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" } } ], "result": { "id": 2401, "created_at": "2019-12-27T18:11:19.117Z", "is_acceptable_sender": true, "is_exempt_recipient": true, "is_regex": true, "is_trusted_sender": true, "last_modified": "2019-12-27T18:11:19.117Z", "pattern": "x", "pattern_type": "EMAIL", "verify_sender": true, "comments": "comments", "is_recipient": true, "is_sender": true, "is_spoof": true }, "success": true } ``` ## Update an email allow policy `email_security.settings.allow_policies.edit(intpolicy_id, AllowPolicyEditParams**kwargs) -> AllowPolicyEditResponse` **patch** `/accounts/{account_id}/email-security/settings/allow_policies/{policy_id}` Updates an existing email allow policy, modifying its matching criteria or scope. ### Parameters - `account_id: str` Account Identifier - `policy_id: int` The unique identifier for the allow policy. - `comments: Optional[str]` - `is_acceptable_sender: Optional[bool]` Messages from this sender will be exempted from Spam, Spoof and Bulk dispositions. Note: This will not exempt messages with Malicious or Suspicious dispositions. - `is_exempt_recipient: Optional[bool]` Messages to this recipient will bypass all detections. - `is_regex: Optional[bool]` - `is_trusted_sender: Optional[bool]` Messages from this sender will bypass all detections and link following. - `pattern: Optional[str]` - `pattern_type: Optional[Literal["EMAIL", "DOMAIN", "IP", "UNKNOWN"]]` - `"EMAIL"` - `"DOMAIN"` - `"IP"` - `"UNKNOWN"` - `verify_sender: Optional[bool]` Enforce DMARC, SPF or DKIM authentication. When on, Email Security only honors policies that pass authentication. ### Returns - `class AllowPolicyEditResponse: …` - `id: int` The unique identifier for the allow policy. - `created_at: datetime` - `is_acceptable_sender: bool` Messages from this sender will be exempted from Spam, Spoof and Bulk dispositions. Note: This will not exempt messages with Malicious or Suspicious dispositions. - `is_exempt_recipient: bool` Messages to this recipient will bypass all detections. - `is_regex: bool` - `is_trusted_sender: bool` Messages from this sender will bypass all detections and link following. - `last_modified: datetime` - `pattern: str` - `pattern_type: Literal["EMAIL", "DOMAIN", "IP", "UNKNOWN"]` - `"EMAIL"` - `"DOMAIN"` - `"IP"` - `"UNKNOWN"` - `verify_sender: bool` Enforce DMARC, SPF or DKIM authentication. When on, Email Security only honors policies that pass authentication. - `comments: Optional[str]` - `is_recipient: Optional[bool]` - `is_sender: Optional[bool]` - `is_spoof: Optional[bool]` ### 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 ) response = client.email_security.settings.allow_policies.edit( policy_id=2401, account_id="023e105f4ecef8ad9ca31a8372d0c353", ) print(response.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" } } ], "result": { "id": 2401, "created_at": "2019-12-27T18:11:19.117Z", "is_acceptable_sender": true, "is_exempt_recipient": true, "is_regex": true, "is_trusted_sender": true, "last_modified": "2019-12-27T18:11:19.117Z", "pattern": "x", "pattern_type": "EMAIL", "verify_sender": true, "comments": "comments", "is_recipient": true, "is_sender": true, "is_spoof": true }, "success": true } ``` ## Delete an email allow policy `email_security.settings.allow_policies.delete(intpolicy_id, AllowPolicyDeleteParams**kwargs) -> AllowPolicyDeleteResponse` **delete** `/accounts/{account_id}/email-security/settings/allow_policies/{policy_id}` Removes an email allow policy. Previously allowed senders will be subject to normal security scanning. ### Parameters - `account_id: str` Account Identifier - `policy_id: int` The unique identifier for the allow policy. ### Returns - `class AllowPolicyDeleteResponse: …` - `id: int` The unique identifier for the allow policy. ### 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 ) allow_policy = client.email_security.settings.allow_policies.delete( policy_id=2401, account_id="023e105f4ecef8ad9ca31a8372d0c353", ) print(allow_policy.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" } } ], "result": { "id": 2401 }, "success": true } ``` ## Domain Types ### Allow Policy List Response - `class AllowPolicyListResponse: …` - `id: int` The unique identifier for the allow policy. - `created_at: datetime` - `is_acceptable_sender: bool` Messages from this sender will be exempted from Spam, Spoof and Bulk dispositions. Note: This will not exempt messages with Malicious or Suspicious dispositions. - `is_exempt_recipient: bool` Messages to this recipient will bypass all detections. - `is_regex: bool` - `is_trusted_sender: bool` Messages from this sender will bypass all detections and link following. - `last_modified: datetime` - `pattern: str` - `pattern_type: Literal["EMAIL", "DOMAIN", "IP", "UNKNOWN"]` - `"EMAIL"` - `"DOMAIN"` - `"IP"` - `"UNKNOWN"` - `verify_sender: bool` Enforce DMARC, SPF or DKIM authentication. When on, Email Security only honors policies that pass authentication. - `comments: Optional[str]` - `is_recipient: Optional[bool]` - `is_sender: Optional[bool]` - `is_spoof: Optional[bool]` ### Allow Policy Get Response - `class AllowPolicyGetResponse: …` - `id: int` The unique identifier for the allow policy. - `created_at: datetime` - `is_acceptable_sender: bool` Messages from this sender will be exempted from Spam, Spoof and Bulk dispositions. Note: This will not exempt messages with Malicious or Suspicious dispositions. - `is_exempt_recipient: bool` Messages to this recipient will bypass all detections. - `is_regex: bool` - `is_trusted_sender: bool` Messages from this sender will bypass all detections and link following. - `last_modified: datetime` - `pattern: str` - `pattern_type: Literal["EMAIL", "DOMAIN", "IP", "UNKNOWN"]` - `"EMAIL"` - `"DOMAIN"` - `"IP"` - `"UNKNOWN"` - `verify_sender: bool` Enforce DMARC, SPF or DKIM authentication. When on, Email Security only honors policies that pass authentication. - `comments: Optional[str]` - `is_recipient: Optional[bool]` - `is_sender: Optional[bool]` - `is_spoof: Optional[bool]` ### Allow Policy Create Response - `class AllowPolicyCreateResponse: …` - `id: int` The unique identifier for the allow policy. - `created_at: datetime` - `is_acceptable_sender: bool` Messages from this sender will be exempted from Spam, Spoof and Bulk dispositions. Note: This will not exempt messages with Malicious or Suspicious dispositions. - `is_exempt_recipient: bool` Messages to this recipient will bypass all detections. - `is_regex: bool` - `is_trusted_sender: bool` Messages from this sender will bypass all detections and link following. - `last_modified: datetime` - `pattern: str` - `pattern_type: Literal["EMAIL", "DOMAIN", "IP", "UNKNOWN"]` - `"EMAIL"` - `"DOMAIN"` - `"IP"` - `"UNKNOWN"` - `verify_sender: bool` Enforce DMARC, SPF or DKIM authentication. When on, Email Security only honors policies that pass authentication. - `comments: Optional[str]` - `is_recipient: Optional[bool]` - `is_sender: Optional[bool]` - `is_spoof: Optional[bool]` ### Allow Policy Edit Response - `class AllowPolicyEditResponse: …` - `id: int` The unique identifier for the allow policy. - `created_at: datetime` - `is_acceptable_sender: bool` Messages from this sender will be exempted from Spam, Spoof and Bulk dispositions. Note: This will not exempt messages with Malicious or Suspicious dispositions. - `is_exempt_recipient: bool` Messages to this recipient will bypass all detections. - `is_regex: bool` - `is_trusted_sender: bool` Messages from this sender will bypass all detections and link following. - `last_modified: datetime` - `pattern: str` - `pattern_type: Literal["EMAIL", "DOMAIN", "IP", "UNKNOWN"]` - `"EMAIL"` - `"DOMAIN"` - `"IP"` - `"UNKNOWN"` - `verify_sender: bool` Enforce DMARC, SPF or DKIM authentication. When on, Email Security only honors policies that pass authentication. - `comments: Optional[str]` - `is_recipient: Optional[bool]` - `is_sender: Optional[bool]` - `is_spoof: Optional[bool]` ### Allow Policy Delete Response - `class AllowPolicyDeleteResponse: …` - `id: int` The unique identifier for the allow policy. # Block Senders ## List blocked email senders `email_security.settings.block_senders.list(BlockSenderListParams**kwargs) -> SyncV4PagePaginationArray[BlockSenderListResponse]` **get** `/accounts/{account_id}/email-security/settings/block_senders` Lists all blocked sender entries with their patterns and block reasons. ### Parameters - `account_id: str` Account Identifier - `direction: Optional[Literal["asc", "desc"]]` The sorting direction. - `"asc"` - `"desc"` - `order: Optional[Literal["pattern", "created_at"]]` The field to sort by. - `"pattern"` - `"created_at"` - `page: Optional[int]` The page number of paginated results. - `pattern: Optional[str]` - `pattern_type: Optional[Literal["EMAIL", "DOMAIN", "IP", "UNKNOWN"]]` - `"EMAIL"` - `"DOMAIN"` - `"IP"` - `"UNKNOWN"` - `per_page: Optional[int]` The number of results per page. - `search: Optional[str]` Allows searching in multiple properties of a record simultaneously. This parameter is intended for human users, not automation. Its exact behavior is intentionally left unspecified and is subject to change in the future. ### Returns - `class BlockSenderListResponse: …` - `id: int` The unique identifier for the allow policy. - `created_at: datetime` - `is_regex: bool` - `last_modified: datetime` - `pattern: str` - `pattern_type: Literal["EMAIL", "DOMAIN", "IP", "UNKNOWN"]` - `"EMAIL"` - `"DOMAIN"` - `"IP"` - `"UNKNOWN"` - `comments: Optional[str]` ### 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_security.settings.block_senders.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" } } ], "result": [ { "id": 2402, "created_at": "2019-12-27T18:11:19.117Z", "is_regex": true, "last_modified": "2019-12-27T18:11:19.117Z", "pattern": "x", "pattern_type": "EMAIL", "comments": "comments" } ], "result_info": { "count": 1, "page": 1, "per_page": 20, "total_count": 2000 }, "success": true } ``` ## Get a blocked email sender `email_security.settings.block_senders.get(intpattern_id, BlockSenderGetParams**kwargs) -> BlockSenderGetResponse` **get** `/accounts/{account_id}/email-security/settings/block_senders/{pattern_id}` Gets information about a specific blocked sender entry, including the pattern and block reason. ### Parameters - `account_id: str` Account Identifier - `pattern_id: int` The unique identifier for the allow policy. ### Returns - `class BlockSenderGetResponse: …` - `id: int` The unique identifier for the allow policy. - `created_at: datetime` - `is_regex: bool` - `last_modified: datetime` - `pattern: str` - `pattern_type: Literal["EMAIL", "DOMAIN", "IP", "UNKNOWN"]` - `"EMAIL"` - `"DOMAIN"` - `"IP"` - `"UNKNOWN"` - `comments: Optional[str]` ### 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 ) block_sender = client.email_security.settings.block_senders.get( pattern_id=2402, account_id="023e105f4ecef8ad9ca31a8372d0c353", ) print(block_sender.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" } } ], "result": { "id": 2402, "created_at": "2019-12-27T18:11:19.117Z", "is_regex": true, "last_modified": "2019-12-27T18:11:19.117Z", "pattern": "x", "pattern_type": "EMAIL", "comments": "comments" }, "success": true } ``` ## Create a blocked email sender `email_security.settings.block_senders.create(BlockSenderCreateParams**kwargs) -> BlockSenderCreateResponse` **post** `/accounts/{account_id}/email-security/settings/block_senders` Adds a sender pattern to the email block list, preventing messages from matching senders from being delivered. ### Parameters - `account_id: str` Account Identifier - `is_regex: bool` - `pattern: str` - `pattern_type: Literal["EMAIL", "DOMAIN", "IP", "UNKNOWN"]` - `"EMAIL"` - `"DOMAIN"` - `"IP"` - `"UNKNOWN"` - `comments: Optional[str]` ### Returns - `class BlockSenderCreateResponse: …` - `id: int` The unique identifier for the allow policy. - `created_at: datetime` - `is_regex: bool` - `last_modified: datetime` - `pattern: str` - `pattern_type: Literal["EMAIL", "DOMAIN", "IP", "UNKNOWN"]` - `"EMAIL"` - `"DOMAIN"` - `"IP"` - `"UNKNOWN"` - `comments: Optional[str]` ### 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 ) block_sender = client.email_security.settings.block_senders.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", is_regex=False, pattern="test@example.com", pattern_type="EMAIL", ) print(block_sender.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" } } ], "result": { "id": 2402, "created_at": "2019-12-27T18:11:19.117Z", "is_regex": true, "last_modified": "2019-12-27T18:11:19.117Z", "pattern": "x", "pattern_type": "EMAIL", "comments": "comments" }, "success": true } ``` ## Update a blocked email sender `email_security.settings.block_senders.edit(intpattern_id, BlockSenderEditParams**kwargs) -> BlockSenderEditResponse` **patch** `/accounts/{account_id}/email-security/settings/block_senders/{pattern_id}` Modifies a blocked sender entry, updating its pattern or block reason. ### Parameters - `account_id: str` Account Identifier - `pattern_id: int` The unique identifier for the allow policy. - `comments: Optional[str]` - `is_regex: Optional[bool]` - `pattern: Optional[str]` - `pattern_type: Optional[Literal["EMAIL", "DOMAIN", "IP", "UNKNOWN"]]` - `"EMAIL"` - `"DOMAIN"` - `"IP"` - `"UNKNOWN"` ### Returns - `class BlockSenderEditResponse: …` - `id: int` The unique identifier for the allow policy. - `created_at: datetime` - `is_regex: bool` - `last_modified: datetime` - `pattern: str` - `pattern_type: Literal["EMAIL", "DOMAIN", "IP", "UNKNOWN"]` - `"EMAIL"` - `"DOMAIN"` - `"IP"` - `"UNKNOWN"` - `comments: Optional[str]` ### 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 ) response = client.email_security.settings.block_senders.edit( pattern_id=2402, account_id="023e105f4ecef8ad9ca31a8372d0c353", ) print(response.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" } } ], "result": { "id": 2402, "created_at": "2019-12-27T18:11:19.117Z", "is_regex": true, "last_modified": "2019-12-27T18:11:19.117Z", "pattern": "x", "pattern_type": "EMAIL", "comments": "comments" }, "success": true } ``` ## Delete a blocked email sender `email_security.settings.block_senders.delete(intpattern_id, BlockSenderDeleteParams**kwargs) -> BlockSenderDeleteResponse` **delete** `/accounts/{account_id}/email-security/settings/block_senders/{pattern_id}` Removes a sender from the email block list, allowing their messages to be delivered normally. ### Parameters - `account_id: str` Account Identifier - `pattern_id: int` The unique identifier for the allow policy. ### Returns - `class BlockSenderDeleteResponse: …` - `id: int` The unique identifier for the allow policy. ### 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 ) block_sender = client.email_security.settings.block_senders.delete( pattern_id=2402, account_id="023e105f4ecef8ad9ca31a8372d0c353", ) print(block_sender.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" } } ], "result": { "id": 2402 }, "success": true } ``` ## Domain Types ### Block Sender List Response - `class BlockSenderListResponse: …` - `id: int` The unique identifier for the allow policy. - `created_at: datetime` - `is_regex: bool` - `last_modified: datetime` - `pattern: str` - `pattern_type: Literal["EMAIL", "DOMAIN", "IP", "UNKNOWN"]` - `"EMAIL"` - `"DOMAIN"` - `"IP"` - `"UNKNOWN"` - `comments: Optional[str]` ### Block Sender Get Response - `class BlockSenderGetResponse: …` - `id: int` The unique identifier for the allow policy. - `created_at: datetime` - `is_regex: bool` - `last_modified: datetime` - `pattern: str` - `pattern_type: Literal["EMAIL", "DOMAIN", "IP", "UNKNOWN"]` - `"EMAIL"` - `"DOMAIN"` - `"IP"` - `"UNKNOWN"` - `comments: Optional[str]` ### Block Sender Create Response - `class BlockSenderCreateResponse: …` - `id: int` The unique identifier for the allow policy. - `created_at: datetime` - `is_regex: bool` - `last_modified: datetime` - `pattern: str` - `pattern_type: Literal["EMAIL", "DOMAIN", "IP", "UNKNOWN"]` - `"EMAIL"` - `"DOMAIN"` - `"IP"` - `"UNKNOWN"` - `comments: Optional[str]` ### Block Sender Edit Response - `class BlockSenderEditResponse: …` - `id: int` The unique identifier for the allow policy. - `created_at: datetime` - `is_regex: bool` - `last_modified: datetime` - `pattern: str` - `pattern_type: Literal["EMAIL", "DOMAIN", "IP", "UNKNOWN"]` - `"EMAIL"` - `"DOMAIN"` - `"IP"` - `"UNKNOWN"` - `comments: Optional[str]` ### Block Sender Delete Response - `class BlockSenderDeleteResponse: …` - `id: int` The unique identifier for the allow policy. # Domains ## List protected email domains `email_security.settings.domains.list(DomainListParams**kwargs) -> SyncV4PagePaginationArray[DomainListResponse]` **get** `/accounts/{account_id}/email-security/settings/domains` Lists, searches, and sorts an account’s email domains. ### Parameters - `account_id: str` Account Identifier - `active_delivery_mode: Optional[Literal["DIRECT", "BCC", "JOURNAL", 2 more]]` Filters response to domains with the currently active delivery mode. - `"DIRECT"` - `"BCC"` - `"JOURNAL"` - `"API"` - `"RETRO_SCAN"` - `allowed_delivery_mode: Optional[Literal["DIRECT", "BCC", "JOURNAL", 2 more]]` Filters response to domains with the provided delivery mode. - `"DIRECT"` - `"BCC"` - `"JOURNAL"` - `"API"` - `"RETRO_SCAN"` - `direction: Optional[Literal["asc", "desc"]]` The sorting direction. - `"asc"` - `"desc"` - `domain: Optional[SequenceNotStr[str]]` Filters results by the provided domains, allowing for multiple occurrences. - `integration_id: Optional[str]` Filters response to domains with the provided integration ID. - `order: Optional[Literal["domain", "created_at"]]` The field to sort by. - `"domain"` - `"created_at"` - `page: Optional[int]` The page number of paginated results. - `per_page: Optional[int]` The number of results per page. - `search: Optional[str]` Allows searching in multiple properties of a record simultaneously. This parameter is intended for human users, not automation. Its exact behavior is intentionally left unspecified and is subject to change in the future. ### Returns - `class DomainListResponse: …` - `id: int` The unique identifier for the domain. - `allowed_delivery_modes: List[Literal["DIRECT", "BCC", "JOURNAL", 2 more]]` - `"DIRECT"` - `"BCC"` - `"JOURNAL"` - `"API"` - `"RETRO_SCAN"` - `created_at: datetime` - `domain: str` - `drop_dispositions: List[Literal["MALICIOUS", "MALICIOUS-BEC", "SUSPICIOUS", 7 more]]` - `"MALICIOUS"` - `"MALICIOUS-BEC"` - `"SUSPICIOUS"` - `"SPOOF"` - `"SPAM"` - `"BULK"` - `"ENCRYPTED"` - `"EXTERNAL"` - `"UNKNOWN"` - `"NONE"` - `ip_restrictions: List[str]` - `last_modified: datetime` - `lookback_hops: int` - `regions: List[Literal["GLOBAL", "AU", "DE", 2 more]]` - `"GLOBAL"` - `"AU"` - `"DE"` - `"IN"` - `"US"` - `transport: str` - `authorization: Optional[Authorization]` - `authorized: bool` - `timestamp: datetime` - `status_message: Optional[str]` - `dmarc_status: Optional[Literal["none", "good", "invalid"]]` - `"none"` - `"good"` - `"invalid"` - `emails_processed: Optional[EmailsProcessed]` - `timestamp: datetime` - `total_emails_processed: int` - `total_emails_processed_previous: int` - `folder: Optional[Literal["AllItems", "Inbox"]]` - `"AllItems"` - `"Inbox"` - `inbox_provider: Optional[Literal["Microsoft", "Google"]]` - `"Microsoft"` - `"Google"` - `integration_id: Optional[str]` - `o365_tenant_id: Optional[str]` - `require_tls_inbound: Optional[bool]` - `require_tls_outbound: Optional[bool]` - `spf_status: Optional[Literal["none", "good", "neutral", 2 more]]` - `"none"` - `"good"` - `"neutral"` - `"open"` - `"invalid"` ### 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_security.settings.domains.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" } } ], "result": [ { "id": 2400, "allowed_delivery_modes": [ "API" ], "created_at": "2023-11-14T22:13:20Z", "domain": "example.com", "drop_dispositions": [ "MALICIOUS", "SPAM" ], "ip_restrictions": [ "string" ], "last_modified": "2023-11-14T22:13:20Z", "lookback_hops": 2, "regions": [ "GLOBAL" ], "transport": "example.com", "authorization": { "authorized": true, "timestamp": "2019-12-27T18:11:19.117Z", "status_message": "status_message" }, "dmarc_status": "good", "emails_processed": { "timestamp": "2019-12-27T18:11:19.117Z", "total_emails_processed": 0, "total_emails_processed_previous": 0 }, "folder": "Inbox", "inbox_provider": "Microsoft", "integration_id": "a5dbb180-60ea-4578-84bb-d01a5d4e50c3", "o365_tenant_id": "c3c3239d-8858-47df-9618-0e2d9bdf6aa8", "require_tls_inbound": false, "require_tls_outbound": true, "spf_status": "good" } ], "result_info": { "count": 1, "page": 1, "per_page": 20, "total_count": 2000 }, "success": true } ``` ## Get an email domain `email_security.settings.domains.get(intdomain_id, DomainGetParams**kwargs) -> DomainGetResponse` **get** `/accounts/{account_id}/email-security/settings/domains/{domain_id}` Gets configuration details for a specific domain in email security. ### Parameters - `account_id: str` Account Identifier - `domain_id: int` The unique identifier for the domain. ### Returns - `class DomainGetResponse: …` - `id: int` The unique identifier for the domain. - `allowed_delivery_modes: List[Literal["DIRECT", "BCC", "JOURNAL", 2 more]]` - `"DIRECT"` - `"BCC"` - `"JOURNAL"` - `"API"` - `"RETRO_SCAN"` - `created_at: datetime` - `domain: str` - `drop_dispositions: List[Literal["MALICIOUS", "MALICIOUS-BEC", "SUSPICIOUS", 7 more]]` - `"MALICIOUS"` - `"MALICIOUS-BEC"` - `"SUSPICIOUS"` - `"SPOOF"` - `"SPAM"` - `"BULK"` - `"ENCRYPTED"` - `"EXTERNAL"` - `"UNKNOWN"` - `"NONE"` - `ip_restrictions: List[str]` - `last_modified: datetime` - `lookback_hops: int` - `regions: List[Literal["GLOBAL", "AU", "DE", 2 more]]` - `"GLOBAL"` - `"AU"` - `"DE"` - `"IN"` - `"US"` - `transport: str` - `authorization: Optional[Authorization]` - `authorized: bool` - `timestamp: datetime` - `status_message: Optional[str]` - `dmarc_status: Optional[Literal["none", "good", "invalid"]]` - `"none"` - `"good"` - `"invalid"` - `emails_processed: Optional[EmailsProcessed]` - `timestamp: datetime` - `total_emails_processed: int` - `total_emails_processed_previous: int` - `folder: Optional[Literal["AllItems", "Inbox"]]` - `"AllItems"` - `"Inbox"` - `inbox_provider: Optional[Literal["Microsoft", "Google"]]` - `"Microsoft"` - `"Google"` - `integration_id: Optional[str]` - `o365_tenant_id: Optional[str]` - `require_tls_inbound: Optional[bool]` - `require_tls_outbound: Optional[bool]` - `spf_status: Optional[Literal["none", "good", "neutral", 2 more]]` - `"none"` - `"good"` - `"neutral"` - `"open"` - `"invalid"` ### 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 ) domain = client.email_security.settings.domains.get( domain_id=2400, account_id="023e105f4ecef8ad9ca31a8372d0c353", ) print(domain.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" } } ], "result": { "id": 2400, "allowed_delivery_modes": [ "API" ], "created_at": "2023-11-14T22:13:20Z", "domain": "example.com", "drop_dispositions": [ "MALICIOUS", "SPAM" ], "ip_restrictions": [ "string" ], "last_modified": "2023-11-14T22:13:20Z", "lookback_hops": 2, "regions": [ "GLOBAL" ], "transport": "example.com", "authorization": { "authorized": true, "timestamp": "2019-12-27T18:11:19.117Z", "status_message": "status_message" }, "dmarc_status": "good", "emails_processed": { "timestamp": "2019-12-27T18:11:19.117Z", "total_emails_processed": 0, "total_emails_processed_previous": 0 }, "folder": "Inbox", "inbox_provider": "Microsoft", "integration_id": "a5dbb180-60ea-4578-84bb-d01a5d4e50c3", "o365_tenant_id": "c3c3239d-8858-47df-9618-0e2d9bdf6aa8", "require_tls_inbound": false, "require_tls_outbound": true, "spf_status": "good" }, "success": true } ``` ## Update an email domain `email_security.settings.domains.edit(intdomain_id, DomainEditParams**kwargs) -> DomainEditResponse` **patch** `/accounts/{account_id}/email-security/settings/domains/{domain_id}` Updates configuration for a domain in email security. ### Parameters - `account_id: str` Account Identifier - `domain_id: int` The unique identifier for the domain. - `ip_restrictions: SequenceNotStr[str]` - `allowed_delivery_modes: Optional[List[Literal["DIRECT", "BCC", "JOURNAL", 2 more]]]` - `"DIRECT"` - `"BCC"` - `"JOURNAL"` - `"API"` - `"RETRO_SCAN"` - `domain: Optional[str]` - `drop_dispositions: Optional[List[Literal["MALICIOUS", "MALICIOUS-BEC", "SUSPICIOUS", 7 more]]]` - `"MALICIOUS"` - `"MALICIOUS-BEC"` - `"SUSPICIOUS"` - `"SPOOF"` - `"SPAM"` - `"BULK"` - `"ENCRYPTED"` - `"EXTERNAL"` - `"UNKNOWN"` - `"NONE"` - `folder: Optional[Literal["AllItems", "Inbox"]]` - `"AllItems"` - `"Inbox"` - `integration_id: Optional[str]` - `lookback_hops: Optional[int]` - `regions: Optional[List[Literal["GLOBAL", "AU", "DE", 2 more]]]` - `"GLOBAL"` - `"AU"` - `"DE"` - `"IN"` - `"US"` - `require_tls_inbound: Optional[bool]` - `require_tls_outbound: Optional[bool]` - `transport: Optional[str]` ### Returns - `class DomainEditResponse: …` - `id: int` The unique identifier for the domain. - `allowed_delivery_modes: List[Literal["DIRECT", "BCC", "JOURNAL", 2 more]]` - `"DIRECT"` - `"BCC"` - `"JOURNAL"` - `"API"` - `"RETRO_SCAN"` - `created_at: datetime` - `domain: str` - `drop_dispositions: List[Literal["MALICIOUS", "MALICIOUS-BEC", "SUSPICIOUS", 7 more]]` - `"MALICIOUS"` - `"MALICIOUS-BEC"` - `"SUSPICIOUS"` - `"SPOOF"` - `"SPAM"` - `"BULK"` - `"ENCRYPTED"` - `"EXTERNAL"` - `"UNKNOWN"` - `"NONE"` - `ip_restrictions: List[str]` - `last_modified: datetime` - `lookback_hops: int` - `regions: List[Literal["GLOBAL", "AU", "DE", 2 more]]` - `"GLOBAL"` - `"AU"` - `"DE"` - `"IN"` - `"US"` - `transport: str` - `authorization: Optional[Authorization]` - `authorized: bool` - `timestamp: datetime` - `status_message: Optional[str]` - `dmarc_status: Optional[Literal["none", "good", "invalid"]]` - `"none"` - `"good"` - `"invalid"` - `emails_processed: Optional[EmailsProcessed]` - `timestamp: datetime` - `total_emails_processed: int` - `total_emails_processed_previous: int` - `folder: Optional[Literal["AllItems", "Inbox"]]` - `"AllItems"` - `"Inbox"` - `inbox_provider: Optional[Literal["Microsoft", "Google"]]` - `"Microsoft"` - `"Google"` - `integration_id: Optional[str]` - `o365_tenant_id: Optional[str]` - `require_tls_inbound: Optional[bool]` - `require_tls_outbound: Optional[bool]` - `spf_status: Optional[Literal["none", "good", "neutral", 2 more]]` - `"none"` - `"good"` - `"neutral"` - `"open"` - `"invalid"` ### 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 ) response = client.email_security.settings.domains.edit( domain_id=2400, account_id="023e105f4ecef8ad9ca31a8372d0c353", ip_restrictions=["192.0.2.0/24", "2001:db8::/32"], ) print(response.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" } } ], "result": { "id": 2400, "allowed_delivery_modes": [ "API" ], "created_at": "2023-11-14T22:13:20Z", "domain": "example.com", "drop_dispositions": [ "MALICIOUS", "SPAM" ], "ip_restrictions": [ "string" ], "last_modified": "2023-11-14T22:13:20Z", "lookback_hops": 2, "regions": [ "GLOBAL" ], "transport": "example.com", "authorization": { "authorized": true, "timestamp": "2019-12-27T18:11:19.117Z", "status_message": "status_message" }, "dmarc_status": "good", "emails_processed": { "timestamp": "2019-12-27T18:11:19.117Z", "total_emails_processed": 0, "total_emails_processed_previous": 0 }, "folder": "Inbox", "inbox_provider": "Microsoft", "integration_id": "a5dbb180-60ea-4578-84bb-d01a5d4e50c3", "o365_tenant_id": "c3c3239d-8858-47df-9618-0e2d9bdf6aa8", "require_tls_inbound": false, "require_tls_outbound": true, "spf_status": "good" }, "success": true } ``` ## Unprotect an email domain `email_security.settings.domains.delete(intdomain_id, DomainDeleteParams**kwargs) -> DomainDeleteResponse` **delete** `/accounts/{account_id}/email-security/settings/domains/{domain_id}` Unprotect an email domain ### Parameters - `account_id: str` Account Identifier - `domain_id: int` The unique identifier for the domain. ### Returns - `class DomainDeleteResponse: …` - `id: int` The unique identifier for the domain. ### 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 ) domain = client.email_security.settings.domains.delete( domain_id=2400, account_id="023e105f4ecef8ad9ca31a8372d0c353", ) print(domain.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" } } ], "result": { "id": 2400 }, "success": true } ``` ## Unprotect multiple email domains `email_security.settings.domains.bulk_delete(DomainBulkDeleteParams**kwargs) -> SyncSinglePage[DomainBulkDeleteResponse]` **delete** `/accounts/{account_id}/email-security/settings/domains` Bulk removes multiple domains from email security configuration in a single request. ### Parameters - `account_id: str` Account Identifier ### Returns - `class DomainBulkDeleteResponse: …` - `id: int` The unique identifier for the domain. ### 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_security.settings.domains.bulk_delete( 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" } } ], "result": [ { "id": 2400 } ], "success": true } ``` ## Domain Types ### Domain List Response - `class DomainListResponse: …` - `id: int` The unique identifier for the domain. - `allowed_delivery_modes: List[Literal["DIRECT", "BCC", "JOURNAL", 2 more]]` - `"DIRECT"` - `"BCC"` - `"JOURNAL"` - `"API"` - `"RETRO_SCAN"` - `created_at: datetime` - `domain: str` - `drop_dispositions: List[Literal["MALICIOUS", "MALICIOUS-BEC", "SUSPICIOUS", 7 more]]` - `"MALICIOUS"` - `"MALICIOUS-BEC"` - `"SUSPICIOUS"` - `"SPOOF"` - `"SPAM"` - `"BULK"` - `"ENCRYPTED"` - `"EXTERNAL"` - `"UNKNOWN"` - `"NONE"` - `ip_restrictions: List[str]` - `last_modified: datetime` - `lookback_hops: int` - `regions: List[Literal["GLOBAL", "AU", "DE", 2 more]]` - `"GLOBAL"` - `"AU"` - `"DE"` - `"IN"` - `"US"` - `transport: str` - `authorization: Optional[Authorization]` - `authorized: bool` - `timestamp: datetime` - `status_message: Optional[str]` - `dmarc_status: Optional[Literal["none", "good", "invalid"]]` - `"none"` - `"good"` - `"invalid"` - `emails_processed: Optional[EmailsProcessed]` - `timestamp: datetime` - `total_emails_processed: int` - `total_emails_processed_previous: int` - `folder: Optional[Literal["AllItems", "Inbox"]]` - `"AllItems"` - `"Inbox"` - `inbox_provider: Optional[Literal["Microsoft", "Google"]]` - `"Microsoft"` - `"Google"` - `integration_id: Optional[str]` - `o365_tenant_id: Optional[str]` - `require_tls_inbound: Optional[bool]` - `require_tls_outbound: Optional[bool]` - `spf_status: Optional[Literal["none", "good", "neutral", 2 more]]` - `"none"` - `"good"` - `"neutral"` - `"open"` - `"invalid"` ### Domain Get Response - `class DomainGetResponse: …` - `id: int` The unique identifier for the domain. - `allowed_delivery_modes: List[Literal["DIRECT", "BCC", "JOURNAL", 2 more]]` - `"DIRECT"` - `"BCC"` - `"JOURNAL"` - `"API"` - `"RETRO_SCAN"` - `created_at: datetime` - `domain: str` - `drop_dispositions: List[Literal["MALICIOUS", "MALICIOUS-BEC", "SUSPICIOUS", 7 more]]` - `"MALICIOUS"` - `"MALICIOUS-BEC"` - `"SUSPICIOUS"` - `"SPOOF"` - `"SPAM"` - `"BULK"` - `"ENCRYPTED"` - `"EXTERNAL"` - `"UNKNOWN"` - `"NONE"` - `ip_restrictions: List[str]` - `last_modified: datetime` - `lookback_hops: int` - `regions: List[Literal["GLOBAL", "AU", "DE", 2 more]]` - `"GLOBAL"` - `"AU"` - `"DE"` - `"IN"` - `"US"` - `transport: str` - `authorization: Optional[Authorization]` - `authorized: bool` - `timestamp: datetime` - `status_message: Optional[str]` - `dmarc_status: Optional[Literal["none", "good", "invalid"]]` - `"none"` - `"good"` - `"invalid"` - `emails_processed: Optional[EmailsProcessed]` - `timestamp: datetime` - `total_emails_processed: int` - `total_emails_processed_previous: int` - `folder: Optional[Literal["AllItems", "Inbox"]]` - `"AllItems"` - `"Inbox"` - `inbox_provider: Optional[Literal["Microsoft", "Google"]]` - `"Microsoft"` - `"Google"` - `integration_id: Optional[str]` - `o365_tenant_id: Optional[str]` - `require_tls_inbound: Optional[bool]` - `require_tls_outbound: Optional[bool]` - `spf_status: Optional[Literal["none", "good", "neutral", 2 more]]` - `"none"` - `"good"` - `"neutral"` - `"open"` - `"invalid"` ### Domain Edit Response - `class DomainEditResponse: …` - `id: int` The unique identifier for the domain. - `allowed_delivery_modes: List[Literal["DIRECT", "BCC", "JOURNAL", 2 more]]` - `"DIRECT"` - `"BCC"` - `"JOURNAL"` - `"API"` - `"RETRO_SCAN"` - `created_at: datetime` - `domain: str` - `drop_dispositions: List[Literal["MALICIOUS", "MALICIOUS-BEC", "SUSPICIOUS", 7 more]]` - `"MALICIOUS"` - `"MALICIOUS-BEC"` - `"SUSPICIOUS"` - `"SPOOF"` - `"SPAM"` - `"BULK"` - `"ENCRYPTED"` - `"EXTERNAL"` - `"UNKNOWN"` - `"NONE"` - `ip_restrictions: List[str]` - `last_modified: datetime` - `lookback_hops: int` - `regions: List[Literal["GLOBAL", "AU", "DE", 2 more]]` - `"GLOBAL"` - `"AU"` - `"DE"` - `"IN"` - `"US"` - `transport: str` - `authorization: Optional[Authorization]` - `authorized: bool` - `timestamp: datetime` - `status_message: Optional[str]` - `dmarc_status: Optional[Literal["none", "good", "invalid"]]` - `"none"` - `"good"` - `"invalid"` - `emails_processed: Optional[EmailsProcessed]` - `timestamp: datetime` - `total_emails_processed: int` - `total_emails_processed_previous: int` - `folder: Optional[Literal["AllItems", "Inbox"]]` - `"AllItems"` - `"Inbox"` - `inbox_provider: Optional[Literal["Microsoft", "Google"]]` - `"Microsoft"` - `"Google"` - `integration_id: Optional[str]` - `o365_tenant_id: Optional[str]` - `require_tls_inbound: Optional[bool]` - `require_tls_outbound: Optional[bool]` - `spf_status: Optional[Literal["none", "good", "neutral", 2 more]]` - `"none"` - `"good"` - `"neutral"` - `"open"` - `"invalid"` ### Domain Delete Response - `class DomainDeleteResponse: …` - `id: int` The unique identifier for the domain. ### Domain Bulk Delete Response - `class DomainBulkDeleteResponse: …` - `id: int` The unique identifier for the domain. # Impersonation Registry ## List entries in impersonation registry `email_security.settings.impersonation_registry.list(ImpersonationRegistryListParams**kwargs) -> SyncV4PagePaginationArray[ImpersonationRegistryListResponse]` **get** `/accounts/{account_id}/email-security/settings/impersonation_registry` Lists, searches, and sorts entries in the impersonation registry. ### Parameters - `account_id: str` Account Identifier - `direction: Optional[Literal["asc", "desc"]]` The sorting direction. - `"asc"` - `"desc"` - `order: Optional[Literal["name", "email", "created_at"]]` The field to sort by. - `"name"` - `"email"` - `"created_at"` - `page: Optional[int]` The page number of paginated results. - `per_page: Optional[int]` The number of results per page. - `provenance: Optional[Literal["A1S_INTERNAL", "SNOOPY-CASB_OFFICE_365", "SNOOPY-OFFICE_365", "SNOOPY-GOOGLE_DIRECTORY"]]` - `"A1S_INTERNAL"` - `"SNOOPY-CASB_OFFICE_365"` - `"SNOOPY-OFFICE_365"` - `"SNOOPY-GOOGLE_DIRECTORY"` - `search: Optional[str]` Allows searching in multiple properties of a record simultaneously. This parameter is intended for human users, not automation. Its exact behavior is intentionally left unspecified and is subject to change in the future. ### Returns - `class ImpersonationRegistryListResponse: …` - `id: int` - `created_at: datetime` - `email: str` - `is_email_regex: bool` - `last_modified: datetime` - `name: str` - `comments: Optional[str]` - `directory_id: Optional[int]` - `directory_node_id: Optional[int]` - `external_directory_node_id: Optional[str]` - `provenance: Optional[str]` ### 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_security.settings.impersonation_registry.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" } } ], "result": [ { "id": 2403, "created_at": "2019-12-27T18:11:19.117Z", "email": "email", "is_email_regex": true, "last_modified": "2019-12-27T18:11:19.117Z", "name": "name", "comments": "comments", "directory_id": 0, "directory_node_id": 0, "external_directory_node_id": "external_directory_node_id", "provenance": "provenance" } ], "result_info": { "count": 1, "page": 1, "per_page": 20, "total_count": 2000 }, "success": true } ``` ## Get an entry in impersonation registry `email_security.settings.impersonation_registry.get(intdisplay_name_id, ImpersonationRegistryGetParams**kwargs) -> ImpersonationRegistryGetResponse` **get** `/accounts/{account_id}/email-security/settings/impersonation_registry/{display_name_id}` Retrieves a display name entry used for impersonation protection. ### Parameters - `account_id: str` Account Identifier - `display_name_id: int` ### Returns - `class ImpersonationRegistryGetResponse: …` - `id: int` - `created_at: datetime` - `email: str` - `is_email_regex: bool` - `last_modified: datetime` - `name: str` - `comments: Optional[str]` - `directory_id: Optional[int]` - `directory_node_id: Optional[int]` - `external_directory_node_id: Optional[str]` - `provenance: Optional[str]` ### 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 ) impersonation_registry = client.email_security.settings.impersonation_registry.get( display_name_id=2403, account_id="023e105f4ecef8ad9ca31a8372d0c353", ) print(impersonation_registry.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" } } ], "result": { "id": 2403, "created_at": "2019-12-27T18:11:19.117Z", "email": "email", "is_email_regex": true, "last_modified": "2019-12-27T18:11:19.117Z", "name": "name", "comments": "comments", "directory_id": 0, "directory_node_id": 0, "external_directory_node_id": "external_directory_node_id", "provenance": "provenance" }, "success": true } ``` ## Create an entry in impersonation registry `email_security.settings.impersonation_registry.create(ImpersonationRegistryCreateParams**kwargs) -> ImpersonationRegistryCreateResponse` **post** `/accounts/{account_id}/email-security/settings/impersonation_registry` Creates a display name entry for email security impersonation protection. ### Parameters - `account_id: str` Account Identifier - `email: str` - `is_email_regex: bool` - `name: str` ### Returns - `class ImpersonationRegistryCreateResponse: …` - `id: int` - `created_at: datetime` - `email: str` - `is_email_regex: bool` - `last_modified: datetime` - `name: str` - `comments: Optional[str]` - `directory_id: Optional[int]` - `directory_node_id: Optional[int]` - `external_directory_node_id: Optional[str]` - `provenance: Optional[str]` ### 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 ) impersonation_registry = client.email_security.settings.impersonation_registry.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", email="email", is_email_regex=True, name="name", ) print(impersonation_registry.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" } } ], "result": { "id": 2403, "created_at": "2019-12-27T18:11:19.117Z", "email": "email", "is_email_regex": true, "last_modified": "2019-12-27T18:11:19.117Z", "name": "name", "comments": "comments", "directory_id": 0, "directory_node_id": 0, "external_directory_node_id": "external_directory_node_id", "provenance": "provenance" }, "success": true } ``` ## Update an entry in impersonation registry `email_security.settings.impersonation_registry.edit(intdisplay_name_id, ImpersonationRegistryEditParams**kwargs) -> ImpersonationRegistryEditResponse` **patch** `/accounts/{account_id}/email-security/settings/impersonation_registry/{display_name_id}` Updates a display name entry used for impersonation protection. ### Parameters - `account_id: str` Account Identifier - `display_name_id: int` - `email: Optional[str]` - `is_email_regex: Optional[bool]` - `name: Optional[str]` ### Returns - `class ImpersonationRegistryEditResponse: …` - `id: int` - `created_at: datetime` - `email: str` - `is_email_regex: bool` - `last_modified: datetime` - `name: str` - `comments: Optional[str]` - `directory_id: Optional[int]` - `directory_node_id: Optional[int]` - `external_directory_node_id: Optional[str]` - `provenance: Optional[str]` ### 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 ) response = client.email_security.settings.impersonation_registry.edit( display_name_id=2403, account_id="023e105f4ecef8ad9ca31a8372d0c353", ) print(response.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" } } ], "result": { "id": 2403, "created_at": "2019-12-27T18:11:19.117Z", "email": "email", "is_email_regex": true, "last_modified": "2019-12-27T18:11:19.117Z", "name": "name", "comments": "comments", "directory_id": 0, "directory_node_id": 0, "external_directory_node_id": "external_directory_node_id", "provenance": "provenance" }, "success": true } ``` ## Delete an entry from impersonation registry `email_security.settings.impersonation_registry.delete(intdisplay_name_id, ImpersonationRegistryDeleteParams**kwargs) -> ImpersonationRegistryDeleteResponse` **delete** `/accounts/{account_id}/email-security/settings/impersonation_registry/{display_name_id}` Removes a display name from impersonation protection monitoring. ### Parameters - `account_id: str` Account Identifier - `display_name_id: int` ### Returns - `class ImpersonationRegistryDeleteResponse: …` - `id: int` ### 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 ) impersonation_registry = client.email_security.settings.impersonation_registry.delete( display_name_id=2403, account_id="023e105f4ecef8ad9ca31a8372d0c353", ) print(impersonation_registry.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" } } ], "result": { "id": 2403 }, "success": true } ``` ## Domain Types ### Impersonation Registry List Response - `class ImpersonationRegistryListResponse: …` - `id: int` - `created_at: datetime` - `email: str` - `is_email_regex: bool` - `last_modified: datetime` - `name: str` - `comments: Optional[str]` - `directory_id: Optional[int]` - `directory_node_id: Optional[int]` - `external_directory_node_id: Optional[str]` - `provenance: Optional[str]` ### Impersonation Registry Get Response - `class ImpersonationRegistryGetResponse: …` - `id: int` - `created_at: datetime` - `email: str` - `is_email_regex: bool` - `last_modified: datetime` - `name: str` - `comments: Optional[str]` - `directory_id: Optional[int]` - `directory_node_id: Optional[int]` - `external_directory_node_id: Optional[str]` - `provenance: Optional[str]` ### Impersonation Registry Create Response - `class ImpersonationRegistryCreateResponse: …` - `id: int` - `created_at: datetime` - `email: str` - `is_email_regex: bool` - `last_modified: datetime` - `name: str` - `comments: Optional[str]` - `directory_id: Optional[int]` - `directory_node_id: Optional[int]` - `external_directory_node_id: Optional[str]` - `provenance: Optional[str]` ### Impersonation Registry Edit Response - `class ImpersonationRegistryEditResponse: …` - `id: int` - `created_at: datetime` - `email: str` - `is_email_regex: bool` - `last_modified: datetime` - `name: str` - `comments: Optional[str]` - `directory_id: Optional[int]` - `directory_node_id: Optional[int]` - `external_directory_node_id: Optional[str]` - `provenance: Optional[str]` ### Impersonation Registry Delete Response - `class ImpersonationRegistryDeleteResponse: …` - `id: int` # Trusted Domains ## List trusted email domains `email_security.settings.trusted_domains.list(TrustedDomainListParams**kwargs) -> SyncV4PagePaginationArray[TrustedDomainListResponse]` **get** `/accounts/{account_id}/email-security/settings/trusted_domains` Lists, searches, and sorts an account’s trusted email domains. ### Parameters - `account_id: str` Account Identifier - `direction: Optional[Literal["asc", "desc"]]` The sorting direction. - `"asc"` - `"desc"` - `is_recent: Optional[bool]` - `is_similarity: Optional[bool]` - `order: Optional[Literal["pattern", "created_at"]]` The field to sort by. - `"pattern"` - `"created_at"` - `page: Optional[int]` The page number of paginated results. - `pattern: Optional[str]` - `per_page: Optional[int]` The number of results per page. - `search: Optional[str]` Allows searching in multiple properties of a record simultaneously. This parameter is intended for human users, not automation. Its exact behavior is intentionally left unspecified and is subject to change in the future. ### Returns - `class TrustedDomainListResponse: …` - `id: int` The unique identifier for the trusted domain. - `created_at: datetime` - `is_recent: bool` Select to prevent recently registered domains from triggering a Suspicious or Malicious disposition. - `is_regex: bool` - `is_similarity: bool` Select for partner or other approved domains that have similar spelling to your connected domains. Prevents listed domains from triggering a Spoof disposition. - `last_modified: datetime` - `pattern: str` - `comments: Optional[str]` ### 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_security.settings.trusted_domains.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" } } ], "result": [ { "id": 2401, "created_at": "2019-12-27T18:11:19.117Z", "is_recent": true, "is_regex": true, "is_similarity": true, "last_modified": "2019-12-27T18:11:19.117Z", "pattern": "x", "comments": "comments" } ], "result_info": { "count": 1, "page": 1, "per_page": 20, "total_count": 2000 }, "success": true } ``` ## Get a trusted email domain `email_security.settings.trusted_domains.get(inttrusted_domain_id, TrustedDomainGetParams**kwargs) -> TrustedDomainGetResponse` **get** `/accounts/{account_id}/email-security/settings/trusted_domains/{trusted_domain_id}` Gets information about a specific trusted domain entry. ### Parameters - `account_id: str` Account Identifier - `trusted_domain_id: int` The unique identifier for the trusted domain. ### Returns - `class TrustedDomainGetResponse: …` - `id: int` The unique identifier for the trusted domain. - `created_at: datetime` - `is_recent: bool` Select to prevent recently registered domains from triggering a Suspicious or Malicious disposition. - `is_regex: bool` - `is_similarity: bool` Select for partner or other approved domains that have similar spelling to your connected domains. Prevents listed domains from triggering a Spoof disposition. - `last_modified: datetime` - `pattern: str` - `comments: Optional[str]` ### 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 ) trusted_domain = client.email_security.settings.trusted_domains.get( trusted_domain_id=2401, account_id="023e105f4ecef8ad9ca31a8372d0c353", ) print(trusted_domain.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" } } ], "result": { "id": 2401, "created_at": "2019-12-27T18:11:19.117Z", "is_recent": true, "is_regex": true, "is_similarity": true, "last_modified": "2019-12-27T18:11:19.117Z", "pattern": "x", "comments": "comments" }, "success": true } ``` ## Create a trusted email domain `email_security.settings.trusted_domains.create(TrustedDomainCreateParams**kwargs) -> TrustedDomainCreateResponse` **post** `/accounts/{account_id}/email-security/settings/trusted_domains` Adds a domain to the trusted domains list for email security, reducing false positive detections. ### Parameters - `account_id: str` Account Identifier - `is_recent: bool` Select to prevent recently registered domains from triggering a Suspicious or Malicious disposition. - `is_regex: bool` - `is_similarity: bool` Select for partner or other approved domains that have similar spelling to your connected domains. Prevents listed domains from triggering a Spoof disposition. - `pattern: str` - `comments: Optional[str]` ### Returns - `TrustedDomainCreateResponse` - `class EmailSecurityTrustedDomain: …` - `id: int` The unique identifier for the trusted domain. - `created_at: datetime` - `is_recent: bool` Select to prevent recently registered domains from triggering a Suspicious or Malicious disposition. - `is_regex: bool` - `is_similarity: bool` Select for partner or other approved domains that have similar spelling to your connected domains. Prevents listed domains from triggering a Spoof disposition. - `last_modified: datetime` - `pattern: str` - `comments: Optional[str]` - `List[UnionMember1]` - `id: int` The unique identifier for the trusted domain. - `created_at: datetime` - `is_recent: bool` Select to prevent recently registered domains from triggering a Suspicious or Malicious disposition. - `is_regex: bool` - `is_similarity: bool` Select for partner or other approved domains that have similar spelling to your connected domains. Prevents listed domains from triggering a Spoof disposition. - `last_modified: datetime` - `pattern: str` - `comments: Optional[str]` ### 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 ) trusted_domain = client.email_security.settings.trusted_domains.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", is_recent=True, is_regex=False, is_similarity=False, pattern="example.com", ) print(trusted_domain) ``` #### 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" } } ], "result": { "id": 2401, "created_at": "2019-12-27T18:11:19.117Z", "is_recent": true, "is_regex": true, "is_similarity": true, "last_modified": "2019-12-27T18:11:19.117Z", "pattern": "x", "comments": "comments" }, "success": true } ``` ## Update a trusted email domain `email_security.settings.trusted_domains.edit(inttrusted_domain_id, TrustedDomainEditParams**kwargs) -> TrustedDomainEditResponse` **patch** `/accounts/{account_id}/email-security/settings/trusted_domains/{trusted_domain_id}` Modifies a trusted domain entry's configuration. ### Parameters - `account_id: str` Account Identifier - `trusted_domain_id: int` The unique identifier for the trusted domain. - `comments: Optional[str]` - `is_recent: Optional[bool]` Select to prevent recently registered domains from triggering a Suspicious or Malicious disposition. - `is_regex: Optional[bool]` - `is_similarity: Optional[bool]` Select for partner or other approved domains that have similar spelling to your connected domains. Prevents listed domains from triggering a Spoof disposition. - `pattern: Optional[str]` ### Returns - `class TrustedDomainEditResponse: …` - `id: int` The unique identifier for the trusted domain. - `created_at: datetime` - `is_recent: bool` Select to prevent recently registered domains from triggering a Suspicious or Malicious disposition. - `is_regex: bool` - `is_similarity: bool` Select for partner or other approved domains that have similar spelling to your connected domains. Prevents listed domains from triggering a Spoof disposition. - `last_modified: datetime` - `pattern: str` - `comments: Optional[str]` ### 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 ) response = client.email_security.settings.trusted_domains.edit( trusted_domain_id=2401, account_id="023e105f4ecef8ad9ca31a8372d0c353", ) print(response.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" } } ], "result": { "id": 2401, "created_at": "2019-12-27T18:11:19.117Z", "is_recent": true, "is_regex": true, "is_similarity": true, "last_modified": "2019-12-27T18:11:19.117Z", "pattern": "x", "comments": "comments" }, "success": true } ``` ## Delete a trusted email domain `email_security.settings.trusted_domains.delete(inttrusted_domain_id, TrustedDomainDeleteParams**kwargs) -> TrustedDomainDeleteResponse` **delete** `/accounts/{account_id}/email-security/settings/trusted_domains/{trusted_domain_id}` Removes a domain from the trusted domains list, subjecting it to normal security scanning. ### Parameters - `account_id: str` Account Identifier - `trusted_domain_id: int` The unique identifier for the trusted domain. ### Returns - `class TrustedDomainDeleteResponse: …` - `id: int` The unique identifier for the trusted domain. ### 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 ) trusted_domain = client.email_security.settings.trusted_domains.delete( trusted_domain_id=2401, account_id="023e105f4ecef8ad9ca31a8372d0c353", ) print(trusted_domain.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" } } ], "result": { "id": 2401 }, "success": true } ``` ## Domain Types ### Trusted Domain List Response - `class TrustedDomainListResponse: …` - `id: int` The unique identifier for the trusted domain. - `created_at: datetime` - `is_recent: bool` Select to prevent recently registered domains from triggering a Suspicious or Malicious disposition. - `is_regex: bool` - `is_similarity: bool` Select for partner or other approved domains that have similar spelling to your connected domains. Prevents listed domains from triggering a Spoof disposition. - `last_modified: datetime` - `pattern: str` - `comments: Optional[str]` ### Trusted Domain Get Response - `class TrustedDomainGetResponse: …` - `id: int` The unique identifier for the trusted domain. - `created_at: datetime` - `is_recent: bool` Select to prevent recently registered domains from triggering a Suspicious or Malicious disposition. - `is_regex: bool` - `is_similarity: bool` Select for partner or other approved domains that have similar spelling to your connected domains. Prevents listed domains from triggering a Spoof disposition. - `last_modified: datetime` - `pattern: str` - `comments: Optional[str]` ### Trusted Domain Create Response - `TrustedDomainCreateResponse` - `class EmailSecurityTrustedDomain: …` - `id: int` The unique identifier for the trusted domain. - `created_at: datetime` - `is_recent: bool` Select to prevent recently registered domains from triggering a Suspicious or Malicious disposition. - `is_regex: bool` - `is_similarity: bool` Select for partner or other approved domains that have similar spelling to your connected domains. Prevents listed domains from triggering a Spoof disposition. - `last_modified: datetime` - `pattern: str` - `comments: Optional[str]` - `List[UnionMember1]` - `id: int` The unique identifier for the trusted domain. - `created_at: datetime` - `is_recent: bool` Select to prevent recently registered domains from triggering a Suspicious or Malicious disposition. - `is_regex: bool` - `is_similarity: bool` Select for partner or other approved domains that have similar spelling to your connected domains. Prevents listed domains from triggering a Spoof disposition. - `last_modified: datetime` - `pattern: str` - `comments: Optional[str]` ### Trusted Domain Edit Response - `class TrustedDomainEditResponse: …` - `id: int` The unique identifier for the trusted domain. - `created_at: datetime` - `is_recent: bool` Select to prevent recently registered domains from triggering a Suspicious or Malicious disposition. - `is_regex: bool` - `is_similarity: bool` Select for partner or other approved domains that have similar spelling to your connected domains. Prevents listed domains from triggering a Spoof disposition. - `last_modified: datetime` - `pattern: str` - `comments: Optional[str]` ### Trusted Domain Delete Response - `class TrustedDomainDeleteResponse: …` - `id: int` The unique identifier for the trusted domain.