Skip to content
Start here

Precursor

Get Zone Precursor Config
precursor.get(PrecursorGetParams**kwargs) -> PrecursorConfig
GET/zones/{zone_id}/precursor
Update Zone Precursor Config
precursor.update(PrecursorUpdateParams**kwargs) -> PrecursorConfig
PUT/zones/{zone_id}/precursor
ModelsExpand Collapse
class EnforcementRule:
expression: str

The filter expression that determines which requests the rule matches.

mode: Literal["min-friction", "max-security"]

The override mode Precursor applies to requests matching an enforcement rule. Unlike default_mode, this cannot be off.

One of the following:
"min-friction"
"max-security"
id: Optional[str]

The read-only identifier that Cloudflare assigns to the rule.

description: Optional[str]

An informative description of the rule.

enabled: Optional[bool]

Whether the rule is active.

class PrecursorConfig:
default_mode: Optional[Literal["off", "min-friction", "max-security"]]

The zone-level Precursor enforcement mode applied to requests that do not match a more specific enforcement rule.

One of the following:
"off"
"min-friction"
"max-security"
enforcement_rules: Optional[List[EnforcementRule]]

The ordered list of enforcement rules for the zone.

expression: str

The filter expression that determines which requests the rule matches.

mode: Literal["min-friction", "max-security"]

The override mode Precursor applies to requests matching an enforcement rule. Unlike default_mode, this cannot be off.

One of the following:
"min-friction"
"max-security"
id: Optional[str]

The read-only identifier that Cloudflare assigns to the rule.

description: Optional[str]

An informative description of the rule.

enabled: Optional[bool]

Whether the rule is active.