Skip to content
Start here

Precursor

Get Zone Precursor Config
client.Precursor.Get(ctx, query) (*PrecursorConfig, error)
GET/zones/{zone_id}/precursor
Update Zone Precursor Config
client.Precursor.Update(ctx, params) (*PrecursorConfig, error)
PUT/zones/{zone_id}/precursor
ModelsExpand Collapse
type EnforcementRule struct{…}
Expression string

The filter expression that determines which requests the rule matches.

Mode EnforcementRuleMode

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

One of the following:
const EnforcementRuleModeMinFriction EnforcementRuleMode = "min-friction"
const EnforcementRuleModeMaxSecurity EnforcementRuleMode = "max-security"
ID stringOptional

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

Description stringOptional

An informative description of the rule.

Enabled boolOptional

Whether the rule is active.

type PrecursorConfig struct{…}
DefaultMode PrecursorConfigDefaultModeOptional

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

One of the following:
const PrecursorConfigDefaultModeOff PrecursorConfigDefaultMode = "off"
const PrecursorConfigDefaultModeMinFriction PrecursorConfigDefaultMode = "min-friction"
const PrecursorConfigDefaultModeMaxSecurity PrecursorConfigDefaultMode = "max-security"
EnforcementRules []EnforcementRuleOptional

The ordered list of enforcement rules for the zone.

Expression string

The filter expression that determines which requests the rule matches.

Mode EnforcementRuleMode

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

One of the following:
const EnforcementRuleModeMinFriction EnforcementRuleMode = "min-friction"
const EnforcementRuleModeMaxSecurity EnforcementRuleMode = "max-security"
ID stringOptional

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

Description stringOptional

An informative description of the rule.

Enabled boolOptional

Whether the rule is active.