Skip to content
Start here

Delete a trusted email domain

email_security.settings.trusted_domains.delete(inttrusted_domain_id, TrustedDomainDeleteParams**kwargs) -> TrustedDomainDeleteResponse
DELETE/accounts/{account_id}/email-security/settings/trusted_domains/{trusted_domain_id}

Removes a domain from the trusted domains list, subjecting it to normal security scanning.

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: Write
ParametersExpand Collapse
account_id: str

Account Identifier

maxLength32
minLength32
trusted_domain_id: int

The unique identifier for the trusted domain.

formatint32
ReturnsExpand Collapse
class TrustedDomainDeleteResponse:
id: int

The unique identifier for the trusted domain.

formatint32

Delete a trusted email domain

import os
from cloudflare import Cloudflare

client = Cloudflare(
    api_email=os.environ.get("CLOUDFLARE_EMAIL"),  # This is the default and can be omitted
    api_key=os.environ.get("CLOUDFLARE_API_KEY"),  # This is the default and can be omitted
)
trusted_domain = client.email_security.settings.trusted_domains.delete(
    trusted_domain_id=2401,
    account_id="023e105f4ecef8ad9ca31a8372d0c353",
)
print(trusted_domain.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": 2401
  },
  "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": 2401
  },
  "success": true
}