Skip to main content

sending_domain_restrictions

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

Overview

Namesending_domain_restrictions
TypeResource
Idcloudflare.email_security.sending_domain_restrictions

Fields

The following fields are returned by SELECT queries:

Sending domain restriction details

NameDatatypeDescription
idstring (uuid)Sending domain restriction identifier. (example: f174e90a-fafe-4643-bbbc-4a0ed4fc8415, title: identifier)
commentsstring (example: Enforce TLS for all mail from this domain)
created_atstring (date-time) (example: 2014-01-01T05:20:00.12345Z)
domainstringDomain that requires TLS enforcement. (example: example.com)
excludearrayExcluded subdomains that are exempt from TLS requirements.
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)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectaccount_id, sending_domain_restriction_idRetrieves details for a specific sending domain restriction including the domain requiring TLS and any excluded subdomains exempt from the TLS requirement.
listselectaccount_idpage, per_page, search, order, directionReturns 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.
email_security_create_sending_domain_restrictioninsertaccount_idCreates 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.
email_security_update_sending_domain_restrictionupdateaccount_id, sending_domain_restriction_idUpdates an existing sending domain restriction. Only provided fields will be modified. Changes affect which domains require TLS and which subdomains are excluded.
email_security_delete_sending_domain_restrictiondeleteaccount_id, sending_domain_restriction_idRemoves a sending domain restriction. After deletion, TLS will no longer be enforced for emails from this domain.
batchexecaccount_id, deletesExecutes multiple delete operations on sending domain restrictions atomically. All operations succeed or fail together as a transaction. Currently only supports batch deletion. Removes TLS enforcement requirements for the specified domains.

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.
sending_domain_restriction_idstring (uuid)
directionstringThe sorting direction.
orderstringField to sort by.
pageintegerCurrent page within paginated list of results.
per_pageintegerThe number of results per page. Maximum value is 1000.

SELECT examples

Retrieves details for a specific sending domain restriction including the domain requiring TLS and any excluded subdomains exempt from the TLS requirement.

SELECT
id,
comments,
created_at,
domain,
exclude,
last_modified,
modified_at
FROM cloudflare.email_security.sending_domain_restrictions
WHERE account_id = '{{ account_id }}' -- required
AND sending_domain_restriction_id = '{{ sending_domain_restriction_id }}' -- required
;

INSERT examples

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.

INSERT INTO cloudflare.email_security.sending_domain_restrictions (
comments,
domain,
exclude,
account_id
)
SELECT
'{{ comments }}',
'{{ domain }}',
'{{ exclude }}',
'{{ account_id }}'
RETURNING
errors,
messages,
result,
success
;

UPDATE examples

Updates an existing sending domain restriction. Only provided fields will be modified. Changes affect which domains require TLS and which subdomains are excluded.

UPDATE cloudflare.email_security.sending_domain_restrictions
SET
comments = '{{ comments }}',
domain = '{{ domain }}',
exclude = '{{ exclude }}'
WHERE
account_id = '{{ account_id }}' --required
AND sending_domain_restriction_id = '{{ sending_domain_restriction_id }}' --required
RETURNING
errors,
messages,
result,
success;

DELETE examples

Removes a sending domain restriction. After deletion, TLS will no longer be enforced for emails from this domain.

DELETE FROM cloudflare.email_security.sending_domain_restrictions
WHERE account_id = '{{ account_id }}' --required
AND sending_domain_restriction_id = '{{ sending_domain_restriction_id }}' --required
;

Lifecycle Methods

Executes multiple delete operations on sending domain restrictions atomically. All operations succeed or fail together as a transaction. Currently only supports batch deletion. Removes TLS enforcement requirements for the specified domains.

EXEC cloudflare.email_security.sending_domain_restrictions.batch
@account_id='{{ account_id }}' --required
@@json=
'{
"deletes": "{{ deletes }}"
}'
;