trusted_domains
Creates, updates, deletes, gets or lists a trusted_domains resource.
Overview
| Name | trusted_domains |
| Type | Resource |
| Id | cloudflare.email_security.trusted_domains |
Fields
The following fields are returned by SELECT queries:
- get
- list
Trusted domain details
| Name | Datatype | Description |
|---|---|---|
id | string (uuid) | Trusted domain identifier (example: f174e90a-fafe-4643-bbbc-4a0ed4fc8415) |
comments | string | (example: Trusted partner domain) |
created_at | string (date-time) | (example: 2014-01-01T05:20:00.12345Z) |
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 (date-time) | Deprecated, use modified_at instead. End of life: November 1, 2026. (example: 2014-01-01T05:20:00.12345Z) |
modified_at | string (date-time) | (example: 2014-01-01T05:20:00.12345Z) |
pattern | string | (example: example.com) |
List of trusted domains
| Name | Datatype | Description |
|---|---|---|
id | string (uuid) | Trusted domain identifier (example: f174e90a-fafe-4643-bbbc-4a0ed4fc8415) |
comments | string | (example: Trusted partner domain) |
created_at | string (date-time) | (example: 2014-01-01T05:20:00.12345Z) |
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 (date-time) | Deprecated, use modified_at instead. End of life: November 1, 2026. (example: 2014-01-01T05:20:00.12345Z) |
modified_at | string (date-time) | (example: 2014-01-01T05:20:00.12345Z) |
pattern | string | (example: example.com) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | account_id, 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. | |
list | select | account_id | page, per_page, search, order, direction, is_recent, is_similarity, pattern | 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. |
create | insert | account_id | 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. | |
edit | update | account_id, trusted_domain_id | Updates an existing trusted domain pattern. Only provided fields will be modified. Changes take effect for new emails matching the pattern. | |
delete | delete | account_id, trusted_domain_id | Removes a trusted domain pattern. After deletion, emails from this domain will be subject to normal recent domain and similarity checks. | |
batch | exec | account_id, deletes, patches, puts, posts | Execute multiple operations atomically. All four operation arrays (deletes, patches, puts, posts) are required and executed in order. Send empty arrays for unused operations. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
account_id | string | The Cloudflare account ID. |
trusted_domain_id | string (uuid) | |
direction | string | The sorting direction. |
is_recent | boolean | Filter to show only recently registered domains that are trusted to prevent triggering Suspicious or Malicious dispositions. |
is_similarity | boolean | Filter to show only proximity domains (partner or approved domains with similar spelling to connected domains) that prevent Spoof dispositions. |
order | string | Field to sort by. |
page | integer | Current page within paginated list of results. |
pattern | string | |
per_page | integer | The number of results per page. Maximum value is 1000. |
search | string | Search term for filtering records. Behavior may change. |
SELECT examples
- get
- list
Retrieves details for a specific trusted domain pattern including its pattern value, whether it uses regex matching, and which detection types it affects.
SELECT
id,
comments,
created_at,
is_recent,
is_regex,
is_similarity,
last_modified,
modified_at,
pattern
FROM cloudflare.email_security.trusted_domains
WHERE account_id = '{{ account_id }}' -- required
AND trusted_domain_id = '{{ trusted_domain_id }}' -- required
;
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.
SELECT
id,
comments,
created_at,
is_recent,
is_regex,
is_similarity,
last_modified,
modified_at,
pattern
FROM cloudflare.email_security.trusted_domains
WHERE account_id = '{{ account_id }}' -- required
AND page = '{{ page }}'
AND per_page = '{{ per_page }}'
AND search = '{{ search }}'
AND order = '{{ order }}'
AND direction = '{{ direction }}'
AND is_recent = '{{ is_recent }}'
AND is_similarity = '{{ is_similarity }}'
AND pattern = '{{ pattern }}'
;
INSERT examples
- create
- Manifest
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.
INSERT INTO cloudflare.email_security.trusted_domains (
comments,
is_recent,
is_regex,
is_similarity,
pattern,
account_id
)
SELECT
'{{ comments }}',
{{ is_recent }},
{{ is_regex }},
{{ is_similarity }},
'{{ pattern }}',
'{{ account_id }}'
RETURNING
errors,
messages,
result,
success
;
# Description fields are for documentation purposes
- name: trusted_domains
props:
- name: account_id
value: "{{ account_id }}"
description: Required parameter for the trusted_domains resource.
- name: comments
value: "{{ comments }}"
- name: is_recent
value: {{ is_recent }}
description: |
Select to prevent recently registered domains from triggering a Suspicious or Malicious disposition.
- name: is_regex
value: {{ is_regex }}
- name: is_similarity
value: {{ is_similarity }}
description: |
Select for partner or other approved domains that have similar spelling to your connected domains. Prevents listed domains from triggering a Spoof disposition.
- name: pattern
value: "{{ pattern }}"
UPDATE examples
- edit
Updates an existing trusted domain pattern. Only provided fields will be modified. Changes take effect for new emails matching the pattern.
UPDATE cloudflare.email_security.trusted_domains
SET
comments = '{{ comments }}',
is_recent = {{ is_recent }},
is_regex = {{ is_regex }},
is_similarity = {{ is_similarity }},
pattern = '{{ pattern }}'
WHERE
account_id = '{{ account_id }}' --required
AND trusted_domain_id = '{{ trusted_domain_id }}' --required
RETURNING
errors,
messages,
result,
success;
DELETE examples
- delete
Removes a trusted domain pattern. After deletion, emails from this domain will be subject to normal recent domain and similarity checks.
DELETE FROM cloudflare.email_security.trusted_domains
WHERE account_id = '{{ account_id }}' --required
AND trusted_domain_id = '{{ trusted_domain_id }}' --required
;
Lifecycle Methods
- batch
Execute multiple operations atomically. All four operation arrays (deletes, patches, puts, posts) are required and executed in order. Send empty arrays for unused operations.
EXEC cloudflare.email_security.trusted_domains.batch
@account_id='{{ account_id }}' --required
@@json=
'{
"deletes": "{{ deletes }}",
"patches": "{{ patches }}",
"posts": "{{ posts }}",
"puts": "{{ puts }}"
}'
;