Skip to main content

domains

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

Overview

Namedomains
TypeResource
Idcloudflare.email_security.domains

Fields

The following fields are returned by SELECT queries:

Domain details

NameDatatypeDescription
idstring (uuid)Domain identifier (example: f174e90a-fafe-4643-bbbc-4a0ed4fc8415)
integration_idstring (uuid)
o365_tenant_idstring
allowed_delivery_modesarray
authorizationobject
created_atstring (date-time) (example: 2014-01-01T05:20:00.12345Z)
dmarc_statusstring (none, good, invalid)
domainstring (example: example.com)
drop_dispositionsarray
emails_processedobject
folderstring (AllItems, Inbox)
inbox_providerstring (Microsoft, Google, )
ip_restrictionsarray
last_modifiedstring (date-time)Deprecated, use modified_at instead. End of life: November 1, 2026. (example: 2014-01-01T05:20:00.12345Z)
lookback_hopsinteger
modified_atstring (date-time) (example: 2014-01-01T05:20:00.12345Z)
regionsarray
require_tls_inboundboolean
require_tls_outboundboolean
spf_statusstring (none, good, neutral, open, invalid)
statusstring (pending, active, failed, timeout)
transportstring

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectaccount_id, domain_idRetrieves detailed information for a specific protected email domain including its delivery configuration, SPF/DMARC status, and authorization state.
listselectaccount_idpage, per_page, search, order, direction, allowed_delivery_mode, domain, active_delivery_mode, integration_id, statusReturns 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.
editupdateaccount_id, domain_idUpdates configuration for a protected email domain. Only provided fields will be modified. Changes affect delivery mode, security settings, and regional processing.
deletedeleteaccount_id, domain_idRemoves 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

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.
domain_idstring (uuid)
active_delivery_modestringCurrently active delivery mode to filter by.
allowed_delivery_modestringDelivery mode to filter by.
directionstringThe sorting direction.
domainarrayDomain names to filter by.
integration_idstring (uuid)Integration ID to filter by.
orderstringField to sort by.
pageintegerCurrent page within paginated list of results.
per_pageintegerThe number of results per page. Maximum value is 1000.
statusstringFilters response to domains with the provided status.

SELECT examples

Retrieves detailed information for a specific protected email domain including its delivery configuration, SPF/DMARC status, and authorization state.

SELECT
id,
integration_id,
o365_tenant_id,
allowed_delivery_modes,
authorization,
created_at,
dmarc_status,
domain,
drop_dispositions,
emails_processed,
folder,
inbox_provider,
ip_restrictions,
last_modified,
lookback_hops,
modified_at,
regions,
require_tls_inbound,
require_tls_outbound,
spf_status,
status,
transport
FROM cloudflare.email_security.domains
WHERE account_id = '{{ account_id }}' -- required
AND domain_id = '{{ domain_id }}' -- required
;

UPDATE examples

Updates configuration for a protected email domain. Only provided fields will be modified. Changes affect delivery mode, security settings, and regional processing.

UPDATE cloudflare.email_security.domains
SET
allowed_delivery_modes = '{{ allowed_delivery_modes }}',
domain = '{{ domain }}',
drop_dispositions = '{{ drop_dispositions }}',
folder = '{{ folder }}',
integration_id = '{{ integration_id }}',
ip_restrictions = '{{ ip_restrictions }}',
lookback_hops = {{ lookback_hops }},
regions = '{{ regions }}',
require_tls_inbound = {{ require_tls_inbound }},
require_tls_outbound = {{ require_tls_outbound }},
transport = '{{ transport }}'
WHERE
account_id = '{{ account_id }}' --required
AND domain_id = '{{ domain_id }}' --required
RETURNING
errors,
messages,
result,
success;

DELETE examples

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.

DELETE FROM cloudflare.email_security.domains
WHERE account_id = '{{ account_id }}' --required
AND domain_id = '{{ domain_id }}' --required
;