---
title: Precursor
---

[Skip to content](#%5Ftop) 

[API Reference](https://developers.cloudflare.com/api/go)

Copy Markdown

Open in **Claude**

Open in **ChatGPT**

Open in **Cursor**

---

**Copy Markdown**

**View as Markdown**

# Precursor

##### [Get Zone Precursor Config](https://developers.cloudflare.com/api/go/resources/precursor/methods/get)

client.Precursor.Get(ctx, query) (\*[PrecursorConfig](https://developers.cloudflare.com/api/go/resources/precursor#%28resource%29%20precursor%20%3E%20%28model%29%20precursor%5Fconfig%20%3E%20%28schema%29), error)

GET/zones/{zone\_id}/precursor

##### [Update Zone Precursor Config](https://developers.cloudflare.com/api/go/resources/precursor/methods/update)

client.Precursor.Update(ctx, params) (\*[PrecursorConfig](https://developers.cloudflare.com/api/go/resources/precursor#%28resource%29%20precursor%20%3E%20%28model%29%20precursor%5Fconfig%20%3E%20%28schema%29), error)

PUT/zones/{zone\_id}/precursor

##### ModelsExpand Collapse 

type EnforcementRule struct{…}

Expression string

The filter expression that determines which requests the rule matches.

maxLength4000

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{…}

DeprecatedDefaultMode 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"

DeprecatedEnforcementRules \[\][EnforcementRule](https://developers.cloudflare.com/api/go/resources/precursor#%28resource%29%20precursor%20%3E%20%28model%29%20enforcement%5Frule%20%3E%20%28schema%29)Optional

The ordered list of enforcement rules for the zone.

Expression string

The filter expression that determines which requests the rule matches.

maxLength4000

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.