block_senders
Creates, updates, deletes, gets or lists a block_senders resource.
Overview
| Name | block_senders |
| Type | Resource |
| Id | cloudflare.email_security.block_senders |
Fields
The following fields are returned by SELECT queries:
- get
- list
Blocked sender details
| Name | Datatype | Description |
|---|---|---|
id | string (uuid) | Blocked sender pattern identifier (example: f174e90a-fafe-4643-bbbc-4a0ed4fc8415) |
comments | string | (example: Block sender with email test@example.com) |
created_at | string (date-time) | (example: 2014-01-01T05:20:00.12345Z) |
is_regex | boolean | |
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: test@example.com) |
pattern_type | string | Type of pattern matching. Note: UNKNOWN is deprecated and cannot be used when creating or updating policies, but may be returned for existing entries. (EMAIL, DOMAIN, IP, UNKNOWN) (example: EMAIL) |
List of blocked senders
| Name | Datatype | Description |
|---|---|---|
id | string (uuid) | Blocked sender pattern identifier (example: f174e90a-fafe-4643-bbbc-4a0ed4fc8415) |
comments | string | (example: Block sender with email test@example.com) |
created_at | string (date-time) | (example: 2014-01-01T05:20:00.12345Z) |
is_regex | boolean | |
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: test@example.com) |
pattern_type | string | Type of pattern matching. Note: UNKNOWN is deprecated and cannot be used when creating or updating policies, but may be returned for existing entries. (EMAIL, DOMAIN, IP, UNKNOWN) (example: EMAIL) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | account_id, pattern_id | Retrieves details for a specific blocked sender pattern including its pattern type, value, and metadata. | |
list | select | account_id | page, per_page, search, order, direction, pattern_type, pattern | 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. |
create | insert | account_id | 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. | |
edit | update | account_id, pattern_id | Updates an existing blocked sender pattern. Only provided fields will be modified. The pattern will continue blocking emails until deleted. | |
delete | delete | account_id, pattern_id | Removes a blocked sender pattern. After deletion, emails from this sender will no longer be automatically blocked based on this rule. | |
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. |
pattern_id | string (uuid) | |
direction | string | The sorting direction. |
order | string | Field to sort by. |
page | integer | Current page within paginated list of results. |
pattern | string | Filter by pattern value. |
pattern_type | string | Filter by pattern type. |
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 blocked sender pattern including its pattern type, value, and metadata.
SELECT
id,
comments,
created_at,
is_regex,
last_modified,
modified_at,
pattern,
pattern_type
FROM cloudflare.email_security.block_senders
WHERE account_id = '{{ account_id }}' -- required
AND pattern_id = '{{ pattern_id }}' -- required
;
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.
SELECT
id,
comments,
created_at,
is_regex,
last_modified,
modified_at,
pattern,
pattern_type
FROM cloudflare.email_security.block_senders
WHERE account_id = '{{ account_id }}' -- required
AND page = '{{ page }}'
AND per_page = '{{ per_page }}'
AND search = '{{ search }}'
AND order = '{{ order }}'
AND direction = '{{ direction }}'
AND pattern_type = '{{ pattern_type }}'
AND pattern = '{{ pattern }}'
;
INSERT examples
- create
- Manifest
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.
INSERT INTO cloudflare.email_security.block_senders (
comments,
is_regex,
pattern,
pattern_type,
account_id
)
SELECT
'{{ comments }}',
{{ is_regex }},
'{{ pattern }}',
'{{ pattern_type }}',
'{{ account_id }}'
RETURNING
errors,
messages,
result,
success
;
# Description fields are for documentation purposes
- name: block_senders
props:
- name: account_id
value: "{{ account_id }}"
description: Required parameter for the block_senders resource.
- name: comments
value: "{{ comments }}"
- name: is_regex
value: {{ is_regex }}
- name: pattern
value: "{{ pattern }}"
- name: pattern_type
value: "{{ pattern_type }}"
description: |
Type of pattern matching. Note: UNKNOWN is deprecated and cannot be used when creating or updating policies, but may be returned for existing entries.
valid_values: ['EMAIL', 'DOMAIN', 'IP', 'UNKNOWN']
UPDATE examples
- edit
Updates an existing blocked sender pattern. Only provided fields will be modified. The pattern will continue blocking emails until deleted.
UPDATE cloudflare.email_security.block_senders
SET
comments = '{{ comments }}',
is_regex = {{ is_regex }},
pattern = '{{ pattern }}',
pattern_type = '{{ pattern_type }}'
WHERE
account_id = '{{ account_id }}' --required
AND pattern_id = '{{ pattern_id }}' --required
RETURNING
errors,
messages,
result,
success;
DELETE examples
- delete
Removes a blocked sender pattern. After deletion, emails from this sender will no longer be automatically blocked based on this rule.
DELETE FROM cloudflare.email_security.block_senders
WHERE account_id = '{{ account_id }}' --required
AND pattern_id = '{{ pattern_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.block_senders.batch
@account_id='{{ account_id }}' --required
@@json=
'{
"deletes": "{{ deletes }}",
"patches": "{{ patches }}",
"posts": "{{ posts }}",
"puts": "{{ puts }}"
}'
;