Bulk import account Email Sending suppressions
client.emailSending.suppressions.import(SuppressionImportParams { account_id, items } params, RequestOptionsoptions?): SuppressionImportResponse { deduplicated, errors, invalid, 4 more }
POST/accounts/{account_id}/email/sending/suppressions/bulk
Imports up to 1,000 Email Sending suppressions in one request. Each item applies to every sending domain of the account (default) or to one sending domain.
Security
API Token
The preferred authorization scheme for interacting with the Cloudflare API. Create a token.
Example:
API Email + API Key
The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.
Example:
The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.
Example:
Bulk import account Email Sending suppressions
import Cloudflare from 'cloudflare';
const client = new Cloudflare({
apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted
});
const response = await client.emailSending.suppressions.import({
account_id: '12345678',
items: [{ email: 'user@example.com' }, { email: 'other@example.com' }],
});
console.log(response.invalid);{
"errors": [
{}
],
"messages": [
{}
],
"result": {
"deduplicated": 1,
"errors": 0,
"invalid": 1,
"items": [
{
"index": 0,
"status": "processed",
"id": "396a5436-d4b0-42a6-b3fc-48e8fa522321",
"email": "user@example.com",
"error": "Invalid email",
"scope": {
"type": "sending_domain",
"value": "mail.example.com"
}
}
],
"processed": 2,
"skipped": 0,
"total": 4
},
"success": true
}Returns Examples
{
"errors": [
{}
],
"messages": [
{}
],
"result": {
"deduplicated": 1,
"errors": 0,
"invalid": 1,
"items": [
{
"index": 0,
"status": "processed",
"id": "396a5436-d4b0-42a6-b3fc-48e8fa522321",
"email": "user@example.com",
"error": "Invalid email",
"scope": {
"type": "sending_domain",
"value": "mail.example.com"
}
}
],
"processed": 2,
"skipped": 0,
"total": 4
},
"success": true
}