Skip to content
Start here

List blocked email senders

client.emailSecurity.settings.blockSenders.list(BlockSenderListParams { account_id, direction, order, 5 more } params, RequestOptionsoptions?): V4PagePaginationArray<BlockSenderListResponse { id, created_at, is_regex, 4 more } >
GET/accounts/{account_id}/email-security/settings/block_senders

Lists all blocked sender entries with their patterns and block reasons.

Security

API Email + API Key

The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.

Example:X-Auth-Email: user@example.com

The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.

Example:X-Auth-Key: 144c9defac04969c7bfad8efaa8ea194
Accepted Permissions (at least one required)
Cloud Email Security: WriteCloud Email Security: Read
ParametersExpand Collapse
params: BlockSenderListParams { account_id, direction, order, 5 more }
account_id: string

Path param: Account Identifier

maxLength32
minLength32
direction?: "asc" | "desc"

Query param: The sorting direction.

One of the following:
"asc"
"desc"
order?: "pattern" | "created_at"

Query param: The field to sort by.

One of the following:
"pattern"
"created_at"
page?: number

Query param: The page number of paginated results.

formatint32
minimum1
pattern?: string

Query param

pattern_type?: "EMAIL" | "DOMAIN" | "IP" | "UNKNOWN"

Query param

One of the following:
"EMAIL"
"DOMAIN"
"IP"
"UNKNOWN"
per_page?: number

Query param: The number of results per page.

formatint32
minimum1
ReturnsExpand Collapse
BlockSenderListResponse { id, created_at, is_regex, 4 more }
id: number

The unique identifier for the allow policy.

formatint32
created_at: string
formatdate-time
is_regex: boolean
last_modified: string
formatdate-time
pattern: string
maxLength1024
minLength1
pattern_type: "EMAIL" | "DOMAIN" | "IP" | "UNKNOWN"
One of the following:
"EMAIL"
"DOMAIN"
"IP"
"UNKNOWN"
comments?: string | null
maxLength1024

List blocked email senders

import Cloudflare from 'cloudflare';

const client = new Cloudflare({
  apiEmail: process.env['CLOUDFLARE_EMAIL'], // This is the default and can be omitted
  apiKey: process.env['CLOUDFLARE_API_KEY'], // This is the default and can be omitted
});

// Automatically fetches more pages as needed.
for await (const blockSenderListResponse of client.emailSecurity.settings.blockSenders.list({
  account_id: '023e105f4ecef8ad9ca31a8372d0c353',
})) {
  console.log(blockSenderListResponse.id);
}
{
  "errors": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "result": [
    {
      "id": 2402,
      "created_at": "2019-12-27T18:11:19.117Z",
      "is_regex": true,
      "last_modified": "2019-12-27T18:11:19.117Z",
      "pattern": "x",
      "pattern_type": "EMAIL",
      "comments": "comments"
    }
  ],
  "result_info": {
    "count": 1,
    "page": 1,
    "per_page": 20,
    "total_count": 2000
  },
  "success": true
}
Returns Examples
{
  "errors": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "result": [
    {
      "id": 2402,
      "created_at": "2019-12-27T18:11:19.117Z",
      "is_regex": true,
      "last_modified": "2019-12-27T18:11:19.117Z",
      "pattern": "x",
      "pattern_type": "EMAIL",
      "comments": "comments"
    }
  ],
  "result_info": {
    "count": 1,
    "page": 1,
    "per_page": 20,
    "total_count": 2000
  },
  "success": true
}