---
title: Update Field Extractor
---

[Skip to content](#_top)

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

[Field Extractors](https://developers.cloudflare.com/api/go/resources/field_extractors)

Copy Markdown

Open in **Claude**Open in **ChatGPT**Open in **Cursor**

---

**Copy Markdown****View as Markdown**

# Update Field Extractor

client.FieldExtractors.Update(ctx, extractor, params) (\*[FieldExtractorUpdateResponse](<https://developers.cloudflare.com/api/go/resources/field_extractors#(resource)%20field_extractors%20%3E%20(model)%20FieldExtractorUpdateResponse%20%3E%20(schema)>), error)

PUT/accounts/{account\_id}/field\_extractors/{extractor}

Replaces all custom extraction rules for an extractor type. Omitted rules are deleted.

##### Security

<details>

<summary>API Token</summary>



The preferred authorization scheme for interacting with the Cloudflare API. <a href="https://developers.cloudflare.com/fundamentals/api/get-started/create-token/">Create a token</a>.

**Example:**<code>Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY</code>

</details>

<details>

<summary>API Email + API Key</summary>



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

**Example:**<code>X-Auth-Email: user@example.com</code>

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

**Example:**<code>X-Auth-Key: 144c9defac04969c7bfad8efaa8ea194</code>

</details>

##### ParametersExpand Collapse

extractor string

Extractor type.

minLength1

[Link to this property](<#(resource)%20field_extractors%20%3E%20(method)%20update%20%3E%20(params)%20default%20%3E%20(param)%20extractor%20%3E%20(schema)>)

<details>

<summary>

params FieldExtractorUpdateParams

</summary>

AccountID param.Field\[string]

Path param: Cloudflare account ID.

minLength1

<a href="#(resource)%20field_extractors%20%3E%20(method)%20update%20%3E%20(params)%20default%20%3E%20(param)%20account_id">Link to this property</a>

<details>

<summary>

Rules param.Field\[\[]FieldExtractorUpdateParamsRule]

Body param

</summary>

<details>

<summary>

Fields \[]FieldExtractorUpdateParamsRulesField

</summary>

Expression string

maxLength4096

minLength1

<a href="#(resource)%20field_extractors%20%3E%20(method)%20update%20%3E%20(params)%20default%20%3E%20(param)%20rules%20%3E%20(schema)%20%3E%20(items)%20%3E%20(property)%20fields%20%3E%20(items)%20%3E%20(property)%20expression">Link to this property</a>

Name string

minLength1

<a href="#(resource)%20field_extractors%20%3E%20(method)%20update%20%3E%20(params)%20default%20%3E%20(param)%20rules%20%3E%20(schema)%20%3E%20(items)%20%3E%20(property)%20fields%20%3E%20(items)%20%3E%20(property)%20name">Link to this property</a>

</details>

<a href="#(resource)%20field_extractors%20%3E%20(method)%20update%20%3E%20(params)%20default%20%3E%20(param)%20rules%20%3E%20(schema)%20%3E%20(items)%20%3E%20(property)%20fields">Link to this property</a>

Ref string

maxLength64

minLength1

<a href="#(resource)%20field_extractors%20%3E%20(method)%20update%20%3E%20(params)%20default%20%3E%20(param)%20rules%20%3E%20(schema)%20%3E%20(items)%20%3E%20(property)%20ref">Link to this property</a>

Description stringOptional

maxLength4096

<a href="#(resource)%20field_extractors%20%3E%20(method)%20update%20%3E%20(params)%20default%20%3E%20(param)%20rules%20%3E%20(schema)%20%3E%20(items)%20%3E%20(property)%20description">Link to this property</a>

</details>

<a href="#(resource)%20field_extractors%20%3E%20(method)%20update%20%3E%20(params)%20default%20%3E%20(param)%20rules">Link to this property</a>

</details>

[Link to this property](<#(resource)%20field_extractors%20%3E%20(method)%20update%20%3E%20(params)%20default>)

##### ReturnsExpand Collapse

<details>

<summary>

type FieldExtractorUpdateResponse struct{…}

</summary>

Extractor string

Extractor type.

<a href="#(resource)%20field_extractors%20%3E%20(model)%20FieldExtractorUpdateResponse%20%3E%20(schema)%20%3E%20(property)%20extractor">Link to this property</a>

<details>

<summary>

Rules \[]FieldExtractorUpdateResponseRule

</summary>

<details>

<summary>

Fields \[]FieldExtractorUpdateResponseRulesField

</summary>

Expression string

Wirefilter value expression.

<a href="#(resource)%20field_extractors%20%3E%20(model)%20FieldExtractorUpdateResponse%20%3E%20(schema)%20%3E%20(property)%20rules%20%3E%20(items)%20%3E%20(property)%20fields%20%3E%20(items)%20%3E%20(property)%20expression">Link to this property</a>

Name string

Field name.

<a href="#(resource)%20field_extractors%20%3E%20(model)%20FieldExtractorUpdateResponse%20%3E%20(schema)%20%3E%20(property)%20rules%20%3E%20(items)%20%3E%20(property)%20fields%20%3E%20(items)%20%3E%20(property)%20name">Link to this property</a>

</details>

<a href="#(resource)%20field_extractors%20%3E%20(model)%20FieldExtractorUpdateResponse%20%3E%20(schema)%20%3E%20(property)%20rules%20%3E%20(items)%20%3E%20(property)%20fields">Link to this property</a>

Ref string

Stable rule identifier.

<a href="#(resource)%20field_extractors%20%3E%20(model)%20FieldExtractorUpdateResponse%20%3E%20(schema)%20%3E%20(property)%20rules%20%3E%20(items)%20%3E%20(property)%20ref">Link to this property</a>

Description stringOptional

Human-readable rule description.

<a href="#(resource)%20field_extractors%20%3E%20(model)%20FieldExtractorUpdateResponse%20%3E%20(schema)%20%3E%20(property)%20rules%20%3E%20(items)%20%3E%20(property)%20description">Link to this property</a>

</details>

<a href="#(resource)%20field_extractors%20%3E%20(model)%20FieldExtractorUpdateResponse%20%3E%20(schema)%20%3E%20(property)%20rules">Link to this property</a>

</details>

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

### Update Field Extractor

Go

HTTPTypeScriptPythonGoTerraform

```
package main

import (
  "context"
  "fmt"

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

func main() {
  client := cloudflare.NewClient(
    option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"),
  )
  fieldExtractor, err := client.FieldExtractors.Update(
    context.TODO(),
    "llm_prompts",
    field_extractors.FieldExtractorUpdateParams{
      AccountID: cloudflare.F("123456"),
      Rules: cloudflare.F([]field_extractors.FieldExtractorUpdateParamsRule{field_extractors.FieldExtractorUpdateParamsRule{
        Fields: cloudflare.F([]field_extractors.FieldExtractorUpdateParamsRulesField{field_extractors.FieldExtractorUpdateParamsRulesField{
          Expression: cloudflare.F("x"),
          Name: cloudflare.F("x"),
        }}),
        Ref: cloudflare.F("x"),
      }}),
    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", fieldExtractor.Extractor)
}
```

200 example

```
{
  "errors": [
    {
      "code": 0,
      "message": "message",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    {
      "code": 0,
      "message": "message"
    }
  ],
  "result": {
    "extractor": "llm_prompts",
    "rules": [
      {
        "fields": [
          {
            "expression": "filter(http.request.body.json.strings.values, http.request.body.json.strings.pointers[*] matches \"^/messages/\\\\d+/content$\")",
            "name": "prompt"
          }
        ],
        "ref": "openai-chat",
        "description": "description"
      }
    ]
  },
  "success": true
}
```

##### Returns Examples

200 example

```
{
  "errors": [
    {
      "code": 0,
      "message": "message",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    {
      "code": 0,
      "message": "message"
    }
  ],
  "result": {
    "extractor": "llm_prompts",
    "rules": [
      {
        "fields": [
          {
            "expression": "filter(http.request.body.json.strings.values, http.request.body.json.strings.pointers[*] matches \"^/messages/\\\\d+/content$\")",
            "name": "prompt"
          }
        ],
        "ref": "openai-chat",
        "description": "description"
      }
    ]
  },
  "success": true
}
```