PUT /zones/{zone_id}/precursor
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.
- Sending an empty array (
[]) clears all enforcement rules. - At least one of
default_modeorenforcement_rulesmust be present; an empty body ({}) is rejected with400. - Rule
idis read-only (assigned by Cloudflare) and ignored on input. - Rule
modemust bemin-frictionormax-security(offis not a valid rule mode; usedefault_modeto disable enforcement).
Servers
- https://api.cloudflare.com/client/v4
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
zone_id |
String | Yes |
Request headers
| Name | Type | Required | Description |
|---|---|---|---|
Content-Type |
String | Yes |
The media type of the request body.
Default value: "application/json" |
Request body fields
| Name | Type | Required | Description |
|---|---|---|---|
default_mode |
String | No |
The zone-level Precursor enforcement mode applied to requests that do not match a more specific enforcement rule. Valid values:
Default value: "off" |
enforcement_rules[] |
Array | No |
The ordered list of enforcement rules for the zone. |
enforcement_rules[].id |
String | No |
The read-only identifier that Cloudflare assigns to the rule. |
enforcement_rules[].description |
String | No |
An informative description of the rule. |
enforcement_rules[].expression |
String | Yes |
The filter expression that determines which requests the rule matches. |
enforcement_rules[].enabled |
Boolean | No |
Whether the rule is active. Default value: true |
enforcement_rules[].mode |
String | Yes |
The override mode Precursor applies to requests matching an enforcement
rule. Unlike Valid values:
|
How to start integrating
- Add HTTP Task to your workflow definition.
- Search for the API you want to integrate with and click on the name.
- This loads the API reference documentation and prepares the Http request settings.
- Click Test request to test run your request to the API and see the API's response.