| [ Web Proxy ] |
| Viewing: https://developers.cloudflare.com/api/resources/precursor/methods/update | [Back] [Original] |
Updates the Precursor configuration for a zone.
default_mode sets the zone-level enforcement mode. enforcement_rules
is the ordered list of rules that override enforcement for matching
requests.
This is a partial update: only the fields present in the request body are changed.
[]) clears all enforcement rules.default_mode or enforcement_rules must be present;
an empty body ({}) is rejected with 400.id is read-only (assigned by Cloudflare) and ignored on input.mode must be min-friction or max-security (off is not a
valid rule mode; use default_mode to disable enforcement).The preferred authorization scheme for interacting with the Cloudflare API. Create a token.
Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYYThe previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.
X-Auth-Email: user@example.comThe previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.
X-Auth-Key: 144c9defac04969c7bfad8efaa8ea194The zone-level Precursor enforcement mode applied to requests that do not match a more specific enforcement rule.
The zone-level Precursor enforcement mode applied to requests that do not match a more specific enforcement rule.
curl https://api.cloudflare.com/client/v4/zones/$ZONE_ID/precursor \
-X PUT \
-H 'Content-Type: application/json' \
-H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
-d '{
"default_mode": "min-friction"
}'{
"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": {
"default_mode": "min-friction",
"enforcement_rules": [
{
"expression": "http.request.uri.path eq \"/shop\"",
"mode": "max-security",
"id": "3a03d665bac043e3a684e0d385a4b1e2",
"description": "Enforce max-security on the shop page",
"enabled": true
}
]
}
}{
"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": {
"default_mode": "min-friction",
"enforcement_rules": [
{
"expression": "http.request.uri.path eq \"/shop\"",
"mode": "max-security",
"id": "3a03d665bac043e3a684e0d385a4b1e2",
"description": "Enforce max-security on the shop page",
"enabled": true
}
]
}
}| Web Proxy Viewer | New URL | Original Page |