Update Fraud Detection Settings
PUT/zones/{zone_id}/fraud_detection/settings
Update Fraud Detection settings for a zone.
Notes on username_expressions behavior:
- If omitted or set to null, expressions are not modified.
- If provided as an empty array
[], all expressions will be cleared.
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)
Body ParametersJSON
username_expressions: optional array of string
List of expressions to detect usernames in write HTTP requests.
- Maximum of 10 expressions.
- Omit or set to null to leave unchanged on update.
- Provide an empty array
[]to clear all expressions on update. - Invalid expressions will result in a 10400 Bad Request with details in the
messagesarray.
Update Fraud Detection Settings
curl https://api.cloudflare.com/client/v4/zones/$ZONE_ID/fraud_detection/settings \
-X PUT \
-H 'Content-Type: application/json' \
-H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
-d '{
"user_profiles": "disabled",
"username_expressions": [
"string"
]
}'{
"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": {
"user_profiles": "disabled",
"username_expressions": [
"http.request.body.form[\"username\"][0]",
"lookup_json_string(http.request.body.raw, \"username\")"
]
}
}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": {
"user_profiles": "disabled",
"username_expressions": [
"http.request.body.form[\"username\"][0]",
"lookup_json_string(http.request.body.raw, \"username\")"
]
}
}