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