---
title: Precursor
---

[Skip to content](#_top)

[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#(resource)%20precursor%20%3E%20(model)%20precursor_config%20%3E%20(schema)>), 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#(resource)%20precursor%20%3E%20(model)%20precursor_config%20%3E%20(schema)>), error)

PUT/zones/{zone\_id}/precursor

##### ModelsExpand Collapse

<details>

<summary>

type EnforcementRule struct{…}

</summary>

Expression string

The filter expression that determines which requests the rule matches.

maxLength4000

<a href="#(resource)%20precursor%20%3E%20(model)%20enforcement_rule%20%3E%20(schema)%20%3E%20(property)%20expression">Link to this property</a>

<details>

<summary>

Mode EnforcementRuleMode

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

</summary>

One of the following:

const EnforcementRuleModeMinFriction EnforcementRuleMode = "min-friction"

<a href="#(resource)%20precursor%20%3E%20(model)%20enforcement_rule%20%3E%20(schema)%20%3E%20(property)%20mode%20%3E%20(member)%200">Link to this property</a>

const EnforcementRuleModeMaxSecurity EnforcementRuleMode = "max-security"

<a href="#(resource)%20precursor%20%3E%20(model)%20enforcement_rule%20%3E%20(schema)%20%3E%20(property)%20mode%20%3E%20(member)%201">Link to this property</a>

</details>

<a href="#(resource)%20precursor%20%3E%20(model)%20enforcement_rule%20%3E%20(schema)%20%3E%20(property)%20mode">Link to this property</a>

ID stringOptional

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

<a href="#(resource)%20precursor%20%3E%20(model)%20enforcement_rule%20%3E%20(schema)%20%3E%20(property)%20id">Link to this property</a>

Description stringOptional

An informative description of the rule.

<a href="#(resource)%20precursor%20%3E%20(model)%20enforcement_rule%20%3E%20(schema)%20%3E%20(property)%20description">Link to this property</a>

Enabled boolOptional

Whether the rule is active.

<a href="#(resource)%20precursor%20%3E%20(model)%20enforcement_rule%20%3E%20(schema)%20%3E%20(property)%20enabled">Link to this property</a>

</details>

[Link to this property](<#(resource)%20precursor%20%3E%20(model)%20enforcement_rule%20%3E%20(schema)>)

<details>

<summary>

type PrecursorConfig struct{…}

</summary>

<details>

<summary>

DeprecatedDefaultMode PrecursorConfigDefaultModeOptional

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

</summary>

One of the following:

const PrecursorConfigDefaultModeOff PrecursorConfigDefaultMode = "off"

<a href="#(resource)%20precursor%20%3E%20(model)%20precursor_config%20%3E%20(schema)%20%3E%20(property)%20default_mode%20%3E%20(member)%200">Link to this property</a>

const PrecursorConfigDefaultModeMinFriction PrecursorConfigDefaultMode = "min-friction"

<a href="#(resource)%20precursor%20%3E%20(model)%20precursor_config%20%3E%20(schema)%20%3E%20(property)%20default_mode%20%3E%20(member)%201">Link to this property</a>

const PrecursorConfigDefaultModeMaxSecurity PrecursorConfigDefaultMode = "max-security"

<a href="#(resource)%20precursor%20%3E%20(model)%20precursor_config%20%3E%20(schema)%20%3E%20(property)%20default_mode%20%3E%20(member)%202">Link to this property</a>

</details>

<a href="#(resource)%20precursor%20%3E%20(model)%20precursor_config%20%3E%20(schema)%20%3E%20(property)%20default_mode">Link to this property</a>

<details>

<summary>

DeprecatedEnforcementRules \[]<a href="https://developers.cloudflare.com/api/go/resources/precursor#(resource)%20precursor%20%3E%20(model)%20enforcement_rule%20%3E%20(schema)">EnforcementRule</a>Optional

The ordered list of enforcement rules for the zone.

</summary>

Expression string

The filter expression that determines which requests the rule matches.

maxLength4000

<a href="#(resource)%20precursor%20%3E%20(model)%20enforcement_rule%20%3E%20(schema)%20%3E%20(property)%20expression">Link to this property</a>

<details>

<summary>

Mode EnforcementRuleMode

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

</summary>

One of the following:

const EnforcementRuleModeMinFriction EnforcementRuleMode = "min-friction"

<a href="#(resource)%20precursor%20%3E%20(model)%20enforcement_rule%20%3E%20(schema)%20%3E%20(property)%20mode%20%3E%20(member)%200">Link to this property</a>

const EnforcementRuleModeMaxSecurity EnforcementRuleMode = "max-security"

<a href="#(resource)%20precursor%20%3E%20(model)%20enforcement_rule%20%3E%20(schema)%20%3E%20(property)%20mode%20%3E%20(member)%201">Link to this property</a>

</details>

<a href="#(resource)%20precursor%20%3E%20(model)%20enforcement_rule%20%3E%20(schema)%20%3E%20(property)%20mode">Link to this property</a>

ID stringOptional

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

<a href="#(resource)%20precursor%20%3E%20(model)%20enforcement_rule%20%3E%20(schema)%20%3E%20(property)%20id">Link to this property</a>

Description stringOptional

An informative description of the rule.

<a href="#(resource)%20precursor%20%3E%20(model)%20enforcement_rule%20%3E%20(schema)%20%3E%20(property)%20description">Link to this property</a>

Enabled boolOptional

Whether the rule is active.

<a href="#(resource)%20precursor%20%3E%20(model)%20enforcement_rule%20%3E%20(schema)%20%3E%20(property)%20enabled">Link to this property</a>

</details>

<a href="#(resource)%20precursor%20%3E%20(model)%20precursor_config%20%3E%20(schema)%20%3E%20(property)%20enforcement_rules">Link to this property</a>

</details>

[Link to this property](<#(resource)%20precursor%20%3E%20(model)%20precursor_config%20%3E%20(schema)>)