Skip to content
Start here

Update a trusted email domain

PATCH/accounts/{account_id}/email-security/settings/trusted_domains/{trusted_domain_id}

Modifies a trusted domain entry’s configuration.

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
Path ParametersExpand Collapse
account_id: string

Account Identifier

maxLength32
minLength32
trusted_domain_id: number

The unique identifier for the trusted domain.

formatint32
Body ParametersJSONExpand Collapse
comments: optional string
maxLength1024
is_recent: optional boolean

Select to prevent recently registered domains from triggering a Suspicious or Malicious disposition.

is_regex: optional boolean
is_similarity: optional boolean

Select for partner or other approved domains that have similar spelling to your connected domains. Prevents listed domains from triggering a Spoof disposition.

pattern: optional string
maxLength1024
minLength1
ReturnsExpand Collapse
errors: array of ResponseInfo { code, message, documentation_url, source }
code: number
minimum1000
message: string
documentation_url: optional string
source: optional { pointer }
pointer: optional string
messages: array of ResponseInfo { code, message, documentation_url, source }
code: number
minimum1000
message: string
documentation_url: optional string
source: optional { pointer }
pointer: optional string
result: { id, created_at, is_recent, 5 more }
id: number

The unique identifier for the trusted domain.

formatint32
created_at: string
formatdate-time
is_recent: boolean

Select to prevent recently registered domains from triggering a Suspicious or Malicious disposition.

is_regex: boolean
is_similarity: boolean

Select for partner or other approved domains that have similar spelling to your connected domains. Prevents listed domains from triggering a Spoof disposition.

last_modified: string
formatdate-time
pattern: string
maxLength1024
minLength1
comments: optional string
maxLength1024
success: boolean

Update a trusted email domain

curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/email-security/settings/trusted_domains/$TRUSTED_DOMAIN_ID \
    -X PATCH \
    -H 'Content-Type: application/json' \
    -H "X-Auth-Email: $CLOUDFLARE_EMAIL" \
    -H "X-Auth-Key: $CLOUDFLARE_API_KEY" \
    -d '{}'
{
  "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,
    "created_at": "2019-12-27T18:11:19.117Z",
    "is_recent": true,
    "is_regex": true,
    "is_similarity": true,
    "last_modified": "2019-12-27T18:11:19.117Z",
    "pattern": "x",
    "comments": "comments"
  },
  "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,
    "created_at": "2019-12-27T18:11:19.117Z",
    "is_recent": true,
    "is_regex": true,
    "is_similarity": true,
    "last_modified": "2019-12-27T18:11:19.117Z",
    "pattern": "x",
    "comments": "comments"
  },
  "success": true
}