Skip to main content

trusted_domains

Creates, updates, deletes, gets or lists a trusted_domains resource.

Overview

Nametrusted_domains
TypeResource
Idcloudflare.email_security.trusted_domains

Fields

The following fields are returned by SELECT queries:

Trusted domain details

NameDatatypeDescription
idstring (uuid)Trusted domain identifier (example: f174e90a-fafe-4643-bbbc-4a0ed4fc8415)
commentsstring (example: Trusted partner domain)
created_atstring (date-time) (example: 2014-01-01T05:20:00.12345Z)
is_recentbooleanSelect to prevent recently registered domains from triggering a Suspicious or Malicious disposition.
is_regexboolean
is_similaritybooleanSelect for partner or other approved domains that have similar spelling to your connected domains. Prevents listed domains from triggering a Spoof disposition.
last_modifiedstring (date-time)Deprecated, use modified_at instead. End of life: November 1, 2026. (example: 2014-01-01T05:20:00.12345Z)
modified_atstring (date-time) (example: 2014-01-01T05:20:00.12345Z)
patternstring (example: example.com)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectaccount_id, trusted_domain_idRetrieves details for a specific trusted domain pattern including its pattern value, whether it uses regex matching, and which detection types it affects.
listselectaccount_idpage, per_page, search, order, direction, is_recent, is_similarity, patternReturns 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.
createinsertaccount_idCreates 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.
editupdateaccount_id, trusted_domain_idUpdates an existing trusted domain pattern. Only provided fields will be modified. Changes take effect for new emails matching the pattern.
deletedeleteaccount_id, trusted_domain_idRemoves a trusted domain pattern. After deletion, emails from this domain will be subject to normal recent domain and similarity checks.
batchexecaccount_id, deletes, patches, puts, postsExecute 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.

NameDatatypeDescription
account_idstringThe Cloudflare account ID.
trusted_domain_idstring (uuid)
directionstringThe sorting direction.
is_recentbooleanFilter to show only recently registered domains that are trusted to prevent triggering Suspicious or Malicious dispositions.
is_similaritybooleanFilter to show only proximity domains (partner or approved domains with similar spelling to connected domains) that prevent Spoof dispositions.
orderstringField to sort by.
pageintegerCurrent page within paginated list of results.
patternstring
per_pageintegerThe number of results per page. Maximum value is 1000.

SELECT examples

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
;

INSERT examples

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
;

UPDATE examples

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

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

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 }}"
}'
;