---
title: Get Zone Precursor Config
---

[Skip to content](#%5Ftop) 

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

[Precursor](https://developers.cloudflare.com/api/go/resources/precursor)

Copy Markdown

Open in **Claude**

Open in **ChatGPT**

Open in **Cursor**

---

**Copy Markdown**

**View as Markdown**

# Get Zone Precursor Config

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

Retrieve a zone’s Precursor configuration: the zone-level `default_mode` and the ordered list of `enforcement_rules`.

##### Security

API Token

The preferred authorization scheme for interacting with the Cloudflare API. [Create a token](https://developers.cloudflare.com/fundamentals/api/get-started/create-token/).

**Example:**`Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY`

API Email + API Key

The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.

**Example:**`X-Auth-Email: user@example.com`

The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.

**Example:**`X-Auth-Key: 144c9defac04969c7bfad8efaa8ea194`

##### ParametersExpand Collapse 

query PrecursorGetParams

ZoneID param.Field\[string\]

Identifier.

maxLength32

##### ReturnsExpand Collapse 

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.

### Get Zone Precursor Config

Go

HTTPHTTP

TypeScriptTypeScript

PythonPython

GoGo

TerraformTerraform

```
package main

import (
  "context"
  "fmt"

  "github.com/cloudflare/cloudflare-go"
  "github.com/cloudflare/cloudflare-go/option"
  "github.com/cloudflare/cloudflare-go/precursor"
)

func main() {
  client := cloudflare.NewClient(
    option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"),
  )
  precursorConfig, err := client.Precursor.Get(context.TODO(), precursor.PrecursorGetParams{
    ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", precursorConfig.DefaultMode)
}

```

200 example

```
{
  "errors": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "success": true,
  "result": {
    "default_mode": "min-friction",
    "enforcement_rules": [
      {
        "expression": "http.request.uri.path eq \"/shop\"",
        "mode": "max-security",
        "id": "3a03d665bac043e3a684e0d385a4b1e2",
        "description": "Enforce max-security on the shop page",
        "enabled": true
      }
    ]
  }
}
```

##### Returns Examples

200 example

```
{
  "errors": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "success": true,
  "result": {
    "default_mode": "min-friction",
    "enforcement_rules": [
      {
        "expression": "http.request.uri.path eq \"/shop\"",
        "mode": "max-security",
        "id": "3a03d665bac043e3a684e0d385a4b1e2",
        "description": "Enforce max-security on the shop page",
        "enabled": true
      }
    ]
  }
}
```