Create email scanner rule
POST/accounts/{account_id}/dlp/email/rules
Creates a new DLP email scanning rule that defines what content patterns to detect in email messages and what actions to take.
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:
Accepted Permissions (at least one required)
Create email scanner rule
curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/dlp/email/rules \
-H 'Content-Type: application/json' \
-H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
-d '{
"action": {
"action": "Block"
},
"conditions": [
{
"operator": "InList",
"selector": "Recipients",
"value": [
"string"
]
}
],
"enabled": true,
"name": "name"
}'{
"errors": [
{
"code": 1000,
"message": "message",
"documentation_url": "documentation_url",
"source": {
"pointer": "pointer"
}
}
],
"messages": [
{
"code": 1000,
"message": "message",
"documentation_url": "documentation_url",
"source": {
"pointer": "pointer"
}
}
],
"success": true,
"result": {
"action": {
"action": "Block",
"message": "message"
},
"conditions": [
{
"operator": "InList",
"selector": "Recipients",
"value": [
"string"
]
}
],
"created_at": "2019-12-27T18:11:19.117Z",
"enabled": true,
"name": "name",
"priority": 0,
"rule_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"updated_at": "2019-12-27T18:11:19.117Z",
"description": "description"
}
}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"
}
}
],
"success": true,
"result": {
"action": {
"action": "Block",
"message": "message"
},
"conditions": [
{
"operator": "InList",
"selector": "Recipients",
"value": [
"string"
]
}
],
"created_at": "2019-12-27T18:11:19.117Z",
"enabled": true,
"name": "name",
"priority": 0,
"rule_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"updated_at": "2019-12-27T18:11:19.117Z",
"description": "description"
}
}