# Settings # Allow Policies ## List email allow policies `client.emailSecurity.settings.allowPolicies.list(AllowPolicyListParamsparams, RequestOptionsoptions?): V4PagePaginationArray` **get** `/accounts/{account_id}/email-security/settings/allow_policies` Returns a paginated list of email allow policies. These policies exempt matching emails from security detection, allowing them to bypass disposition actions. Supports filtering by pattern type and policy attributes. ### Parameters - `params: AllowPolicyListParams` - `account_id: string` Path param: Identifier. - `direction?: "asc" | "desc"` Query param: The sorting direction. - `"asc"` - `"desc"` - `is_acceptable_sender?: boolean` Query param: Filter to show only policies where messages from the sender are exempted from Spam, Spoof, and Bulk dispositions (not Malicious or Suspicious). - `is_exempt_recipient?: boolean` Query param: Filter to show only policies where messages to the recipient bypass all detections. - `is_trusted_sender?: boolean` Query param: Filter to show only policies where messages from the sender bypass all detections and link following. - `order?: "pattern" | "created_at"` Query param: Field to sort by. - `"pattern"` - `"created_at"` - `page?: number` Query param: Current page within paginated list of results. - `pattern?: string` Query param - `pattern_type?: "EMAIL" | "DOMAIN" | "IP" | "UNKNOWN"` Query param: Type of pattern matching. - EMAIL: matches a full email address (e.g. `user@example.com`) - DOMAIN: matches a domain name (e.g. `example.com`) - IP: matches a plain IPv4 address (e.g. `1.2.3.4`) or an IPv4 CIDR block (e.g. `1.2.3.0/24`). Only globally reachable addresses are accepted. - UNKNOWN: deprecated, cannot be used when creating or updating policies, but may be returned for existing entries. - `"EMAIL"` - `"DOMAIN"` - `"IP"` - `"UNKNOWN"` - `per_page?: number` Query param: The number of results per page. Maximum value is 1000. - `search?: string` Query param: Search term for filtering records. Behavior may change. - `verify_sender?: boolean` Query param: Filter to show only policies that enforce DMARC, SPF, or DKIM authentication. ### Returns - `AllowPolicyListResponse` An email allow policy - `id: string` Allow policy identifier - `created_at: string` - `last_modified: string` Deprecated, use `modified_at` instead. End of life: November 1, 2026. - `comments?: string | null` - `is_acceptable_sender?: boolean` 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?: boolean` Messages to this recipient will bypass all detections - `is_recipient?: boolean` Deprecated as of July 1, 2025. Use `is_exempt_recipient` instead. End of life: July 1, 2026. - `is_regex?: boolean` - `is_sender?: boolean` Deprecated as of July 1, 2025. Use `is_trusted_sender` instead. End of life: July 1, 2026. - `is_spoof?: boolean` Deprecated as of July 1, 2025. Use `is_acceptable_sender` instead. End of life: July 1, 2026. - `is_trusted_sender?: boolean` Messages from this sender will bypass all detections and link following - `modified_at?: string` - `pattern?: string` The pattern value to match against. Format depends on `pattern_type`: - EMAIL: a valid email address, e.g. `user@example.com` - DOMAIN: a valid domain name, e.g. `example.com` - IP: a plain IPv4 address (e.g. `1.2.3.4`) or an IPv4 CIDR block (e.g. `1.2.3.0/24`). Only globally reachable addresses are accepted; private, loopback, link-local, and unspecified addresses are rejected. - `pattern_type?: "EMAIL" | "DOMAIN" | "IP" | "UNKNOWN"` Type of pattern matching. - EMAIL: matches a full email address (e.g. `user@example.com`) - DOMAIN: matches a domain name (e.g. `example.com`) - IP: matches a plain IPv4 address (e.g. `1.2.3.4`) or an IPv4 CIDR block (e.g. `1.2.3.0/24`). Only globally reachable addresses are accepted. - UNKNOWN: deprecated, cannot be used when creating or updating policies, but may be returned for existing entries. - `"EMAIL"` - `"DOMAIN"` - `"IP"` - `"UNKNOWN"` - `verify_sender?: boolean` Enforce DMARC, SPF or DKIM authentication. When on, Email Security only honors policies that pass authentication. ### Example ```typescript import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); // Automatically fetches more pages as needed. for await (const allowPolicyListResponse of client.emailSecurity.settings.allowPolicies.list({ account_id: '023e105f4ecef8ad9ca31a8372d0c353', })) { console.log(allowPolicyListResponse.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": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", "created_at": "2014-01-01T05:20:00.12345Z", "last_modified": "2014-01-01T05:20:00.12345Z", "comments": "Trust all messages send from test@example.com", "is_acceptable_sender": false, "is_exempt_recipient": false, "is_recipient": false, "is_regex": false, "is_sender": true, "is_spoof": false, "is_trusted_sender": true, "modified_at": "2014-01-01T05:20:00.12345Z", "pattern": "test@example.com", "pattern_type": "EMAIL", "verify_sender": true } ], "result_info": { "count": 1, "page": 1, "per_page": 20, "total_count": 2000 } } ``` ## Get an email allow policy `client.emailSecurity.settings.allowPolicies.get(stringpolicyID, AllowPolicyGetParamsparams, RequestOptionsoptions?): AllowPolicyGetResponse` **get** `/accounts/{account_id}/email-security/settings/allow_policies/{policy_id}` Retrieves details for a specific allow policy including its pattern, dispositions that are exempted, and whether it applies to all detections. ### Parameters - `policyID: string` Allow policy identifier - `params: AllowPolicyGetParams` - `account_id: string` Identifier. ### Returns - `AllowPolicyGetResponse` An email allow policy - `id: string` Allow policy identifier - `created_at: string` - `last_modified: string` Deprecated, use `modified_at` instead. End of life: November 1, 2026. - `comments?: string | null` - `is_acceptable_sender?: boolean` 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?: boolean` Messages to this recipient will bypass all detections - `is_recipient?: boolean` Deprecated as of July 1, 2025. Use `is_exempt_recipient` instead. End of life: July 1, 2026. - `is_regex?: boolean` - `is_sender?: boolean` Deprecated as of July 1, 2025. Use `is_trusted_sender` instead. End of life: July 1, 2026. - `is_spoof?: boolean` Deprecated as of July 1, 2025. Use `is_acceptable_sender` instead. End of life: July 1, 2026. - `is_trusted_sender?: boolean` Messages from this sender will bypass all detections and link following - `modified_at?: string` - `pattern?: string` The pattern value to match against. Format depends on `pattern_type`: - EMAIL: a valid email address, e.g. `user@example.com` - DOMAIN: a valid domain name, e.g. `example.com` - IP: a plain IPv4 address (e.g. `1.2.3.4`) or an IPv4 CIDR block (e.g. `1.2.3.0/24`). Only globally reachable addresses are accepted; private, loopback, link-local, and unspecified addresses are rejected. - `pattern_type?: "EMAIL" | "DOMAIN" | "IP" | "UNKNOWN"` Type of pattern matching. - EMAIL: matches a full email address (e.g. `user@example.com`) - DOMAIN: matches a domain name (e.g. `example.com`) - IP: matches a plain IPv4 address (e.g. `1.2.3.4`) or an IPv4 CIDR block (e.g. `1.2.3.0/24`). Only globally reachable addresses are accepted. - UNKNOWN: deprecated, cannot be used when creating or updating policies, but may be returned for existing entries. - `"EMAIL"` - `"DOMAIN"` - `"IP"` - `"UNKNOWN"` - `verify_sender?: boolean` Enforce DMARC, SPF or DKIM authentication. When on, Email Security only honors policies that pass authentication. ### Example ```typescript import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const allowPolicy = await client.emailSecurity.settings.allowPolicies.get( 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, ); console.log(allowPolicy.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": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", "created_at": "2014-01-01T05:20:00.12345Z", "last_modified": "2014-01-01T05:20:00.12345Z", "comments": "Trust all messages send from test@example.com", "is_acceptable_sender": false, "is_exempt_recipient": false, "is_recipient": false, "is_regex": false, "is_sender": true, "is_spoof": false, "is_trusted_sender": true, "modified_at": "2014-01-01T05:20:00.12345Z", "pattern": "test@example.com", "pattern_type": "EMAIL", "verify_sender": true } } ``` ## Create email allow policy `client.emailSecurity.settings.allowPolicies.create(AllowPolicyCreateParamsparams, RequestOptionsoptions?): AllowPolicyCreateResponse` **post** `/accounts/{account_id}/email-security/settings/allow_policies` Creates a new allow policy that exempts matching emails from security detections. Use with caution as this bypasses email security scanning. Policies can match on sender patterns and apply to specific detections or all detections. ### Parameters - `params: AllowPolicyCreateParams` - `account_id: string` Path param: Identifier. - `is_acceptable_sender: boolean` Body param: 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: boolean` Body param: Messages to this recipient will bypass all detections - `is_regex: boolean` Body param - `is_trusted_sender: boolean` Body param: Messages from this sender will bypass all detections and link following - `pattern: string` Body param: The pattern value to match against. Format depends on `pattern_type`: - EMAIL: a valid email address, e.g. `user@example.com` - DOMAIN: a valid domain name, e.g. `example.com` - IP: a plain IPv4 address (e.g. `1.2.3.4`) or an IPv4 CIDR block (e.g. `1.2.3.0/24`). Only globally reachable addresses are accepted; private, loopback, link-local, and unspecified addresses are rejected. - `pattern_type: "EMAIL" | "DOMAIN" | "IP" | "UNKNOWN"` Body param: Type of pattern matching. - EMAIL: matches a full email address (e.g. `user@example.com`) - DOMAIN: matches a domain name (e.g. `example.com`) - IP: matches a plain IPv4 address (e.g. `1.2.3.4`) or an IPv4 CIDR block (e.g. `1.2.3.0/24`). Only globally reachable addresses are accepted. - UNKNOWN: deprecated, cannot be used when creating or updating policies, but may be returned for existing entries. - `"EMAIL"` - `"DOMAIN"` - `"IP"` - `"UNKNOWN"` - `verify_sender: boolean` Body param: Enforce DMARC, SPF or DKIM authentication. When on, Email Security only honors policies that pass authentication. - `comments?: string | null` Body param - `is_recipient?: boolean` Body param: Deprecated as of July 1, 2025. Use `is_exempt_recipient` instead. End of life: July 1, 2026. - `is_sender?: boolean` Body param: Deprecated as of July 1, 2025. Use `is_trusted_sender` instead. End of life: July 1, 2026. - `is_spoof?: boolean` Body param: Deprecated as of July 1, 2025. Use `is_acceptable_sender` instead. End of life: July 1, 2026. ### Returns - `AllowPolicyCreateResponse` An email allow policy - `id: string` Allow policy identifier - `created_at: string` - `last_modified: string` Deprecated, use `modified_at` instead. End of life: November 1, 2026. - `comments?: string | null` - `is_acceptable_sender?: boolean` 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?: boolean` Messages to this recipient will bypass all detections - `is_recipient?: boolean` Deprecated as of July 1, 2025. Use `is_exempt_recipient` instead. End of life: July 1, 2026. - `is_regex?: boolean` - `is_sender?: boolean` Deprecated as of July 1, 2025. Use `is_trusted_sender` instead. End of life: July 1, 2026. - `is_spoof?: boolean` Deprecated as of July 1, 2025. Use `is_acceptable_sender` instead. End of life: July 1, 2026. - `is_trusted_sender?: boolean` Messages from this sender will bypass all detections and link following - `modified_at?: string` - `pattern?: string` The pattern value to match against. Format depends on `pattern_type`: - EMAIL: a valid email address, e.g. `user@example.com` - DOMAIN: a valid domain name, e.g. `example.com` - IP: a plain IPv4 address (e.g. `1.2.3.4`) or an IPv4 CIDR block (e.g. `1.2.3.0/24`). Only globally reachable addresses are accepted; private, loopback, link-local, and unspecified addresses are rejected. - `pattern_type?: "EMAIL" | "DOMAIN" | "IP" | "UNKNOWN"` Type of pattern matching. - EMAIL: matches a full email address (e.g. `user@example.com`) - DOMAIN: matches a domain name (e.g. `example.com`) - IP: matches a plain IPv4 address (e.g. `1.2.3.4`) or an IPv4 CIDR block (e.g. `1.2.3.0/24`). Only globally reachable addresses are accepted. - UNKNOWN: deprecated, cannot be used when creating or updating policies, but may be returned for existing entries. - `"EMAIL"` - `"DOMAIN"` - `"IP"` - `"UNKNOWN"` - `verify_sender?: boolean` Enforce DMARC, SPF or DKIM authentication. When on, Email Security only honors policies that pass authentication. ### Example ```typescript import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const allowPolicy = await client.emailSecurity.settings.allowPolicies.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, }); console.log(allowPolicy.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": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", "created_at": "2014-01-01T05:20:00.12345Z", "last_modified": "2014-01-01T05:20:00.12345Z", "comments": "Trust all messages send from test@example.com", "is_acceptable_sender": false, "is_exempt_recipient": false, "is_recipient": false, "is_regex": false, "is_sender": true, "is_spoof": false, "is_trusted_sender": true, "modified_at": "2014-01-01T05:20:00.12345Z", "pattern": "test@example.com", "pattern_type": "EMAIL", "verify_sender": true } } ``` ## Update an email allow policy `client.emailSecurity.settings.allowPolicies.edit(stringpolicyID, AllowPolicyEditParamsparams, RequestOptionsoptions?): AllowPolicyEditResponse` **patch** `/accounts/{account_id}/email-security/settings/allow_policies/{policy_id}` Updates an existing allow policy. Only provided fields will be modified. Changes take effect for new emails matching the pattern. ### Parameters - `policyID: string` Allow policy identifier - `params: AllowPolicyEditParams` - `account_id: string` Path param: Identifier. - `comments?: string | null` Body param - `is_acceptable_sender?: boolean` Body param: 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?: boolean` Body param: Messages to this recipient will bypass all detections - `is_recipient?: boolean` Body param: Deprecated as of July 1, 2025. Use `is_exempt_recipient` instead. End of life: July 1, 2026. - `is_regex?: boolean` Body param - `is_sender?: boolean` Body param: Deprecated as of July 1, 2025. Use `is_trusted_sender` instead. End of life: July 1, 2026. - `is_spoof?: boolean` Body param: Deprecated as of July 1, 2025. Use `is_acceptable_sender` instead. End of life: July 1, 2026. - `is_trusted_sender?: boolean` Body param: Messages from this sender will bypass all detections and link following - `pattern?: string` Body param: The pattern value to match against. Format depends on `pattern_type`: - EMAIL: a valid email address, e.g. `user@example.com` - DOMAIN: a valid domain name, e.g. `example.com` - IP: a plain IPv4 address (e.g. `1.2.3.4`) or an IPv4 CIDR block (e.g. `1.2.3.0/24`). Only globally reachable addresses are accepted; private, loopback, link-local, and unspecified addresses are rejected. - `pattern_type?: "EMAIL" | "DOMAIN" | "IP" | "UNKNOWN"` Body param: Type of pattern matching. - EMAIL: matches a full email address (e.g. `user@example.com`) - DOMAIN: matches a domain name (e.g. `example.com`) - IP: matches a plain IPv4 address (e.g. `1.2.3.4`) or an IPv4 CIDR block (e.g. `1.2.3.0/24`). Only globally reachable addresses are accepted. - UNKNOWN: deprecated, cannot be used when creating or updating policies, but may be returned for existing entries. - `"EMAIL"` - `"DOMAIN"` - `"IP"` - `"UNKNOWN"` - `verify_sender?: boolean` Body param: Enforce DMARC, SPF or DKIM authentication. When on, Email Security only honors policies that pass authentication. ### Returns - `AllowPolicyEditResponse` An email allow policy - `id: string` Allow policy identifier - `created_at: string` - `last_modified: string` Deprecated, use `modified_at` instead. End of life: November 1, 2026. - `comments?: string | null` - `is_acceptable_sender?: boolean` 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?: boolean` Messages to this recipient will bypass all detections - `is_recipient?: boolean` Deprecated as of July 1, 2025. Use `is_exempt_recipient` instead. End of life: July 1, 2026. - `is_regex?: boolean` - `is_sender?: boolean` Deprecated as of July 1, 2025. Use `is_trusted_sender` instead. End of life: July 1, 2026. - `is_spoof?: boolean` Deprecated as of July 1, 2025. Use `is_acceptable_sender` instead. End of life: July 1, 2026. - `is_trusted_sender?: boolean` Messages from this sender will bypass all detections and link following - `modified_at?: string` - `pattern?: string` The pattern value to match against. Format depends on `pattern_type`: - EMAIL: a valid email address, e.g. `user@example.com` - DOMAIN: a valid domain name, e.g. `example.com` - IP: a plain IPv4 address (e.g. `1.2.3.4`) or an IPv4 CIDR block (e.g. `1.2.3.0/24`). Only globally reachable addresses are accepted; private, loopback, link-local, and unspecified addresses are rejected. - `pattern_type?: "EMAIL" | "DOMAIN" | "IP" | "UNKNOWN"` Type of pattern matching. - EMAIL: matches a full email address (e.g. `user@example.com`) - DOMAIN: matches a domain name (e.g. `example.com`) - IP: matches a plain IPv4 address (e.g. `1.2.3.4`) or an IPv4 CIDR block (e.g. `1.2.3.0/24`). Only globally reachable addresses are accepted. - UNKNOWN: deprecated, cannot be used when creating or updating policies, but may be returned for existing entries. - `"EMAIL"` - `"DOMAIN"` - `"IP"` - `"UNKNOWN"` - `verify_sender?: boolean` Enforce DMARC, SPF or DKIM authentication. When on, Email Security only honors policies that pass authentication. ### Example ```typescript import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const response = await client.emailSecurity.settings.allowPolicies.edit( 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, ); console.log(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" } } ], "success": true, "result": { "id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", "created_at": "2014-01-01T05:20:00.12345Z", "last_modified": "2014-01-01T05:20:00.12345Z", "comments": "Trust all messages send from test@example.com", "is_acceptable_sender": false, "is_exempt_recipient": false, "is_recipient": false, "is_regex": false, "is_sender": true, "is_spoof": false, "is_trusted_sender": true, "modified_at": "2014-01-01T05:20:00.12345Z", "pattern": "test@example.com", "pattern_type": "EMAIL", "verify_sender": true } } ``` ## Delete an email allow policy `client.emailSecurity.settings.allowPolicies.delete(stringpolicyID, AllowPolicyDeleteParamsparams, RequestOptionsoptions?): AllowPolicyDeleteResponse` **delete** `/accounts/{account_id}/email-security/settings/allow_policies/{policy_id}` Removes an allow policy. After deletion, emails matching this pattern will be subject to normal security scanning and disposition actions. ### Parameters - `policyID: string` Allow policy identifier - `params: AllowPolicyDeleteParams` - `account_id: string` Identifier. ### Returns - `AllowPolicyDeleteResponse` - `id: string` Allow policy identifier ### Example ```typescript import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const allowPolicy = await client.emailSecurity.settings.allowPolicies.delete( 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, ); console.log(allowPolicy.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": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415" } } ``` ## Domain Types ### Allow Policy List Response - `AllowPolicyListResponse` An email allow policy - `id: string` Allow policy identifier - `created_at: string` - `last_modified: string` Deprecated, use `modified_at` instead. End of life: November 1, 2026. - `comments?: string | null` - `is_acceptable_sender?: boolean` 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?: boolean` Messages to this recipient will bypass all detections - `is_recipient?: boolean` Deprecated as of July 1, 2025. Use `is_exempt_recipient` instead. End of life: July 1, 2026. - `is_regex?: boolean` - `is_sender?: boolean` Deprecated as of July 1, 2025. Use `is_trusted_sender` instead. End of life: July 1, 2026. - `is_spoof?: boolean` Deprecated as of July 1, 2025. Use `is_acceptable_sender` instead. End of life: July 1, 2026. - `is_trusted_sender?: boolean` Messages from this sender will bypass all detections and link following - `modified_at?: string` - `pattern?: string` The pattern value to match against. Format depends on `pattern_type`: - EMAIL: a valid email address, e.g. `user@example.com` - DOMAIN: a valid domain name, e.g. `example.com` - IP: a plain IPv4 address (e.g. `1.2.3.4`) or an IPv4 CIDR block (e.g. `1.2.3.0/24`). Only globally reachable addresses are accepted; private, loopback, link-local, and unspecified addresses are rejected. - `pattern_type?: "EMAIL" | "DOMAIN" | "IP" | "UNKNOWN"` Type of pattern matching. - EMAIL: matches a full email address (e.g. `user@example.com`) - DOMAIN: matches a domain name (e.g. `example.com`) - IP: matches a plain IPv4 address (e.g. `1.2.3.4`) or an IPv4 CIDR block (e.g. `1.2.3.0/24`). Only globally reachable addresses are accepted. - UNKNOWN: deprecated, cannot be used when creating or updating policies, but may be returned for existing entries. - `"EMAIL"` - `"DOMAIN"` - `"IP"` - `"UNKNOWN"` - `verify_sender?: boolean` Enforce DMARC, SPF or DKIM authentication. When on, Email Security only honors policies that pass authentication. ### Allow Policy Get Response - `AllowPolicyGetResponse` An email allow policy - `id: string` Allow policy identifier - `created_at: string` - `last_modified: string` Deprecated, use `modified_at` instead. End of life: November 1, 2026. - `comments?: string | null` - `is_acceptable_sender?: boolean` 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?: boolean` Messages to this recipient will bypass all detections - `is_recipient?: boolean` Deprecated as of July 1, 2025. Use `is_exempt_recipient` instead. End of life: July 1, 2026. - `is_regex?: boolean` - `is_sender?: boolean` Deprecated as of July 1, 2025. Use `is_trusted_sender` instead. End of life: July 1, 2026. - `is_spoof?: boolean` Deprecated as of July 1, 2025. Use `is_acceptable_sender` instead. End of life: July 1, 2026. - `is_trusted_sender?: boolean` Messages from this sender will bypass all detections and link following - `modified_at?: string` - `pattern?: string` The pattern value to match against. Format depends on `pattern_type`: - EMAIL: a valid email address, e.g. `user@example.com` - DOMAIN: a valid domain name, e.g. `example.com` - IP: a plain IPv4 address (e.g. `1.2.3.4`) or an IPv4 CIDR block (e.g. `1.2.3.0/24`). Only globally reachable addresses are accepted; private, loopback, link-local, and unspecified addresses are rejected. - `pattern_type?: "EMAIL" | "DOMAIN" | "IP" | "UNKNOWN"` Type of pattern matching. - EMAIL: matches a full email address (e.g. `user@example.com`) - DOMAIN: matches a domain name (e.g. `example.com`) - IP: matches a plain IPv4 address (e.g. `1.2.3.4`) or an IPv4 CIDR block (e.g. `1.2.3.0/24`). Only globally reachable addresses are accepted. - UNKNOWN: deprecated, cannot be used when creating or updating policies, but may be returned for existing entries. - `"EMAIL"` - `"DOMAIN"` - `"IP"` - `"UNKNOWN"` - `verify_sender?: boolean` Enforce DMARC, SPF or DKIM authentication. When on, Email Security only honors policies that pass authentication. ### Allow Policy Create Response - `AllowPolicyCreateResponse` An email allow policy - `id: string` Allow policy identifier - `created_at: string` - `last_modified: string` Deprecated, use `modified_at` instead. End of life: November 1, 2026. - `comments?: string | null` - `is_acceptable_sender?: boolean` 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?: boolean` Messages to this recipient will bypass all detections - `is_recipient?: boolean` Deprecated as of July 1, 2025. Use `is_exempt_recipient` instead. End of life: July 1, 2026. - `is_regex?: boolean` - `is_sender?: boolean` Deprecated as of July 1, 2025. Use `is_trusted_sender` instead. End of life: July 1, 2026. - `is_spoof?: boolean` Deprecated as of July 1, 2025. Use `is_acceptable_sender` instead. End of life: July 1, 2026. - `is_trusted_sender?: boolean` Messages from this sender will bypass all detections and link following - `modified_at?: string` - `pattern?: string` The pattern value to match against. Format depends on `pattern_type`: - EMAIL: a valid email address, e.g. `user@example.com` - DOMAIN: a valid domain name, e.g. `example.com` - IP: a plain IPv4 address (e.g. `1.2.3.4`) or an IPv4 CIDR block (e.g. `1.2.3.0/24`). Only globally reachable addresses are accepted; private, loopback, link-local, and unspecified addresses are rejected. - `pattern_type?: "EMAIL" | "DOMAIN" | "IP" | "UNKNOWN"` Type of pattern matching. - EMAIL: matches a full email address (e.g. `user@example.com`) - DOMAIN: matches a domain name (e.g. `example.com`) - IP: matches a plain IPv4 address (e.g. `1.2.3.4`) or an IPv4 CIDR block (e.g. `1.2.3.0/24`). Only globally reachable addresses are accepted. - UNKNOWN: deprecated, cannot be used when creating or updating policies, but may be returned for existing entries. - `"EMAIL"` - `"DOMAIN"` - `"IP"` - `"UNKNOWN"` - `verify_sender?: boolean` Enforce DMARC, SPF or DKIM authentication. When on, Email Security only honors policies that pass authentication. ### Allow Policy Edit Response - `AllowPolicyEditResponse` An email allow policy - `id: string` Allow policy identifier - `created_at: string` - `last_modified: string` Deprecated, use `modified_at` instead. End of life: November 1, 2026. - `comments?: string | null` - `is_acceptable_sender?: boolean` 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?: boolean` Messages to this recipient will bypass all detections - `is_recipient?: boolean` Deprecated as of July 1, 2025. Use `is_exempt_recipient` instead. End of life: July 1, 2026. - `is_regex?: boolean` - `is_sender?: boolean` Deprecated as of July 1, 2025. Use `is_trusted_sender` instead. End of life: July 1, 2026. - `is_spoof?: boolean` Deprecated as of July 1, 2025. Use `is_acceptable_sender` instead. End of life: July 1, 2026. - `is_trusted_sender?: boolean` Messages from this sender will bypass all detections and link following - `modified_at?: string` - `pattern?: string` The pattern value to match against. Format depends on `pattern_type`: - EMAIL: a valid email address, e.g. `user@example.com` - DOMAIN: a valid domain name, e.g. `example.com` - IP: a plain IPv4 address (e.g. `1.2.3.4`) or an IPv4 CIDR block (e.g. `1.2.3.0/24`). Only globally reachable addresses are accepted; private, loopback, link-local, and unspecified addresses are rejected. - `pattern_type?: "EMAIL" | "DOMAIN" | "IP" | "UNKNOWN"` Type of pattern matching. - EMAIL: matches a full email address (e.g. `user@example.com`) - DOMAIN: matches a domain name (e.g. `example.com`) - IP: matches a plain IPv4 address (e.g. `1.2.3.4`) or an IPv4 CIDR block (e.g. `1.2.3.0/24`). Only globally reachable addresses are accepted. - UNKNOWN: deprecated, cannot be used when creating or updating policies, but may be returned for existing entries. - `"EMAIL"` - `"DOMAIN"` - `"IP"` - `"UNKNOWN"` - `verify_sender?: boolean` Enforce DMARC, SPF or DKIM authentication. When on, Email Security only honors policies that pass authentication. ### Allow Policy Delete Response - `AllowPolicyDeleteResponse` - `id: string` Allow policy identifier # Block Senders ## List blocked email senders `client.emailSecurity.settings.blockSenders.list(BlockSenderListParamsparams, RequestOptionsoptions?): V4PagePaginationArray` **get** `/accounts/{account_id}/email-security/settings/block_senders` Returns a paginated list of blocked email sender patterns. These patterns prevent emails from matching senders from being delivered. Supports filtering by pattern type and searching across patterns. ### Parameters - `params: BlockSenderListParams` - `account_id: string` Path param: Identifier. - `direction?: "asc" | "desc"` Query param: The sorting direction. - `"asc"` - `"desc"` - `order?: "pattern" | "created_at"` Query param: Field to sort by. - `"pattern"` - `"created_at"` - `page?: number` Query param: Current page within paginated list of results. - `pattern?: string` Query param: Filter by pattern value. - `pattern_type?: "EMAIL" | "DOMAIN" | "IP" | "UNKNOWN"` Query param: Filter by pattern type. - `"EMAIL"` - `"DOMAIN"` - `"IP"` - `"UNKNOWN"` - `per_page?: number` Query param: The number of results per page. Maximum value is 1000. - `search?: string` Query param: Search term for filtering records. Behavior may change. ### Returns - `BlockSenderListResponse` A blocked sender pattern - `id?: string` Blocked sender pattern identifier - `comments?: string | null` - `created_at?: string` - `is_regex?: boolean` - `last_modified?: string` Deprecated, use `modified_at` instead. End of life: November 1, 2026. - `modified_at?: string` - `pattern?: string` The pattern value to match against. Format depends on `pattern_type`: - EMAIL: a valid email address, e.g. `user@example.com` - DOMAIN: a valid domain name, e.g. `example.com` - IP: a plain IPv4 address (e.g. `1.2.3.4`) or an IPv4 CIDR block (e.g. `1.2.3.0/24`). Only globally reachable addresses are accepted; private, loopback, link-local, and unspecified addresses are rejected. - `pattern_type?: "EMAIL" | "DOMAIN" | "IP" | "UNKNOWN"` Type of pattern matching. - EMAIL: matches a full email address (e.g. `user@example.com`) - DOMAIN: matches a domain name (e.g. `example.com`) - IP: matches a plain IPv4 address (e.g. `1.2.3.4`) or an IPv4 CIDR block (e.g. `1.2.3.0/24`). Only globally reachable addresses are accepted. - UNKNOWN: deprecated, cannot be used when creating or updating policies, but may be returned for existing entries. - `"EMAIL"` - `"DOMAIN"` - `"IP"` - `"UNKNOWN"` ### Example ```typescript import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); // Automatically fetches more pages as needed. for await (const blockSenderListResponse of client.emailSecurity.settings.blockSenders.list({ account_id: '023e105f4ecef8ad9ca31a8372d0c353', })) { console.log(blockSenderListResponse.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": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", "comments": "Block sender with email test@example.com", "created_at": "2014-01-01T05:20:00.12345Z", "is_regex": false, "last_modified": "2014-01-01T05:20:00.12345Z", "modified_at": "2014-01-01T05:20:00.12345Z", "pattern": "test@example.com", "pattern_type": "EMAIL" } ], "result_info": { "count": 1, "page": 1, "per_page": 20, "total_count": 2000 } } ``` ## Get a blocked email sender `client.emailSecurity.settings.blockSenders.get(stringpatternID, BlockSenderGetParamsparams, RequestOptionsoptions?): BlockSenderGetResponse` **get** `/accounts/{account_id}/email-security/settings/block_senders/{pattern_id}` Retrieves details for a specific blocked sender pattern including its pattern type, value, and metadata. ### Parameters - `patternID: string` Blocked sender pattern identifier - `params: BlockSenderGetParams` - `account_id: string` Identifier. ### Returns - `BlockSenderGetResponse` A blocked sender pattern - `id?: string` Blocked sender pattern identifier - `comments?: string | null` - `created_at?: string` - `is_regex?: boolean` - `last_modified?: string` Deprecated, use `modified_at` instead. End of life: November 1, 2026. - `modified_at?: string` - `pattern?: string` The pattern value to match against. Format depends on `pattern_type`: - EMAIL: a valid email address, e.g. `user@example.com` - DOMAIN: a valid domain name, e.g. `example.com` - IP: a plain IPv4 address (e.g. `1.2.3.4`) or an IPv4 CIDR block (e.g. `1.2.3.0/24`). Only globally reachable addresses are accepted; private, loopback, link-local, and unspecified addresses are rejected. - `pattern_type?: "EMAIL" | "DOMAIN" | "IP" | "UNKNOWN"` Type of pattern matching. - EMAIL: matches a full email address (e.g. `user@example.com`) - DOMAIN: matches a domain name (e.g. `example.com`) - IP: matches a plain IPv4 address (e.g. `1.2.3.4`) or an IPv4 CIDR block (e.g. `1.2.3.0/24`). Only globally reachable addresses are accepted. - UNKNOWN: deprecated, cannot be used when creating or updating policies, but may be returned for existing entries. - `"EMAIL"` - `"DOMAIN"` - `"IP"` - `"UNKNOWN"` ### Example ```typescript import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const blockSender = await client.emailSecurity.settings.blockSenders.get( 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, ); console.log(blockSender.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": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", "comments": "Block sender with email test@example.com", "created_at": "2014-01-01T05:20:00.12345Z", "is_regex": false, "last_modified": "2014-01-01T05:20:00.12345Z", "modified_at": "2014-01-01T05:20:00.12345Z", "pattern": "test@example.com", "pattern_type": "EMAIL" } } ``` ## Create blocked email sender `client.emailSecurity.settings.blockSenders.create(BlockSenderCreateParamsparams, RequestOptionsoptions?): BlockSenderCreateResponse` **post** `/accounts/{account_id}/email-security/settings/block_senders` Creates a new blocked sender pattern. Emails matching this pattern will be blocked from delivery. Patterns can be email addresses, domains, or IP addresses, and support regular expressions. ### Parameters - `params: BlockSenderCreateParams` - `account_id: string` Path param: Identifier. - `is_regex: boolean` Body param - `pattern: string` Body param: The pattern value to match against. Format depends on `pattern_type`: - EMAIL: a valid email address, e.g. `user@example.com` - DOMAIN: a valid domain name, e.g. `example.com` - IP: a plain IPv4 address (e.g. `1.2.3.4`) or an IPv4 CIDR block (e.g. `1.2.3.0/24`). Only globally reachable addresses are accepted; private, loopback, link-local, and unspecified addresses are rejected. - `pattern_type: "EMAIL" | "DOMAIN" | "IP" | "UNKNOWN"` Body param: Type of pattern matching. - EMAIL: matches a full email address (e.g. `user@example.com`) - DOMAIN: matches a domain name (e.g. `example.com`) - IP: matches a plain IPv4 address (e.g. `1.2.3.4`) or an IPv4 CIDR block (e.g. `1.2.3.0/24`). Only globally reachable addresses are accepted. - UNKNOWN: deprecated, cannot be used when creating or updating policies, but may be returned for existing entries. - `"EMAIL"` - `"DOMAIN"` - `"IP"` - `"UNKNOWN"` - `comments?: string | null` Body param ### Returns - `BlockSenderCreateResponse` A blocked sender pattern - `id?: string` Blocked sender pattern identifier - `comments?: string | null` - `created_at?: string` - `is_regex?: boolean` - `last_modified?: string` Deprecated, use `modified_at` instead. End of life: November 1, 2026. - `modified_at?: string` - `pattern?: string` The pattern value to match against. Format depends on `pattern_type`: - EMAIL: a valid email address, e.g. `user@example.com` - DOMAIN: a valid domain name, e.g. `example.com` - IP: a plain IPv4 address (e.g. `1.2.3.4`) or an IPv4 CIDR block (e.g. `1.2.3.0/24`). Only globally reachable addresses are accepted; private, loopback, link-local, and unspecified addresses are rejected. - `pattern_type?: "EMAIL" | "DOMAIN" | "IP" | "UNKNOWN"` Type of pattern matching. - EMAIL: matches a full email address (e.g. `user@example.com`) - DOMAIN: matches a domain name (e.g. `example.com`) - IP: matches a plain IPv4 address (e.g. `1.2.3.4`) or an IPv4 CIDR block (e.g. `1.2.3.0/24`). Only globally reachable addresses are accepted. - UNKNOWN: deprecated, cannot be used when creating or updating policies, but may be returned for existing entries. - `"EMAIL"` - `"DOMAIN"` - `"IP"` - `"UNKNOWN"` ### Example ```typescript import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const blockSender = await client.emailSecurity.settings.blockSenders.create({ account_id: '023e105f4ecef8ad9ca31a8372d0c353', is_regex: false, pattern: 'test@example.com', pattern_type: 'EMAIL', }); console.log(blockSender.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": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", "comments": "Block sender with email test@example.com", "created_at": "2014-01-01T05:20:00.12345Z", "is_regex": false, "last_modified": "2014-01-01T05:20:00.12345Z", "modified_at": "2014-01-01T05:20:00.12345Z", "pattern": "test@example.com", "pattern_type": "EMAIL" } } ``` ## Update a blocked email sender `client.emailSecurity.settings.blockSenders.edit(stringpatternID, BlockSenderEditParamsparams, RequestOptionsoptions?): BlockSenderEditResponse` **patch** `/accounts/{account_id}/email-security/settings/block_senders/{pattern_id}` Updates an existing blocked sender pattern. Only provided fields will be modified. The pattern will continue blocking emails until deleted. ### Parameters - `patternID: string` Blocked sender pattern identifier - `params: BlockSenderEditParams` - `account_id: string` Path param: Identifier. - `comments?: string | null` Body param - `is_regex?: boolean` Body param - `pattern?: string` Body param: The pattern value to match against. Format depends on `pattern_type`: - EMAIL: a valid email address, e.g. `user@example.com` - DOMAIN: a valid domain name, e.g. `example.com` - IP: a plain IPv4 address (e.g. `1.2.3.4`) or an IPv4 CIDR block (e.g. `1.2.3.0/24`). Only globally reachable addresses are accepted; private, loopback, link-local, and unspecified addresses are rejected. - `pattern_type?: "EMAIL" | "DOMAIN" | "IP" | "UNKNOWN"` Body param: Type of pattern matching. - EMAIL: matches a full email address (e.g. `user@example.com`) - DOMAIN: matches a domain name (e.g. `example.com`) - IP: matches a plain IPv4 address (e.g. `1.2.3.4`) or an IPv4 CIDR block (e.g. `1.2.3.0/24`). Only globally reachable addresses are accepted. - UNKNOWN: deprecated, cannot be used when creating or updating policies, but may be returned for existing entries. - `"EMAIL"` - `"DOMAIN"` - `"IP"` - `"UNKNOWN"` ### Returns - `BlockSenderEditResponse` A blocked sender pattern - `id?: string` Blocked sender pattern identifier - `comments?: string | null` - `created_at?: string` - `is_regex?: boolean` - `last_modified?: string` Deprecated, use `modified_at` instead. End of life: November 1, 2026. - `modified_at?: string` - `pattern?: string` The pattern value to match against. Format depends on `pattern_type`: - EMAIL: a valid email address, e.g. `user@example.com` - DOMAIN: a valid domain name, e.g. `example.com` - IP: a plain IPv4 address (e.g. `1.2.3.4`) or an IPv4 CIDR block (e.g. `1.2.3.0/24`). Only globally reachable addresses are accepted; private, loopback, link-local, and unspecified addresses are rejected. - `pattern_type?: "EMAIL" | "DOMAIN" | "IP" | "UNKNOWN"` Type of pattern matching. - EMAIL: matches a full email address (e.g. `user@example.com`) - DOMAIN: matches a domain name (e.g. `example.com`) - IP: matches a plain IPv4 address (e.g. `1.2.3.4`) or an IPv4 CIDR block (e.g. `1.2.3.0/24`). Only globally reachable addresses are accepted. - UNKNOWN: deprecated, cannot be used when creating or updating policies, but may be returned for existing entries. - `"EMAIL"` - `"DOMAIN"` - `"IP"` - `"UNKNOWN"` ### Example ```typescript import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const response = await client.emailSecurity.settings.blockSenders.edit( 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, ); console.log(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" } } ], "success": true, "result": { "id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", "comments": "Block sender with email test@example.com", "created_at": "2014-01-01T05:20:00.12345Z", "is_regex": false, "last_modified": "2014-01-01T05:20:00.12345Z", "modified_at": "2014-01-01T05:20:00.12345Z", "pattern": "test@example.com", "pattern_type": "EMAIL" } } ``` ## Delete a blocked email sender `client.emailSecurity.settings.blockSenders.delete(stringpatternID, BlockSenderDeleteParamsparams, RequestOptionsoptions?): BlockSenderDeleteResponse` **delete** `/accounts/{account_id}/email-security/settings/block_senders/{pattern_id}` Removes a blocked sender pattern. After deletion, emails from this sender will no longer be automatically blocked based on this rule. ### Parameters - `patternID: string` Blocked sender pattern identifier - `params: BlockSenderDeleteParams` - `account_id: string` Identifier. ### Returns - `BlockSenderDeleteResponse` - `id: string` Blocked sender pattern identifier ### Example ```typescript import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const blockSender = await client.emailSecurity.settings.blockSenders.delete( 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, ); console.log(blockSender.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": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415" } } ``` ## Domain Types ### Block Sender List Response - `BlockSenderListResponse` A blocked sender pattern - `id?: string` Blocked sender pattern identifier - `comments?: string | null` - `created_at?: string` - `is_regex?: boolean` - `last_modified?: string` Deprecated, use `modified_at` instead. End of life: November 1, 2026. - `modified_at?: string` - `pattern?: string` The pattern value to match against. Format depends on `pattern_type`: - EMAIL: a valid email address, e.g. `user@example.com` - DOMAIN: a valid domain name, e.g. `example.com` - IP: a plain IPv4 address (e.g. `1.2.3.4`) or an IPv4 CIDR block (e.g. `1.2.3.0/24`). Only globally reachable addresses are accepted; private, loopback, link-local, and unspecified addresses are rejected. - `pattern_type?: "EMAIL" | "DOMAIN" | "IP" | "UNKNOWN"` Type of pattern matching. - EMAIL: matches a full email address (e.g. `user@example.com`) - DOMAIN: matches a domain name (e.g. `example.com`) - IP: matches a plain IPv4 address (e.g. `1.2.3.4`) or an IPv4 CIDR block (e.g. `1.2.3.0/24`). Only globally reachable addresses are accepted. - UNKNOWN: deprecated, cannot be used when creating or updating policies, but may be returned for existing entries. - `"EMAIL"` - `"DOMAIN"` - `"IP"` - `"UNKNOWN"` ### Block Sender Get Response - `BlockSenderGetResponse` A blocked sender pattern - `id?: string` Blocked sender pattern identifier - `comments?: string | null` - `created_at?: string` - `is_regex?: boolean` - `last_modified?: string` Deprecated, use `modified_at` instead. End of life: November 1, 2026. - `modified_at?: string` - `pattern?: string` The pattern value to match against. Format depends on `pattern_type`: - EMAIL: a valid email address, e.g. `user@example.com` - DOMAIN: a valid domain name, e.g. `example.com` - IP: a plain IPv4 address (e.g. `1.2.3.4`) or an IPv4 CIDR block (e.g. `1.2.3.0/24`). Only globally reachable addresses are accepted; private, loopback, link-local, and unspecified addresses are rejected. - `pattern_type?: "EMAIL" | "DOMAIN" | "IP" | "UNKNOWN"` Type of pattern matching. - EMAIL: matches a full email address (e.g. `user@example.com`) - DOMAIN: matches a domain name (e.g. `example.com`) - IP: matches a plain IPv4 address (e.g. `1.2.3.4`) or an IPv4 CIDR block (e.g. `1.2.3.0/24`). Only globally reachable addresses are accepted. - UNKNOWN: deprecated, cannot be used when creating or updating policies, but may be returned for existing entries. - `"EMAIL"` - `"DOMAIN"` - `"IP"` - `"UNKNOWN"` ### Block Sender Create Response - `BlockSenderCreateResponse` A blocked sender pattern - `id?: string` Blocked sender pattern identifier - `comments?: string | null` - `created_at?: string` - `is_regex?: boolean` - `last_modified?: string` Deprecated, use `modified_at` instead. End of life: November 1, 2026. - `modified_at?: string` - `pattern?: string` The pattern value to match against. Format depends on `pattern_type`: - EMAIL: a valid email address, e.g. `user@example.com` - DOMAIN: a valid domain name, e.g. `example.com` - IP: a plain IPv4 address (e.g. `1.2.3.4`) or an IPv4 CIDR block (e.g. `1.2.3.0/24`). Only globally reachable addresses are accepted; private, loopback, link-local, and unspecified addresses are rejected. - `pattern_type?: "EMAIL" | "DOMAIN" | "IP" | "UNKNOWN"` Type of pattern matching. - EMAIL: matches a full email address (e.g. `user@example.com`) - DOMAIN: matches a domain name (e.g. `example.com`) - IP: matches a plain IPv4 address (e.g. `1.2.3.4`) or an IPv4 CIDR block (e.g. `1.2.3.0/24`). Only globally reachable addresses are accepted. - UNKNOWN: deprecated, cannot be used when creating or updating policies, but may be returned for existing entries. - `"EMAIL"` - `"DOMAIN"` - `"IP"` - `"UNKNOWN"` ### Block Sender Edit Response - `BlockSenderEditResponse` A blocked sender pattern - `id?: string` Blocked sender pattern identifier - `comments?: string | null` - `created_at?: string` - `is_regex?: boolean` - `last_modified?: string` Deprecated, use `modified_at` instead. End of life: November 1, 2026. - `modified_at?: string` - `pattern?: string` The pattern value to match against. Format depends on `pattern_type`: - EMAIL: a valid email address, e.g. `user@example.com` - DOMAIN: a valid domain name, e.g. `example.com` - IP: a plain IPv4 address (e.g. `1.2.3.4`) or an IPv4 CIDR block (e.g. `1.2.3.0/24`). Only globally reachable addresses are accepted; private, loopback, link-local, and unspecified addresses are rejected. - `pattern_type?: "EMAIL" | "DOMAIN" | "IP" | "UNKNOWN"` Type of pattern matching. - EMAIL: matches a full email address (e.g. `user@example.com`) - DOMAIN: matches a domain name (e.g. `example.com`) - IP: matches a plain IPv4 address (e.g. `1.2.3.4`) or an IPv4 CIDR block (e.g. `1.2.3.0/24`). Only globally reachable addresses are accepted. - UNKNOWN: deprecated, cannot be used when creating or updating policies, but may be returned for existing entries. - `"EMAIL"` - `"DOMAIN"` - `"IP"` - `"UNKNOWN"` ### Block Sender Delete Response - `BlockSenderDeleteResponse` - `id: string` Blocked sender pattern identifier # Domains ## List protected email domains `client.emailSecurity.settings.domains.list(DomainListParamsparams, RequestOptionsoptions?): V4PagePaginationArray` **get** `/accounts/{account_id}/email-security/settings/domains` Returns a paginated list of email domains protected by Email Security. Includes domain configuration, delivery modes, and authorization status. Supports filtering by delivery mode and integration ID. ### Parameters - `params: DomainListParams` - `account_id: string` Path param: Identifier. - `active_delivery_mode?: "DIRECT" | "BCC" | "JOURNAL" | 2 more` Query param: Currently active delivery mode to filter by. - `"DIRECT"` - `"BCC"` - `"JOURNAL"` - `"API"` - `"RETRO_SCAN"` - `allowed_delivery_mode?: "DIRECT" | "BCC" | "JOURNAL" | 2 more` Query param: Delivery mode to filter by. - `"DIRECT"` - `"BCC"` - `"JOURNAL"` - `"API"` - `"RETRO_SCAN"` - `direction?: "asc" | "desc"` Query param: The sorting direction. - `"asc"` - `"desc"` - `domain?: Array` Query param: Domain names to filter by. - `integration_id?: string` Query param: Integration ID to filter by. - `order?: "domain" | "created_at"` Query param: Field to sort by. - `"domain"` - `"created_at"` - `page?: number` Query param: Current page within paginated list of results. - `per_page?: number` Query param: The number of results per page. Maximum value is 1000. - `search?: string` Query param: Search term for filtering records. Behavior may change. - `status?: "pending" | "active" | "failed" | "timeout" | null` Query param: Filters response to domains with the provided status. - `"pending"` - `"active"` - `"failed"` - `"timeout"` ### Returns - `DomainListResponse` - `id?: string` Domain identifier - `allowed_delivery_modes?: Array<"DIRECT" | "BCC" | "JOURNAL" | 2 more>` - `"DIRECT"` - `"BCC"` - `"JOURNAL"` - `"API"` - `"RETRO_SCAN"` - `authorization?: Authorization` - `authorized: boolean` - `timestamp: string` - `status_message?: string | null` - `created_at?: string` - `dmarc_status?: "none" | "good" | "invalid" | null` - `"none"` - `"good"` - `"invalid"` - `domain?: string` - `drop_dispositions?: Array<"MALICIOUS" | "MALICIOUS-BEC" | "SUSPICIOUS" | 7 more>` - `"MALICIOUS"` - `"MALICIOUS-BEC"` - `"SUSPICIOUS"` - `"SPOOF"` - `"SPAM"` - `"BULK"` - `"ENCRYPTED"` - `"EXTERNAL"` - `"UNKNOWN"` - `"NONE"` - `emails_processed?: EmailsProcessed` - `timestamp: string` - `total_emails_processed: number` - `total_emails_processed_previous: number` - `folder?: "AllItems" | "Inbox" | null` - `"AllItems"` - `"Inbox"` - `inbox_provider?: "Microsoft" | "Google" | null` - `"Microsoft"` - `"Google"` - `integration_id?: string | null` - `ip_restrictions?: Array` - `last_modified?: string` Deprecated, use `modified_at` instead. End of life: November 1, 2026. - `lookback_hops?: number` - `modified_at?: string` - `o365_tenant_id?: string | null` - `regions?: Array<"GLOBAL" | "AU" | "DE" | 2 more>` - `"GLOBAL"` - `"AU"` - `"DE"` - `"IN"` - `"US"` - `require_tls_inbound?: boolean | null` - `require_tls_outbound?: boolean | null` - `spf_status?: "none" | "good" | "neutral" | 2 more | null` - `"none"` - `"good"` - `"neutral"` - `"open"` - `"invalid"` - `status?: "pending" | "active" | "failed" | "timeout" | null` - `"pending"` - `"active"` - `"failed"` - `"timeout"` - `transport?: string` ### Example ```typescript import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); // Automatically fetches more pages as needed. for await (const domainListResponse of client.emailSecurity.settings.domains.list({ account_id: '023e105f4ecef8ad9ca31a8372d0c353', })) { console.log(domainListResponse.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": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", "allowed_delivery_modes": [ "DIRECT" ], "authorization": { "authorized": true, "timestamp": "2019-12-27T18:11:19.117Z", "status_message": "status_message" }, "created_at": "2014-01-01T05:20:00.12345Z", "dmarc_status": "none", "domain": "example.com", "drop_dispositions": [ "MALICIOUS" ], "emails_processed": { "timestamp": "2019-12-27T18:11:19.117Z", "total_emails_processed": 0, "total_emails_processed_previous": 0 }, "folder": "AllItems", "inbox_provider": "Microsoft", "integration_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "ip_restrictions": [ "192.0.2.0/24", "2001:db8::/32" ], "last_modified": "2014-01-01T05:20:00.12345Z", "lookback_hops": 0, "modified_at": "2014-01-01T05:20:00.12345Z", "o365_tenant_id": "o365_tenant_id", "regions": [ "GLOBAL" ], "require_tls_inbound": true, "require_tls_outbound": true, "spf_status": "none", "status": "pending", "transport": "transport" } ], "result_info": { "count": 1, "page": 1, "per_page": 20, "total_count": 2000 } } ``` ## Get an email domain `client.emailSecurity.settings.domains.get(stringdomainID, DomainGetParamsparams, RequestOptionsoptions?): DomainGetResponse` **get** `/accounts/{account_id}/email-security/settings/domains/{domain_id}` Retrieves detailed information for a specific protected email domain including its delivery configuration, SPF/DMARC status, and authorization state. ### Parameters - `domainID: string` Domain identifier - `params: DomainGetParams` - `account_id: string` Identifier. ### Returns - `DomainGetResponse` - `id?: string` Domain identifier - `allowed_delivery_modes?: Array<"DIRECT" | "BCC" | "JOURNAL" | 2 more>` - `"DIRECT"` - `"BCC"` - `"JOURNAL"` - `"API"` - `"RETRO_SCAN"` - `authorization?: Authorization` - `authorized: boolean` - `timestamp: string` - `status_message?: string | null` - `created_at?: string` - `dmarc_status?: "none" | "good" | "invalid" | null` - `"none"` - `"good"` - `"invalid"` - `domain?: string` - `drop_dispositions?: Array<"MALICIOUS" | "MALICIOUS-BEC" | "SUSPICIOUS" | 7 more>` - `"MALICIOUS"` - `"MALICIOUS-BEC"` - `"SUSPICIOUS"` - `"SPOOF"` - `"SPAM"` - `"BULK"` - `"ENCRYPTED"` - `"EXTERNAL"` - `"UNKNOWN"` - `"NONE"` - `emails_processed?: EmailsProcessed` - `timestamp: string` - `total_emails_processed: number` - `total_emails_processed_previous: number` - `folder?: "AllItems" | "Inbox" | null` - `"AllItems"` - `"Inbox"` - `inbox_provider?: "Microsoft" | "Google" | null` - `"Microsoft"` - `"Google"` - `integration_id?: string | null` - `ip_restrictions?: Array` - `last_modified?: string` Deprecated, use `modified_at` instead. End of life: November 1, 2026. - `lookback_hops?: number` - `modified_at?: string` - `o365_tenant_id?: string | null` - `regions?: Array<"GLOBAL" | "AU" | "DE" | 2 more>` - `"GLOBAL"` - `"AU"` - `"DE"` - `"IN"` - `"US"` - `require_tls_inbound?: boolean | null` - `require_tls_outbound?: boolean | null` - `spf_status?: "none" | "good" | "neutral" | 2 more | null` - `"none"` - `"good"` - `"neutral"` - `"open"` - `"invalid"` - `status?: "pending" | "active" | "failed" | "timeout" | null` - `"pending"` - `"active"` - `"failed"` - `"timeout"` - `transport?: string` ### Example ```typescript import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const domain = await client.emailSecurity.settings.domains.get( 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, ); console.log(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" } } ], "success": true, "result": { "id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", "allowed_delivery_modes": [ "DIRECT" ], "authorization": { "authorized": true, "timestamp": "2019-12-27T18:11:19.117Z", "status_message": "status_message" }, "created_at": "2014-01-01T05:20:00.12345Z", "dmarc_status": "none", "domain": "example.com", "drop_dispositions": [ "MALICIOUS" ], "emails_processed": { "timestamp": "2019-12-27T18:11:19.117Z", "total_emails_processed": 0, "total_emails_processed_previous": 0 }, "folder": "AllItems", "inbox_provider": "Microsoft", "integration_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "ip_restrictions": [ "192.0.2.0/24", "2001:db8::/32" ], "last_modified": "2014-01-01T05:20:00.12345Z", "lookback_hops": 0, "modified_at": "2014-01-01T05:20:00.12345Z", "o365_tenant_id": "o365_tenant_id", "regions": [ "GLOBAL" ], "require_tls_inbound": true, "require_tls_outbound": true, "spf_status": "none", "status": "pending", "transport": "transport" } } ``` ## Update an email domain `client.emailSecurity.settings.domains.edit(stringdomainID, DomainEditParamsparams, RequestOptionsoptions?): DomainEditResponse` **patch** `/accounts/{account_id}/email-security/settings/domains/{domain_id}` Updates configuration for a protected email domain. Only provided fields will be modified. Changes affect delivery mode, security settings, and regional processing. ### Parameters - `domainID: string` Domain identifier - `params: DomainEditParams` - `account_id: string` Path param: Identifier. - `allowed_delivery_modes?: Array<"DIRECT" | "BCC" | "JOURNAL" | 2 more>` Body param - `"DIRECT"` - `"BCC"` - `"JOURNAL"` - `"API"` - `"RETRO_SCAN"` - `domain?: string` Body param - `drop_dispositions?: Array<"MALICIOUS" | "MALICIOUS-BEC" | "SUSPICIOUS" | 7 more>` Body param - `"MALICIOUS"` - `"MALICIOUS-BEC"` - `"SUSPICIOUS"` - `"SPOOF"` - `"SPAM"` - `"BULK"` - `"ENCRYPTED"` - `"EXTERNAL"` - `"UNKNOWN"` - `"NONE"` - `folder?: "AllItems" | "Inbox" | null` Body param - `"AllItems"` - `"Inbox"` - `integration_id?: string | null` Body param - `ip_restrictions?: Array` Body param - `lookback_hops?: number` Body param - `regions?: Array<"GLOBAL" | "AU" | "DE" | 2 more>` Body param - `"GLOBAL"` - `"AU"` - `"DE"` - `"IN"` - `"US"` - `require_tls_inbound?: boolean` Body param - `require_tls_outbound?: boolean` Body param - `transport?: string` Body param ### Returns - `DomainEditResponse` - `id?: string` Domain identifier - `allowed_delivery_modes?: Array<"DIRECT" | "BCC" | "JOURNAL" | 2 more>` - `"DIRECT"` - `"BCC"` - `"JOURNAL"` - `"API"` - `"RETRO_SCAN"` - `authorization?: Authorization` - `authorized: boolean` - `timestamp: string` - `status_message?: string | null` - `created_at?: string` - `dmarc_status?: "none" | "good" | "invalid" | null` - `"none"` - `"good"` - `"invalid"` - `domain?: string` - `drop_dispositions?: Array<"MALICIOUS" | "MALICIOUS-BEC" | "SUSPICIOUS" | 7 more>` - `"MALICIOUS"` - `"MALICIOUS-BEC"` - `"SUSPICIOUS"` - `"SPOOF"` - `"SPAM"` - `"BULK"` - `"ENCRYPTED"` - `"EXTERNAL"` - `"UNKNOWN"` - `"NONE"` - `emails_processed?: EmailsProcessed` - `timestamp: string` - `total_emails_processed: number` - `total_emails_processed_previous: number` - `folder?: "AllItems" | "Inbox" | null` - `"AllItems"` - `"Inbox"` - `inbox_provider?: "Microsoft" | "Google" | null` - `"Microsoft"` - `"Google"` - `integration_id?: string | null` - `ip_restrictions?: Array` - `last_modified?: string` Deprecated, use `modified_at` instead. End of life: November 1, 2026. - `lookback_hops?: number` - `modified_at?: string` - `o365_tenant_id?: string | null` - `regions?: Array<"GLOBAL" | "AU" | "DE" | 2 more>` - `"GLOBAL"` - `"AU"` - `"DE"` - `"IN"` - `"US"` - `require_tls_inbound?: boolean | null` - `require_tls_outbound?: boolean | null` - `spf_status?: "none" | "good" | "neutral" | 2 more | null` - `"none"` - `"good"` - `"neutral"` - `"open"` - `"invalid"` - `status?: "pending" | "active" | "failed" | "timeout" | null` - `"pending"` - `"active"` - `"failed"` - `"timeout"` - `transport?: string` ### Example ```typescript import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const response = await client.emailSecurity.settings.domains.edit( 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, ); console.log(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" } } ], "success": true, "result": { "id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", "allowed_delivery_modes": [ "DIRECT" ], "authorization": { "authorized": true, "timestamp": "2019-12-27T18:11:19.117Z", "status_message": "status_message" }, "created_at": "2014-01-01T05:20:00.12345Z", "dmarc_status": "none", "domain": "example.com", "drop_dispositions": [ "MALICIOUS" ], "emails_processed": { "timestamp": "2019-12-27T18:11:19.117Z", "total_emails_processed": 0, "total_emails_processed_previous": 0 }, "folder": "AllItems", "inbox_provider": "Microsoft", "integration_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "ip_restrictions": [ "192.0.2.0/24", "2001:db8::/32" ], "last_modified": "2014-01-01T05:20:00.12345Z", "lookback_hops": 0, "modified_at": "2014-01-01T05:20:00.12345Z", "o365_tenant_id": "o365_tenant_id", "regions": [ "GLOBAL" ], "require_tls_inbound": true, "require_tls_outbound": true, "spf_status": "none", "status": "pending", "transport": "transport" } } ``` ## Unprotect an email domain `client.emailSecurity.settings.domains.delete(stringdomainID, DomainDeleteParamsparams, RequestOptionsoptions?): DomainDeleteResponse` **delete** `/accounts/{account_id}/email-security/settings/domains/{domain_id}` Removes email security protection from a domain. After deletion, emails for this domain will no longer be processed by Email Security. This action cannot be undone. ### Parameters - `domainID: string` Domain identifier - `params: DomainDeleteParams` - `account_id: string` Identifier. ### Returns - `DomainDeleteResponse` - `id: string` Domain identifier ### Example ```typescript import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const domain = await client.emailSecurity.settings.domains.delete( 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, ); console.log(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" } } ], "success": true, "result": { "id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415" } } ``` ## Unprotect multiple email domains `client.emailSecurity.settings.domains.bulkDelete(DomainBulkDeleteParamsparams, RequestOptionsoptions?): SinglePage` **delete** `/accounts/{account_id}/email-security/settings/domains` Deprecated. Use the batch endpoint instead. ### Parameters - `params: DomainBulkDeleteParams` - `account_id: string` Identifier. ### Returns - `DomainBulkDeleteResponse` - `id: string` Domain identifier ### Example ```typescript import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); // Automatically fetches more pages as needed. for await (const domainBulkDeleteResponse of client.emailSecurity.settings.domains.bulkDelete({ account_id: '023e105f4ecef8ad9ca31a8372d0c353', })) { console.log(domainBulkDeleteResponse.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": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415" } ] } ``` ## Domain Types ### Domain List Response - `DomainListResponse` - `id?: string` Domain identifier - `allowed_delivery_modes?: Array<"DIRECT" | "BCC" | "JOURNAL" | 2 more>` - `"DIRECT"` - `"BCC"` - `"JOURNAL"` - `"API"` - `"RETRO_SCAN"` - `authorization?: Authorization` - `authorized: boolean` - `timestamp: string` - `status_message?: string | null` - `created_at?: string` - `dmarc_status?: "none" | "good" | "invalid" | null` - `"none"` - `"good"` - `"invalid"` - `domain?: string` - `drop_dispositions?: Array<"MALICIOUS" | "MALICIOUS-BEC" | "SUSPICIOUS" | 7 more>` - `"MALICIOUS"` - `"MALICIOUS-BEC"` - `"SUSPICIOUS"` - `"SPOOF"` - `"SPAM"` - `"BULK"` - `"ENCRYPTED"` - `"EXTERNAL"` - `"UNKNOWN"` - `"NONE"` - `emails_processed?: EmailsProcessed` - `timestamp: string` - `total_emails_processed: number` - `total_emails_processed_previous: number` - `folder?: "AllItems" | "Inbox" | null` - `"AllItems"` - `"Inbox"` - `inbox_provider?: "Microsoft" | "Google" | null` - `"Microsoft"` - `"Google"` - `integration_id?: string | null` - `ip_restrictions?: Array` - `last_modified?: string` Deprecated, use `modified_at` instead. End of life: November 1, 2026. - `lookback_hops?: number` - `modified_at?: string` - `o365_tenant_id?: string | null` - `regions?: Array<"GLOBAL" | "AU" | "DE" | 2 more>` - `"GLOBAL"` - `"AU"` - `"DE"` - `"IN"` - `"US"` - `require_tls_inbound?: boolean | null` - `require_tls_outbound?: boolean | null` - `spf_status?: "none" | "good" | "neutral" | 2 more | null` - `"none"` - `"good"` - `"neutral"` - `"open"` - `"invalid"` - `status?: "pending" | "active" | "failed" | "timeout" | null` - `"pending"` - `"active"` - `"failed"` - `"timeout"` - `transport?: string` ### Domain Get Response - `DomainGetResponse` - `id?: string` Domain identifier - `allowed_delivery_modes?: Array<"DIRECT" | "BCC" | "JOURNAL" | 2 more>` - `"DIRECT"` - `"BCC"` - `"JOURNAL"` - `"API"` - `"RETRO_SCAN"` - `authorization?: Authorization` - `authorized: boolean` - `timestamp: string` - `status_message?: string | null` - `created_at?: string` - `dmarc_status?: "none" | "good" | "invalid" | null` - `"none"` - `"good"` - `"invalid"` - `domain?: string` - `drop_dispositions?: Array<"MALICIOUS" | "MALICIOUS-BEC" | "SUSPICIOUS" | 7 more>` - `"MALICIOUS"` - `"MALICIOUS-BEC"` - `"SUSPICIOUS"` - `"SPOOF"` - `"SPAM"` - `"BULK"` - `"ENCRYPTED"` - `"EXTERNAL"` - `"UNKNOWN"` - `"NONE"` - `emails_processed?: EmailsProcessed` - `timestamp: string` - `total_emails_processed: number` - `total_emails_processed_previous: number` - `folder?: "AllItems" | "Inbox" | null` - `"AllItems"` - `"Inbox"` - `inbox_provider?: "Microsoft" | "Google" | null` - `"Microsoft"` - `"Google"` - `integration_id?: string | null` - `ip_restrictions?: Array` - `last_modified?: string` Deprecated, use `modified_at` instead. End of life: November 1, 2026. - `lookback_hops?: number` - `modified_at?: string` - `o365_tenant_id?: string | null` - `regions?: Array<"GLOBAL" | "AU" | "DE" | 2 more>` - `"GLOBAL"` - `"AU"` - `"DE"` - `"IN"` - `"US"` - `require_tls_inbound?: boolean | null` - `require_tls_outbound?: boolean | null` - `spf_status?: "none" | "good" | "neutral" | 2 more | null` - `"none"` - `"good"` - `"neutral"` - `"open"` - `"invalid"` - `status?: "pending" | "active" | "failed" | "timeout" | null` - `"pending"` - `"active"` - `"failed"` - `"timeout"` - `transport?: string` ### Domain Edit Response - `DomainEditResponse` - `id?: string` Domain identifier - `allowed_delivery_modes?: Array<"DIRECT" | "BCC" | "JOURNAL" | 2 more>` - `"DIRECT"` - `"BCC"` - `"JOURNAL"` - `"API"` - `"RETRO_SCAN"` - `authorization?: Authorization` - `authorized: boolean` - `timestamp: string` - `status_message?: string | null` - `created_at?: string` - `dmarc_status?: "none" | "good" | "invalid" | null` - `"none"` - `"good"` - `"invalid"` - `domain?: string` - `drop_dispositions?: Array<"MALICIOUS" | "MALICIOUS-BEC" | "SUSPICIOUS" | 7 more>` - `"MALICIOUS"` - `"MALICIOUS-BEC"` - `"SUSPICIOUS"` - `"SPOOF"` - `"SPAM"` - `"BULK"` - `"ENCRYPTED"` - `"EXTERNAL"` - `"UNKNOWN"` - `"NONE"` - `emails_processed?: EmailsProcessed` - `timestamp: string` - `total_emails_processed: number` - `total_emails_processed_previous: number` - `folder?: "AllItems" | "Inbox" | null` - `"AllItems"` - `"Inbox"` - `inbox_provider?: "Microsoft" | "Google" | null` - `"Microsoft"` - `"Google"` - `integration_id?: string | null` - `ip_restrictions?: Array` - `last_modified?: string` Deprecated, use `modified_at` instead. End of life: November 1, 2026. - `lookback_hops?: number` - `modified_at?: string` - `o365_tenant_id?: string | null` - `regions?: Array<"GLOBAL" | "AU" | "DE" | 2 more>` - `"GLOBAL"` - `"AU"` - `"DE"` - `"IN"` - `"US"` - `require_tls_inbound?: boolean | null` - `require_tls_outbound?: boolean | null` - `spf_status?: "none" | "good" | "neutral" | 2 more | null` - `"none"` - `"good"` - `"neutral"` - `"open"` - `"invalid"` - `status?: "pending" | "active" | "failed" | "timeout" | null` - `"pending"` - `"active"` - `"failed"` - `"timeout"` - `transport?: string` ### Domain Delete Response - `DomainDeleteResponse` - `id: string` Domain identifier ### Domain Bulk Delete Response - `DomainBulkDeleteResponse` - `id: string` Domain identifier # Impersonation Registry ## List entries in impersonation registry `client.emailSecurity.settings.impersonationRegistry.list(ImpersonationRegistryListParamsparams, RequestOptionsoptions?): V4PagePaginationArray` **get** `/accounts/{account_id}/email-security/settings/impersonation_registry` Returns a paginated list of protected identities in the impersonation registry. These entries define identities and email addresses to protect from impersonation attacks. Can be manually added or automatically synced from directory integrations. ### Parameters - `params: ImpersonationRegistryListParams` - `account_id: string` Path param: Identifier. - `direction?: "asc" | "desc"` Query param: The sorting direction. - `"asc"` - `"desc"` - `order?: "name" | "email" | "created_at"` Query param: Field to sort by. - `"name"` - `"email"` - `"created_at"` - `page?: number` Query param: Current page within paginated list of results. - `per_page?: number` Query param: The number of results per page. Maximum value is 1000. - `provenance?: "A1S_INTERNAL" | "SNOOPY-CASB_OFFICE_365" | "SNOOPY-OFFICE_365" | "SNOOPY-GOOGLE_DIRECTORY"` Query param - `"A1S_INTERNAL"` - `"SNOOPY-CASB_OFFICE_365"` - `"SNOOPY-OFFICE_365"` - `"SNOOPY-GOOGLE_DIRECTORY"` - `search?: string` Query param: Search term for filtering records. Behavior may change. ### Returns - `ImpersonationRegistryListResponse` An impersonation registry entry - `id?: string` Impersonation registry entry identifier - `comments?: string | null` - `created_at?: string` - `directory_id?: number | null` - `directory_node_id?: number | null` - `email?: string` - `external_directory_node_id?: string | null` - `is_email_regex?: boolean` - `last_modified?: string` Deprecated, use `modified_at` instead. End of life: November 1, 2026. - `modified_at?: string` - `name?: string` - `provenance?: "A1S_INTERNAL" | "SNOOPY-CASB_OFFICE_365" | "SNOOPY-OFFICE_365" | "SNOOPY-GOOGLE_DIRECTORY"` - `"A1S_INTERNAL"` - `"SNOOPY-CASB_OFFICE_365"` - `"SNOOPY-OFFICE_365"` - `"SNOOPY-GOOGLE_DIRECTORY"` ### Example ```typescript import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); // Automatically fetches more pages as needed. for await (const impersonationRegistryListResponse of client.emailSecurity.settings.impersonationRegistry.list( { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, )) { console.log(impersonationRegistryListResponse.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": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", "comments": "comments", "created_at": "2014-01-01T05:20:00.12345Z", "directory_id": 0, "directory_node_id": 0, "email": "john.doe@example.com", "external_directory_node_id": "external_directory_node_id", "is_email_regex": false, "last_modified": "2014-01-01T05:20:00.12345Z", "modified_at": "2014-01-01T05:20:00.12345Z", "name": "John Doe", "provenance": "A1S_INTERNAL" } ], "result_info": { "count": 1, "page": 1, "per_page": 20, "total_count": 2000 } } ``` ## Get an impersonation registry entry `client.emailSecurity.settings.impersonationRegistry.get(stringimpersonationRegistryID, ImpersonationRegistryGetParamsparams, RequestOptionsoptions?): ImpersonationRegistryGetResponse` **get** `/accounts/{account_id}/email-security/settings/impersonation_registry/{impersonation_registry_id}` Retrieves details for a specific impersonation registry entry including the protected identity, email pattern, and synchronization source if directory-synced. ### Parameters - `impersonationRegistryID: string` Impersonation registry entry identifier - `params: ImpersonationRegistryGetParams` - `account_id: string` Identifier. ### Returns - `ImpersonationRegistryGetResponse` An impersonation registry entry - `id?: string` Impersonation registry entry identifier - `comments?: string | null` - `created_at?: string` - `directory_id?: number | null` - `directory_node_id?: number | null` - `email?: string` - `external_directory_node_id?: string | null` - `is_email_regex?: boolean` - `last_modified?: string` Deprecated, use `modified_at` instead. End of life: November 1, 2026. - `modified_at?: string` - `name?: string` - `provenance?: "A1S_INTERNAL" | "SNOOPY-CASB_OFFICE_365" | "SNOOPY-OFFICE_365" | "SNOOPY-GOOGLE_DIRECTORY"` - `"A1S_INTERNAL"` - `"SNOOPY-CASB_OFFICE_365"` - `"SNOOPY-OFFICE_365"` - `"SNOOPY-GOOGLE_DIRECTORY"` ### Example ```typescript import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const impersonationRegistry = await client.emailSecurity.settings.impersonationRegistry.get( 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, ); console.log(impersonationRegistry.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": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", "comments": "comments", "created_at": "2014-01-01T05:20:00.12345Z", "directory_id": 0, "directory_node_id": 0, "email": "john.doe@example.com", "external_directory_node_id": "external_directory_node_id", "is_email_regex": false, "last_modified": "2014-01-01T05:20:00.12345Z", "modified_at": "2014-01-01T05:20:00.12345Z", "name": "John Doe", "provenance": "A1S_INTERNAL" } } ``` ## Create impersonation registry entry `client.emailSecurity.settings.impersonationRegistry.create(ImpersonationRegistryCreateParamsparams, RequestOptionsoptions?): ImpersonationRegistryCreateResponse` **post** `/accounts/{account_id}/email-security/settings/impersonation_registry` Creates a new entry in the impersonation registry to protect against impersonation. Emails attempting to impersonate this identity will be flagged. Supports regex patterns for flexible email matching. ### Parameters - `params: ImpersonationRegistryCreateParams` - `account_id: string` Path param: Identifier. - `email: string` Body param - `is_email_regex: boolean` Body param - `name: string` Body param - `comments?: string | null` Body param - `directory_id?: number | null` Body param - `directory_node_id?: number | null` Body param - `external_directory_node_id?: string | null` Body param - `provenance?: "A1S_INTERNAL" | "SNOOPY-CASB_OFFICE_365" | "SNOOPY-OFFICE_365" | "SNOOPY-GOOGLE_DIRECTORY"` Body param - `"A1S_INTERNAL"` - `"SNOOPY-CASB_OFFICE_365"` - `"SNOOPY-OFFICE_365"` - `"SNOOPY-GOOGLE_DIRECTORY"` ### Returns - `ImpersonationRegistryCreateResponse` An impersonation registry entry - `id?: string` Impersonation registry entry identifier - `comments?: string | null` - `created_at?: string` - `directory_id?: number | null` - `directory_node_id?: number | null` - `email?: string` - `external_directory_node_id?: string | null` - `is_email_regex?: boolean` - `last_modified?: string` Deprecated, use `modified_at` instead. End of life: November 1, 2026. - `modified_at?: string` - `name?: string` - `provenance?: "A1S_INTERNAL" | "SNOOPY-CASB_OFFICE_365" | "SNOOPY-OFFICE_365" | "SNOOPY-GOOGLE_DIRECTORY"` - `"A1S_INTERNAL"` - `"SNOOPY-CASB_OFFICE_365"` - `"SNOOPY-OFFICE_365"` - `"SNOOPY-GOOGLE_DIRECTORY"` ### Example ```typescript import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const impersonationRegistry = await client.emailSecurity.settings.impersonationRegistry.create({ account_id: '023e105f4ecef8ad9ca31a8372d0c353', email: 'john.doe@example.com', is_email_regex: false, name: 'John Doe', }); console.log(impersonationRegistry.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": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", "comments": "comments", "created_at": "2014-01-01T05:20:00.12345Z", "directory_id": 0, "directory_node_id": 0, "email": "john.doe@example.com", "external_directory_node_id": "external_directory_node_id", "is_email_regex": false, "last_modified": "2014-01-01T05:20:00.12345Z", "modified_at": "2014-01-01T05:20:00.12345Z", "name": "John Doe", "provenance": "A1S_INTERNAL" } } ``` ## Update an impersonation registry entry `client.emailSecurity.settings.impersonationRegistry.edit(stringimpersonationRegistryID, ImpersonationRegistryEditParamsparams, RequestOptionsoptions?): ImpersonationRegistryEditResponse` **patch** `/accounts/{account_id}/email-security/settings/impersonation_registry/{impersonation_registry_id}` Updates an existing impersonation registry entry. Only provided fields will be modified. Directory-synced entries can't be updated. ### Parameters - `impersonationRegistryID: string` Impersonation registry entry identifier - `params: ImpersonationRegistryEditParams` - `account_id: string` Path param: Identifier. - `comments?: string | null` Body param - `directory_id?: number | null` Body param - `directory_node_id?: number | null` Body param - `email?: string` Body param - `external_directory_node_id?: string | null` Body param - `is_email_regex?: boolean` Body param - `name?: string` Body param - `provenance?: "A1S_INTERNAL" | "SNOOPY-CASB_OFFICE_365" | "SNOOPY-OFFICE_365" | "SNOOPY-GOOGLE_DIRECTORY"` Body param - `"A1S_INTERNAL"` - `"SNOOPY-CASB_OFFICE_365"` - `"SNOOPY-OFFICE_365"` - `"SNOOPY-GOOGLE_DIRECTORY"` ### Returns - `ImpersonationRegistryEditResponse` An impersonation registry entry - `id?: string` Impersonation registry entry identifier - `comments?: string | null` - `created_at?: string` - `directory_id?: number | null` - `directory_node_id?: number | null` - `email?: string` - `external_directory_node_id?: string | null` - `is_email_regex?: boolean` - `last_modified?: string` Deprecated, use `modified_at` instead. End of life: November 1, 2026. - `modified_at?: string` - `name?: string` - `provenance?: "A1S_INTERNAL" | "SNOOPY-CASB_OFFICE_365" | "SNOOPY-OFFICE_365" | "SNOOPY-GOOGLE_DIRECTORY"` - `"A1S_INTERNAL"` - `"SNOOPY-CASB_OFFICE_365"` - `"SNOOPY-OFFICE_365"` - `"SNOOPY-GOOGLE_DIRECTORY"` ### Example ```typescript import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const response = await client.emailSecurity.settings.impersonationRegistry.edit( 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, ); console.log(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" } } ], "success": true, "result": { "id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", "comments": "comments", "created_at": "2014-01-01T05:20:00.12345Z", "directory_id": 0, "directory_node_id": 0, "email": "john.doe@example.com", "external_directory_node_id": "external_directory_node_id", "is_email_regex": false, "last_modified": "2014-01-01T05:20:00.12345Z", "modified_at": "2014-01-01T05:20:00.12345Z", "name": "John Doe", "provenance": "A1S_INTERNAL" } } ``` ## Delete an impersonation registry entry `client.emailSecurity.settings.impersonationRegistry.delete(stringimpersonationRegistryID, ImpersonationRegistryDeleteParamsparams, RequestOptionsoptions?): ImpersonationRegistryDeleteResponse` **delete** `/accounts/{account_id}/email-security/settings/impersonation_registry/{impersonation_registry_id}` Removes an entry from the impersonation registry. After deletion, this identity will no longer be protected from impersonation. ### Parameters - `impersonationRegistryID: string` Impersonation registry entry identifier - `params: ImpersonationRegistryDeleteParams` - `account_id: string` Identifier. ### Returns - `ImpersonationRegistryDeleteResponse` - `id: string` Impersonation registry entry identifier ### Example ```typescript import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const impersonationRegistry = await client.emailSecurity.settings.impersonationRegistry.delete( 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, ); console.log(impersonationRegistry.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": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415" } } ``` ## Domain Types ### Impersonation Registry List Response - `ImpersonationRegistryListResponse` An impersonation registry entry - `id?: string` Impersonation registry entry identifier - `comments?: string | null` - `created_at?: string` - `directory_id?: number | null` - `directory_node_id?: number | null` - `email?: string` - `external_directory_node_id?: string | null` - `is_email_regex?: boolean` - `last_modified?: string` Deprecated, use `modified_at` instead. End of life: November 1, 2026. - `modified_at?: string` - `name?: string` - `provenance?: "A1S_INTERNAL" | "SNOOPY-CASB_OFFICE_365" | "SNOOPY-OFFICE_365" | "SNOOPY-GOOGLE_DIRECTORY"` - `"A1S_INTERNAL"` - `"SNOOPY-CASB_OFFICE_365"` - `"SNOOPY-OFFICE_365"` - `"SNOOPY-GOOGLE_DIRECTORY"` ### Impersonation Registry Get Response - `ImpersonationRegistryGetResponse` An impersonation registry entry - `id?: string` Impersonation registry entry identifier - `comments?: string | null` - `created_at?: string` - `directory_id?: number | null` - `directory_node_id?: number | null` - `email?: string` - `external_directory_node_id?: string | null` - `is_email_regex?: boolean` - `last_modified?: string` Deprecated, use `modified_at` instead. End of life: November 1, 2026. - `modified_at?: string` - `name?: string` - `provenance?: "A1S_INTERNAL" | "SNOOPY-CASB_OFFICE_365" | "SNOOPY-OFFICE_365" | "SNOOPY-GOOGLE_DIRECTORY"` - `"A1S_INTERNAL"` - `"SNOOPY-CASB_OFFICE_365"` - `"SNOOPY-OFFICE_365"` - `"SNOOPY-GOOGLE_DIRECTORY"` ### Impersonation Registry Create Response - `ImpersonationRegistryCreateResponse` An impersonation registry entry - `id?: string` Impersonation registry entry identifier - `comments?: string | null` - `created_at?: string` - `directory_id?: number | null` - `directory_node_id?: number | null` - `email?: string` - `external_directory_node_id?: string | null` - `is_email_regex?: boolean` - `last_modified?: string` Deprecated, use `modified_at` instead. End of life: November 1, 2026. - `modified_at?: string` - `name?: string` - `provenance?: "A1S_INTERNAL" | "SNOOPY-CASB_OFFICE_365" | "SNOOPY-OFFICE_365" | "SNOOPY-GOOGLE_DIRECTORY"` - `"A1S_INTERNAL"` - `"SNOOPY-CASB_OFFICE_365"` - `"SNOOPY-OFFICE_365"` - `"SNOOPY-GOOGLE_DIRECTORY"` ### Impersonation Registry Edit Response - `ImpersonationRegistryEditResponse` An impersonation registry entry - `id?: string` Impersonation registry entry identifier - `comments?: string | null` - `created_at?: string` - `directory_id?: number | null` - `directory_node_id?: number | null` - `email?: string` - `external_directory_node_id?: string | null` - `is_email_regex?: boolean` - `last_modified?: string` Deprecated, use `modified_at` instead. End of life: November 1, 2026. - `modified_at?: string` - `name?: string` - `provenance?: "A1S_INTERNAL" | "SNOOPY-CASB_OFFICE_365" | "SNOOPY-OFFICE_365" | "SNOOPY-GOOGLE_DIRECTORY"` - `"A1S_INTERNAL"` - `"SNOOPY-CASB_OFFICE_365"` - `"SNOOPY-OFFICE_365"` - `"SNOOPY-GOOGLE_DIRECTORY"` ### Impersonation Registry Delete Response - `ImpersonationRegistryDeleteResponse` - `id: string` Impersonation registry entry identifier # Sending Domain Restrictions ## List sending domain restrictions `client.emailSecurity.settings.sendingDomainRestrictions.list(SendingDomainRestrictionListParamsparams, RequestOptionsoptions?): V4PagePaginationArray` **get** `/accounts/{account_id}/email-security/settings/sending_domain_restrictions` Returns a paginated list of sending domain restrictions. These restrictions enforce TLS requirements for emails from specific domains. Mail without TLS from restricted domains will be dropped unless the subdomain is in the exclude list. Supports sorting and searching. ### Parameters - `params: SendingDomainRestrictionListParams` - `account_id: string` Path param: Identifier. - `direction?: "asc" | "desc"` Query param: The sorting direction. - `"asc"` - `"desc"` - `order?: "domain" | "created_at"` Query param: Field to sort by. - `"domain"` - `"created_at"` - `page?: number` Query param: Current page within paginated list of results. - `per_page?: number` Query param: The number of results per page. Maximum value is 1000. - `search?: string` Query param: Search term for filtering records. Behavior may change. ### Returns - `SendingDomainRestrictionListResponse` A sending domain restriction that enforces TLS (Transport Layer Security) requirements for emails from specific domains. If TLS is required, mail without TLS from the specified domain will be dropped. - `id?: string` Sending domain restriction identifier. - `comments?: string | null` - `created_at?: string` - `domain?: string` Domain that requires TLS enforcement. - `exclude?: Array` Excluded subdomains that are exempt from TLS requirements. - `last_modified?: string` Deprecated, use `modified_at` instead. End of life: November 1, 2026. - `modified_at?: string` ### Example ```typescript import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); // Automatically fetches more pages as needed. for await (const sendingDomainRestrictionListResponse of client.emailSecurity.settings.sendingDomainRestrictions.list( { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, )) { console.log(sendingDomainRestrictionListResponse.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": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", "comments": "Enforce TLS for all mail from this domain", "created_at": "2014-01-01T05:20:00.12345Z", "domain": "example.com", "exclude": [ "subdomain.example.com" ], "last_modified": "2014-01-01T05:20:00.12345Z", "modified_at": "2014-01-01T05:20:00.12345Z" } ], "result_info": { "count": 1, "page": 1, "per_page": 20, "total_count": 2000 } } ``` ## Get a sending domain restriction `client.emailSecurity.settings.sendingDomainRestrictions.get(stringsendingDomainRestrictionID, SendingDomainRestrictionGetParamsparams, RequestOptionsoptions?): SendingDomainRestrictionGetResponse` **get** `/accounts/{account_id}/email-security/settings/sending_domain_restrictions/{sending_domain_restriction_id}` Retrieves details for a specific sending domain restriction including the domain requiring TLS and any excluded subdomains exempt from the TLS requirement. ### Parameters - `sendingDomainRestrictionID: string` Sending domain restriction identifier. - `params: SendingDomainRestrictionGetParams` - `account_id: string` Identifier. ### Returns - `SendingDomainRestrictionGetResponse` A sending domain restriction that enforces TLS (Transport Layer Security) requirements for emails from specific domains. If TLS is required, mail without TLS from the specified domain will be dropped. - `id?: string` Sending domain restriction identifier. - `comments?: string | null` - `created_at?: string` - `domain?: string` Domain that requires TLS enforcement. - `exclude?: Array` Excluded subdomains that are exempt from TLS requirements. - `last_modified?: string` Deprecated, use `modified_at` instead. End of life: November 1, 2026. - `modified_at?: string` ### Example ```typescript import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const sendingDomainRestriction = await client.emailSecurity.settings.sendingDomainRestrictions.get( 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, ); console.log(sendingDomainRestriction.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": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", "comments": "Enforce TLS for all mail from this domain", "created_at": "2014-01-01T05:20:00.12345Z", "domain": "example.com", "exclude": [ "subdomain.example.com" ], "last_modified": "2014-01-01T05:20:00.12345Z", "modified_at": "2014-01-01T05:20:00.12345Z" } } ``` ## Create a sending domain restriction `client.emailSecurity.settings.sendingDomainRestrictions.create(SendingDomainRestrictionCreateParamsparams, RequestOptionsoptions?): SendingDomainRestrictionCreateResponse` **post** `/accounts/{account_id}/email-security/settings/sending_domain_restrictions` Creates a new sending domain restriction to enforce TLS requirements for a domain. Emails without TLS from this domain will be dropped unless the subdomain is in the exclude list. ### Parameters - `params: SendingDomainRestrictionCreateParams` - `account_id: string` Path param: Identifier. - `domain: string` Body param: Domain that requires TLS enforcement. - `exclude: Array` Body param: Excluded subdomains that are exempt from TLS requirements. - `comments?: string | null` Body param ### Returns - `SendingDomainRestrictionCreateResponse` A sending domain restriction that enforces TLS (Transport Layer Security) requirements for emails from specific domains. If TLS is required, mail without TLS from the specified domain will be dropped. - `id?: string` Sending domain restriction identifier. - `comments?: string | null` - `created_at?: string` - `domain?: string` Domain that requires TLS enforcement. - `exclude?: Array` Excluded subdomains that are exempt from TLS requirements. - `last_modified?: string` Deprecated, use `modified_at` instead. End of life: November 1, 2026. - `modified_at?: string` ### Example ```typescript import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const sendingDomainRestriction = await client.emailSecurity.settings.sendingDomainRestrictions.create({ account_id: '023e105f4ecef8ad9ca31a8372d0c353', domain: 'example.com', exclude: ['subdomain.example.com'], }); console.log(sendingDomainRestriction.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": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", "comments": "Enforce TLS for all mail from this domain", "created_at": "2014-01-01T05:20:00.12345Z", "domain": "example.com", "exclude": [ "subdomain.example.com" ], "last_modified": "2014-01-01T05:20:00.12345Z", "modified_at": "2014-01-01T05:20:00.12345Z" } } ``` ## Update a sending domain restriction `client.emailSecurity.settings.sendingDomainRestrictions.edit(stringsendingDomainRestrictionID, SendingDomainRestrictionEditParamsparams, RequestOptionsoptions?): SendingDomainRestrictionEditResponse` **patch** `/accounts/{account_id}/email-security/settings/sending_domain_restrictions/{sending_domain_restriction_id}` Updates an existing sending domain restriction. Only provided fields will be modified. Changes affect which domains require TLS and which subdomains are excluded. ### Parameters - `sendingDomainRestrictionID: string` Sending domain restriction identifier. - `params: SendingDomainRestrictionEditParams` - `account_id: string` Path param: Identifier. - `comments?: string | null` Body param - `domain?: string` Body param: Domain that requires TLS enforcement. - `exclude?: Array` Body param: Excluded subdomains that are exempt from TLS requirements. ### Returns - `SendingDomainRestrictionEditResponse` A sending domain restriction that enforces TLS (Transport Layer Security) requirements for emails from specific domains. If TLS is required, mail without TLS from the specified domain will be dropped. - `id?: string` Sending domain restriction identifier. - `comments?: string | null` - `created_at?: string` - `domain?: string` Domain that requires TLS enforcement. - `exclude?: Array` Excluded subdomains that are exempt from TLS requirements. - `last_modified?: string` Deprecated, use `modified_at` instead. End of life: November 1, 2026. - `modified_at?: string` ### Example ```typescript import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const response = await client.emailSecurity.settings.sendingDomainRestrictions.edit( 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, ); console.log(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" } } ], "success": true, "result": { "id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", "comments": "Enforce TLS for all mail from this domain", "created_at": "2014-01-01T05:20:00.12345Z", "domain": "example.com", "exclude": [ "subdomain.example.com" ], "last_modified": "2014-01-01T05:20:00.12345Z", "modified_at": "2014-01-01T05:20:00.12345Z" } } ``` ## Delete a sending domain restriction `client.emailSecurity.settings.sendingDomainRestrictions.delete(stringsendingDomainRestrictionID, SendingDomainRestrictionDeleteParamsparams, RequestOptionsoptions?): SendingDomainRestrictionDeleteResponse` **delete** `/accounts/{account_id}/email-security/settings/sending_domain_restrictions/{sending_domain_restriction_id}` Removes a sending domain restriction. After deletion, TLS will no longer be enforced for emails from this domain. ### Parameters - `sendingDomainRestrictionID: string` Sending domain restriction identifier. - `params: SendingDomainRestrictionDeleteParams` - `account_id: string` Identifier. ### Returns - `SendingDomainRestrictionDeleteResponse` - `id: string` Sending domain restriction identifier. ### Example ```typescript import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const sendingDomainRestriction = await client.emailSecurity.settings.sendingDomainRestrictions.delete( 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, ); console.log(sendingDomainRestriction.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": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415" } } ``` ## Domain Types ### Sending Domain Restriction List Response - `SendingDomainRestrictionListResponse` A sending domain restriction that enforces TLS (Transport Layer Security) requirements for emails from specific domains. If TLS is required, mail without TLS from the specified domain will be dropped. - `id?: string` Sending domain restriction identifier. - `comments?: string | null` - `created_at?: string` - `domain?: string` Domain that requires TLS enforcement. - `exclude?: Array` Excluded subdomains that are exempt from TLS requirements. - `last_modified?: string` Deprecated, use `modified_at` instead. End of life: November 1, 2026. - `modified_at?: string` ### Sending Domain Restriction Get Response - `SendingDomainRestrictionGetResponse` A sending domain restriction that enforces TLS (Transport Layer Security) requirements for emails from specific domains. If TLS is required, mail without TLS from the specified domain will be dropped. - `id?: string` Sending domain restriction identifier. - `comments?: string | null` - `created_at?: string` - `domain?: string` Domain that requires TLS enforcement. - `exclude?: Array` Excluded subdomains that are exempt from TLS requirements. - `last_modified?: string` Deprecated, use `modified_at` instead. End of life: November 1, 2026. - `modified_at?: string` ### Sending Domain Restriction Create Response - `SendingDomainRestrictionCreateResponse` A sending domain restriction that enforces TLS (Transport Layer Security) requirements for emails from specific domains. If TLS is required, mail without TLS from the specified domain will be dropped. - `id?: string` Sending domain restriction identifier. - `comments?: string | null` - `created_at?: string` - `domain?: string` Domain that requires TLS enforcement. - `exclude?: Array` Excluded subdomains that are exempt from TLS requirements. - `last_modified?: string` Deprecated, use `modified_at` instead. End of life: November 1, 2026. - `modified_at?: string` ### Sending Domain Restriction Edit Response - `SendingDomainRestrictionEditResponse` A sending domain restriction that enforces TLS (Transport Layer Security) requirements for emails from specific domains. If TLS is required, mail without TLS from the specified domain will be dropped. - `id?: string` Sending domain restriction identifier. - `comments?: string | null` - `created_at?: string` - `domain?: string` Domain that requires TLS enforcement. - `exclude?: Array` Excluded subdomains that are exempt from TLS requirements. - `last_modified?: string` Deprecated, use `modified_at` instead. End of life: November 1, 2026. - `modified_at?: string` ### Sending Domain Restriction Delete Response - `SendingDomainRestrictionDeleteResponse` - `id: string` Sending domain restriction identifier. # Trusted Domains ## List trusted email domains `client.emailSecurity.settings.trustedDomains.list(TrustedDomainListParamsparams, RequestOptionsoptions?): V4PagePaginationArray` **get** `/accounts/{account_id}/email-security/settings/trusted_domains` Returns a paginated list of trusted domain patterns. Trusted domains prevent false positives for recently registered domains and lookalike domain detections. Patterns can use regular expressions for flexible matching. ### Parameters - `params: TrustedDomainListParams` - `account_id: string` Path param: Identifier. - `direction?: "asc" | "desc"` Query param: The sorting direction. - `"asc"` - `"desc"` - `is_recent?: boolean` Query param: Filter to show only recently registered domains that are trusted to prevent triggering Suspicious or Malicious dispositions. - `is_similarity?: boolean` Query param: Filter to show only proximity domains (partner or approved domains with similar spelling to connected domains) that prevent Spoof dispositions. - `order?: "pattern" | "created_at"` Query param: Field to sort by. - `"pattern"` - `"created_at"` - `page?: number` Query param: Current page within paginated list of results. - `pattern?: string` Query param - `per_page?: number` Query param: The number of results per page. Maximum value is 1000. - `search?: string` Query param: Search term for filtering records. Behavior may change. ### Returns - `TrustedDomainListResponse` A trusted email domain - `id?: string` Trusted domain identifier - `comments?: string | null` - `created_at?: string` - `is_recent?: boolean` Select to prevent recently registered domains from triggering a Suspicious or Malicious disposition. - `is_regex?: boolean` - `is_similarity?: boolean` 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?: string` Deprecated, use `modified_at` instead. End of life: November 1, 2026. - `modified_at?: string` - `pattern?: string` ### Example ```typescript import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); // Automatically fetches more pages as needed. for await (const trustedDomainListResponse of client.emailSecurity.settings.trustedDomains.list({ account_id: '023e105f4ecef8ad9ca31a8372d0c353', })) { console.log(trustedDomainListResponse.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": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", "comments": "Trusted partner domain", "created_at": "2014-01-01T05:20:00.12345Z", "is_recent": true, "is_regex": false, "is_similarity": false, "last_modified": "2014-01-01T05:20:00.12345Z", "modified_at": "2014-01-01T05:20:00.12345Z", "pattern": "example.com" } ], "result_info": { "count": 1, "page": 1, "per_page": 20, "total_count": 2000 } } ``` ## Get a trusted email domain `client.emailSecurity.settings.trustedDomains.get(stringtrustedDomainID, TrustedDomainGetParamsparams, RequestOptionsoptions?): TrustedDomainGetResponse` **get** `/accounts/{account_id}/email-security/settings/trusted_domains/{trusted_domain_id}` Retrieves details for a specific trusted domain pattern including its pattern value, whether it uses regex matching, and which detection types it affects. ### Parameters - `trustedDomainID: string` Trusted domain identifier - `params: TrustedDomainGetParams` - `account_id: string` Identifier. ### Returns - `TrustedDomainGetResponse` A trusted email domain - `id?: string` Trusted domain identifier - `comments?: string | null` - `created_at?: string` - `is_recent?: boolean` Select to prevent recently registered domains from triggering a Suspicious or Malicious disposition. - `is_regex?: boolean` - `is_similarity?: boolean` 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?: string` Deprecated, use `modified_at` instead. End of life: November 1, 2026. - `modified_at?: string` - `pattern?: string` ### Example ```typescript import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const trustedDomain = await client.emailSecurity.settings.trustedDomains.get( 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, ); console.log(trustedDomain.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": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", "comments": "Trusted partner domain", "created_at": "2014-01-01T05:20:00.12345Z", "is_recent": true, "is_regex": false, "is_similarity": false, "last_modified": "2014-01-01T05:20:00.12345Z", "modified_at": "2014-01-01T05:20:00.12345Z", "pattern": "example.com" } } ``` ## Create trusted email domain `client.emailSecurity.settings.trustedDomains.create(TrustedDomainCreateParamsparams, RequestOptionsoptions?): TrustedDomainCreateResponse` **post** `/accounts/{account_id}/email-security/settings/trusted_domains` Creates a new trusted domain pattern. Use for partner domains or approved senders that should bypass recent domain registration and similarity checks. Configure whether it prevents recent domain or spoof dispositions. ### Parameters - `params: TrustedDomainCreateParams` - `account_id: string` Path param: Identifier. - `is_recent: boolean` Body param: Select to prevent recently registered domains from triggering a Suspicious or Malicious disposition. - `is_regex: boolean` Body param - `is_similarity: boolean` Body param: Select for partner or other approved domains that have similar spelling to your connected domains. Prevents listed domains from triggering a Spoof disposition. - `pattern: string` Body param - `comments?: string | null` Body param ### Returns - `TrustedDomainCreateResponse` A trusted email domain - `id?: string` Trusted domain identifier - `comments?: string | null` - `created_at?: string` - `is_recent?: boolean` Select to prevent recently registered domains from triggering a Suspicious or Malicious disposition. - `is_regex?: boolean` - `is_similarity?: boolean` 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?: string` Deprecated, use `modified_at` instead. End of life: November 1, 2026. - `modified_at?: string` - `pattern?: string` ### Example ```typescript import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const trustedDomain = await client.emailSecurity.settings.trustedDomains.create({ account_id: '023e105f4ecef8ad9ca31a8372d0c353', is_recent: true, is_regex: false, is_similarity: false, pattern: 'example.com', }); console.log(trustedDomain.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": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", "comments": "Trusted partner domain", "created_at": "2014-01-01T05:20:00.12345Z", "is_recent": true, "is_regex": false, "is_similarity": false, "last_modified": "2014-01-01T05:20:00.12345Z", "modified_at": "2014-01-01T05:20:00.12345Z", "pattern": "example.com" } } ``` ## Update a trusted email domain `client.emailSecurity.settings.trustedDomains.edit(stringtrustedDomainID, TrustedDomainEditParamsparams, RequestOptionsoptions?): TrustedDomainEditResponse` **patch** `/accounts/{account_id}/email-security/settings/trusted_domains/{trusted_domain_id}` Updates an existing trusted domain pattern. Only provided fields will be modified. Changes take effect for new emails matching the pattern. ### Parameters - `trustedDomainID: string` Trusted domain identifier - `params: TrustedDomainEditParams` - `account_id: string` Path param: Identifier. - `comments?: string | null` Body param - `is_recent?: boolean` Body param: Select to prevent recently registered domains from triggering a Suspicious or Malicious disposition. - `is_regex?: boolean` Body param - `is_similarity?: boolean` Body param: Select for partner or other approved domains that have similar spelling to your connected domains. Prevents listed domains from triggering a Spoof disposition. - `pattern?: string` Body param ### Returns - `TrustedDomainEditResponse` A trusted email domain - `id?: string` Trusted domain identifier - `comments?: string | null` - `created_at?: string` - `is_recent?: boolean` Select to prevent recently registered domains from triggering a Suspicious or Malicious disposition. - `is_regex?: boolean` - `is_similarity?: boolean` 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?: string` Deprecated, use `modified_at` instead. End of life: November 1, 2026. - `modified_at?: string` - `pattern?: string` ### Example ```typescript import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const response = await client.emailSecurity.settings.trustedDomains.edit( 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, ); console.log(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" } } ], "success": true, "result": { "id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", "comments": "Trusted partner domain", "created_at": "2014-01-01T05:20:00.12345Z", "is_recent": true, "is_regex": false, "is_similarity": false, "last_modified": "2014-01-01T05:20:00.12345Z", "modified_at": "2014-01-01T05:20:00.12345Z", "pattern": "example.com" } } ``` ## Delete a trusted email domain `client.emailSecurity.settings.trustedDomains.delete(stringtrustedDomainID, TrustedDomainDeleteParamsparams, RequestOptionsoptions?): TrustedDomainDeleteResponse` **delete** `/accounts/{account_id}/email-security/settings/trusted_domains/{trusted_domain_id}` Removes a trusted domain pattern. After deletion, emails from this domain will be subject to normal recent domain and similarity checks. ### Parameters - `trustedDomainID: string` Trusted domain identifier - `params: TrustedDomainDeleteParams` - `account_id: string` Identifier. ### Returns - `TrustedDomainDeleteResponse` - `id: string` Trusted domain identifier ### Example ```typescript import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const trustedDomain = await client.emailSecurity.settings.trustedDomains.delete( 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, ); console.log(trustedDomain.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": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415" } } ``` ## Domain Types ### Trusted Domain List Response - `TrustedDomainListResponse` A trusted email domain - `id?: string` Trusted domain identifier - `comments?: string | null` - `created_at?: string` - `is_recent?: boolean` Select to prevent recently registered domains from triggering a Suspicious or Malicious disposition. - `is_regex?: boolean` - `is_similarity?: boolean` 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?: string` Deprecated, use `modified_at` instead. End of life: November 1, 2026. - `modified_at?: string` - `pattern?: string` ### Trusted Domain Get Response - `TrustedDomainGetResponse` A trusted email domain - `id?: string` Trusted domain identifier - `comments?: string | null` - `created_at?: string` - `is_recent?: boolean` Select to prevent recently registered domains from triggering a Suspicious or Malicious disposition. - `is_regex?: boolean` - `is_similarity?: boolean` 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?: string` Deprecated, use `modified_at` instead. End of life: November 1, 2026. - `modified_at?: string` - `pattern?: string` ### Trusted Domain Create Response - `TrustedDomainCreateResponse` A trusted email domain - `id?: string` Trusted domain identifier - `comments?: string | null` - `created_at?: string` - `is_recent?: boolean` Select to prevent recently registered domains from triggering a Suspicious or Malicious disposition. - `is_regex?: boolean` - `is_similarity?: boolean` 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?: string` Deprecated, use `modified_at` instead. End of life: November 1, 2026. - `modified_at?: string` - `pattern?: string` ### Trusted Domain Edit Response - `TrustedDomainEditResponse` A trusted email domain - `id?: string` Trusted domain identifier - `comments?: string | null` - `created_at?: string` - `is_recent?: boolean` Select to prevent recently registered domains from triggering a Suspicious or Malicious disposition. - `is_regex?: boolean` - `is_similarity?: boolean` 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?: string` Deprecated, use `modified_at` instead. End of life: November 1, 2026. - `modified_at?: string` - `pattern?: string` ### Trusted Domain Delete Response - `TrustedDomainDeleteResponse` - `id: string` Trusted domain identifier # URL Ignore Patterns ## List URL ignore patterns `client.emailSecurity.settings.urlIgnorePatterns.list(URLIgnorePatternListParamsparams, RequestOptionsoptions?): V4PagePaginationArray` **get** `/accounts/{account_id}/email-security/settings/url_ignore_patterns` Returns a paginated list of URL rewrite ignore patterns for the account. URLs matching these patterns will not be rewritten. ### Parameters - `params: URLIgnorePatternListParams` - `account_id: string` Path param: Identifier. - `page?: number` Query param: Current page within paginated list of results. - `per_page?: number` Query param: The number of results per page. Maximum value is 1000. ### Returns - `URLIgnorePatternListResponse` A URL ignore pattern that exempts matching URLs from being rewritten by Email Security. - `id: string` URL ignore pattern identifier - `created_at: string` - `pattern: string` Regular expression matching URLs that should not be rewritten. - `comments?: string | null` Optional note describing the reason for the ignore pattern. - `last_modified?: string` Deprecated, use `modified_at` instead. End of life: November 1, 2026. - `modified_at?: string` ### Example ```typescript import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); // Automatically fetches more pages as needed. for await (const urlIgnorePatternListResponse of client.emailSecurity.settings.urlIgnorePatterns.list( { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, )) { console.log(urlIgnorePatternListResponse.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": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", "created_at": "2019-12-27T18:11:19.117Z", "pattern": "https://example\\.com/.*", "comments": "Trusted internal redirect service", "last_modified": "2019-12-27T18:11:19.117Z", "modified_at": "2019-12-27T18:11:19.117Z" } ], "result_info": { "count": 1, "page": 1, "per_page": 20, "total_count": 2000 } } ``` ## Get a URL ignore pattern `client.emailSecurity.settings.urlIgnorePatterns.get(stringpatternID, URLIgnorePatternGetParamsparams, RequestOptionsoptions?): URLIgnorePatternGetResponse` **get** `/accounts/{account_id}/email-security/settings/url_ignore_patterns/{pattern_id}` Returns a single URL rewrite ignore pattern by its identifier. ### Parameters - `patternID: string` URL ignore pattern identifier - `params: URLIgnorePatternGetParams` - `account_id: string` Identifier. ### Returns - `URLIgnorePatternGetResponse` A URL ignore pattern that exempts matching URLs from being rewritten by Email Security. - `id: string` URL ignore pattern identifier - `created_at: string` - `pattern: string` Regular expression matching URLs that should not be rewritten. - `comments?: string | null` Optional note describing the reason for the ignore pattern. - `last_modified?: string` Deprecated, use `modified_at` instead. End of life: November 1, 2026. - `modified_at?: string` ### Example ```typescript import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const urlIgnorePattern = await client.emailSecurity.settings.urlIgnorePatterns.get( 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, ); console.log(urlIgnorePattern.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": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", "created_at": "2019-12-27T18:11:19.117Z", "pattern": "https://example\\.com/.*", "comments": "Trusted internal redirect service", "last_modified": "2019-12-27T18:11:19.117Z", "modified_at": "2019-12-27T18:11:19.117Z" } } ``` ## Create a URL ignore pattern `client.emailSecurity.settings.urlIgnorePatterns.create(URLIgnorePatternCreateParamsparams, RequestOptionsoptions?): URLIgnorePatternCreateResponse` **post** `/accounts/{account_id}/email-security/settings/url_ignore_patterns` Creates a new URL rewrite ignore pattern. URLs matching this pattern will not be rewritten. ### Parameters - `params: URLIgnorePatternCreateParams` - `account_id: string` Path param: Identifier. - `pattern: string` Body param: Regular expression matching URLs that should not be rewritten. - `comments?: string | null` Body param: Optional note describing the reason for the ignore pattern. ### Returns - `URLIgnorePatternCreateResponse` A URL ignore pattern that exempts matching URLs from being rewritten by Email Security. - `id: string` URL ignore pattern identifier - `created_at: string` - `pattern: string` Regular expression matching URLs that should not be rewritten. - `comments?: string | null` Optional note describing the reason for the ignore pattern. - `last_modified?: string` Deprecated, use `modified_at` instead. End of life: November 1, 2026. - `modified_at?: string` ### Example ```typescript import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const urlIgnorePattern = await client.emailSecurity.settings.urlIgnorePatterns.create({ account_id: '023e105f4ecef8ad9ca31a8372d0c353', pattern: 'https://example\\.com/.*', }); console.log(urlIgnorePattern.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": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", "created_at": "2019-12-27T18:11:19.117Z", "pattern": "https://example\\.com/.*", "comments": "Trusted internal redirect service", "last_modified": "2019-12-27T18:11:19.117Z", "modified_at": "2019-12-27T18:11:19.117Z" } } ``` ## Update a URL ignore pattern `client.emailSecurity.settings.urlIgnorePatterns.edit(stringpatternID, URLIgnorePatternEditParamsparams, RequestOptionsoptions?): URLIgnorePatternEditResponse` **patch** `/accounts/{account_id}/email-security/settings/url_ignore_patterns/{pattern_id}` Updates an existing URL rewrite ignore pattern. Only provided fields will be modified. ### Parameters - `patternID: string` URL ignore pattern identifier - `params: URLIgnorePatternEditParams` - `account_id: string` Path param: Identifier. - `comments?: string | null` Body param: Optional note describing the reason for the ignore pattern. - `pattern?: string` Body param: Regular expression matching URLs that should not be rewritten. ### Returns - `URLIgnorePatternEditResponse` A URL ignore pattern that exempts matching URLs from being rewritten by Email Security. - `id: string` URL ignore pattern identifier - `created_at: string` - `pattern: string` Regular expression matching URLs that should not be rewritten. - `comments?: string | null` Optional note describing the reason for the ignore pattern. - `last_modified?: string` Deprecated, use `modified_at` instead. End of life: November 1, 2026. - `modified_at?: string` ### Example ```typescript import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const response = await client.emailSecurity.settings.urlIgnorePatterns.edit( 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, ); console.log(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" } } ], "success": true, "result": { "id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", "created_at": "2019-12-27T18:11:19.117Z", "pattern": "https://example\\.com/.*", "comments": "Trusted internal redirect service", "last_modified": "2019-12-27T18:11:19.117Z", "modified_at": "2019-12-27T18:11:19.117Z" } } ``` ## Delete a URL ignore pattern `client.emailSecurity.settings.urlIgnorePatterns.delete(stringpatternID, URLIgnorePatternDeleteParamsparams, RequestOptionsoptions?): URLIgnorePatternDeleteResponse` **delete** `/accounts/{account_id}/email-security/settings/url_ignore_patterns/{pattern_id}` Removes a URL rewrite ignore pattern. After deletion, URLs matching this pattern will be rewritten again. ### Parameters - `patternID: string` URL ignore pattern identifier - `params: URLIgnorePatternDeleteParams` - `account_id: string` Identifier. ### Returns - `URLIgnorePatternDeleteResponse` - `id: string` URL ignore pattern identifier ### Example ```typescript import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const urlIgnorePattern = await client.emailSecurity.settings.urlIgnorePatterns.delete( 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, ); console.log(urlIgnorePattern.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": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415" } } ``` ## Domain Types ### URL Ignore Pattern List Response - `URLIgnorePatternListResponse` A URL ignore pattern that exempts matching URLs from being rewritten by Email Security. - `id: string` URL ignore pattern identifier - `created_at: string` - `pattern: string` Regular expression matching URLs that should not be rewritten. - `comments?: string | null` Optional note describing the reason for the ignore pattern. - `last_modified?: string` Deprecated, use `modified_at` instead. End of life: November 1, 2026. - `modified_at?: string` ### URL Ignore Pattern Get Response - `URLIgnorePatternGetResponse` A URL ignore pattern that exempts matching URLs from being rewritten by Email Security. - `id: string` URL ignore pattern identifier - `created_at: string` - `pattern: string` Regular expression matching URLs that should not be rewritten. - `comments?: string | null` Optional note describing the reason for the ignore pattern. - `last_modified?: string` Deprecated, use `modified_at` instead. End of life: November 1, 2026. - `modified_at?: string` ### URL Ignore Pattern Create Response - `URLIgnorePatternCreateResponse` A URL ignore pattern that exempts matching URLs from being rewritten by Email Security. - `id: string` URL ignore pattern identifier - `created_at: string` - `pattern: string` Regular expression matching URLs that should not be rewritten. - `comments?: string | null` Optional note describing the reason for the ignore pattern. - `last_modified?: string` Deprecated, use `modified_at` instead. End of life: November 1, 2026. - `modified_at?: string` ### URL Ignore Pattern Edit Response - `URLIgnorePatternEditResponse` A URL ignore pattern that exempts matching URLs from being rewritten by Email Security. - `id: string` URL ignore pattern identifier - `created_at: string` - `pattern: string` Regular expression matching URLs that should not be rewritten. - `comments?: string | null` Optional note describing the reason for the ignore pattern. - `last_modified?: string` Deprecated, use `modified_at` instead. End of life: November 1, 2026. - `modified_at?: string` ### URL Ignore Pattern Delete Response - `URLIgnorePatternDeleteResponse` - `id: string` URL ignore pattern identifier