> ## Documentation Index
> Fetch the complete documentation index at: https://developer.audienceful.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Update a Field

> Partially updates an existing custom field.

Requires the `fields:write` scope. Send only the fields you want to change.

### Path parameters

<ParamField path="id" type="string" required>
  The id of the field to update.
</ParamField>

### Body

<ParamField body="name" type="string">
  A new human-readable field name.
</ParamField>

<ParamField body="data_name" type="string">
  A new key for setting and reading this field's value. Must remain unique within the workspace.
</ParamField>

<ParamField body="type" type="string">
  The data type of the field (`string`, `boolean`, `tag`, `number`).
</ParamField>

<ParamField body="required" type="boolean">
  Whether a value for this field is required.
</ParamField>

<Note>The `internal` flag is system-managed and read-only — it cannot be changed via the API.</Note>

### Response

Returns the updated field.

<Snippet file="fields/fields-list.mdx" />

<RequestExample>
  ```bash cURL theme={null}
  curl --location --request PATCH 'https://api.audienceful.com/v2/fields/o4i4TNZnWsq2f2ZWVqNNWY' \
  --header 'Content-Type: application/json' \
  --header 'X-Api-Key: <your-api-key>' \
  --data-raw '{
      "name": "Subscription Plan"
  }'
  ```

  ```python Python theme={null}
  import requests

  url = "https://api.audienceful.com/v2/fields/o4i4TNZnWsq2f2ZWVqNNWY"
  headers = {
      "Content-Type": "application/json",
      "X-Api-Key": "<your-api-key>",
  }
  payload = {
      "name": "Subscription Plan",
  }

  response = requests.patch(url, headers=headers, json=payload)
  print(response.json())
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch("https://api.audienceful.com/v2/fields/o4i4TNZnWsq2f2ZWVqNNWY", {
    method: "PATCH",
    headers: {
      "Content-Type": "application/json",
      "X-Api-Key": "<your-api-key>",
    },
    body: JSON.stringify({
      "name": "Subscription Plan"
    }),
  });
  const data = await response.json();
  console.log(data);
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
    "id": "o4i4TNZnWsq2f2ZWVqNNWY",
    "name": "Subscription Plan",
    "data_name": "plan",
    "type": "string",
    "editable": true,
    "internal": false,
    "required": false
  }
  ```
</ResponseExample>
