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

# Clarify: Patch Enum Field Values

> Add or remove enum field values. Includes SDK V2 guidance, input constraints, response fields, and Deepline credit cost.

Add or remove enum field values.

> [!NOTE]
>
> Tool ID: `clarify_patch_enum_field_values`

## Run this action

Use the TypeScript SDK for one call. Use `ctx.tools.execute(...)` inside a Play for durable calls, scheduled calls, or CSV processing.

```ts theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
import { Deepline } from 'deepline';

const deepline = await Deepline.connect();
const result = await deepline.tools.execute(
  'clarify_patch_enum_field_values',
  {
    "workspace": "example",
    "data": [
      {
        "type": "schema-properties",
        "id": "id_123",
        "attributes": {},
        "meta": {}
      }
    ]
  },
);

console.log(result.toolResponse.raw);
```

### CLI

```bash theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
deepline run clarify_patch_enum_field_values --input '{
  "workspace": "example",
  "data": [
    {
      "type": "schema-properties",
      "id": "id_123",
      "attributes": {},
      "meta": {}
    }
  ]
}'
```

## Example response

The SDK returns this shape at `result.toolResponse.raw`. The example values illustrate the response.

```json theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
{
  "data": {
    "data": [
      {
        "id": "id_123",
        "type": "schema-validation-result",
        "attributes": {
          "isValid": true
        }
      }
    ]
  }
}
```

Use `deepline describe clarify_patch_enum_field_values --json` for the latest machine-readable contract.

## Input reference

Adds or removes options on enum (single- and multi-select) fields for one object type. The request carries exactly one item in `data`. Each field in `meta` names an `append` or `remove` operation. Removing an option also clears it from every record that holds it, and the response returns once the records are updated. To modify several object types, send separate requests.

| Name | Type | Required | Default | Details |
| - | - | - | - | - |
| `payload.workspace` | `string` | Yes | — | The workspace slug — the `&#123;slug&#125;` segment of your Clarify workspace URL. |
| `payload.silent` | `boolean` | No | — | When true, suppresses in-app and Slack notifications for this mutation. |
| `payload.data` | `array` | Yes | — | A single-element array holding the enum-field patch to apply. Minimum items: 1. Maximum items: 1. |

<details>
  <summary>Show raw input schema</summary>

  ### Input JSON Schema

  ```json theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
  {
    "type": "object",
    "description": "Adds or removes options on enum (single- and multi-select) fields for one object type. The request carries exactly one item in `data`; each field in `meta` names an `append` or `remove` operation. Removing an option also clears it from every record that holds it, and the response returns once the records are updated. To modify several object types, send separate requests.",
    "properties": {
      "workspace": {
        "type": "string",
        "description": "The workspace slug — the `{slug}` segment of your Clarify workspace URL."
      },
      "silent": {
        "type": "boolean",
        "description": "When true, suppresses in-app and Slack notifications for this mutation."
      },
      "data": {
        "type": "array",
        "description": "A single-element array holding the enum-field patch to apply.",
        "minItems": 1,
        "maxItems": 1,
        "items": {
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "description": "The JSON:API resource type.",
              "enum": [
                "schema-properties"
              ]
            },
            "id": {
              "type": "string",
              "description": "The schema id of the object being patched, in the form https://getclarify.ai/schemas/entities/{entity}."
            },
            "attributes": {
              "type": "object",
              "description": "Enum field patches keyed by field name. Each value carries the field’s `enum` values and `xClarifyEnumMetadata`; for a multi-select field these are nested under `properties.items.items`.",
              "additionalProperties": {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "enum": {
                        "type": "array",
                        "description": "The list of allowed values for the enum field.",
                        "items": {
                          "type": "string"
                        }
                      },
                      "xClarifyEnumMetadata": {
                        "type": "object",
                        "description": "Per-option metadata (id, rank, color) keyed by enum value.",
                        "additionalProperties": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "description": "The stable unique ID of the enum option."
                            },
                            "rank": {
                              "type": "number",
                              "description": "The sort position of the option relative to its siblings."
                            },
                            "color": {
                              "type": "string",
                              "description": "The color assigned to the option, as a color name."
                            }
                          },
                          "required": [
                            "id",
                            "rank",
                            "color"
                          ],
                          "additionalProperties": false
                        }
                      }
                    },
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "properties": {
                        "type": "object",
                        "description": "The nested JSON Schema wrapper for a multi-select enum field.",
                        "properties": {
                          "items": {
                            "type": "object",
                            "description": "The array item schema wrapper.",
                            "properties": {
                              "items": {
                                "type": "object",
                                "description": "The enum definition applied to each item of the multi-select field.",
                                "properties": {
                                  "enum": {
                                    "type": "array",
                                    "description": "The list of allowed values for the enum field.",
                                    "items": {
                                      "type": "string"
                                    }
                                  },
                                  "xClarifyEnumMetadata": {
                                    "type": "object",
                                    "description": "Per-option metadata (id, rank, color) keyed by enum value.",
                                    "additionalProperties": {
                                      "type": "object",
                                      "properties": {
                                        "id": {
                                          "type": "string",
                                          "description": "The stable unique ID of the enum option."
                                        },
                                        "rank": {
                                          "type": "number",
                                          "description": "The sort position of the option relative to its siblings."
                                        },
                                        "color": {
                                          "type": "string",
                                          "description": "The color assigned to the option, as a color name."
                                        }
                                      },
                                      "required": [
                                        "id",
                                        "rank",
                                        "color"
                                      ],
                                      "additionalProperties": false
                                    }
                                  }
                                },
                                "additionalProperties": false
                              }
                            },
                            "required": [
                              "items"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "required": [
                          "items"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "required": [
                      "properties"
                    ],
                    "additionalProperties": false
                  }
                ]
              }
            },
            "meta": {
              "type": "object",
              "description": "The operation to apply to each field being patched, keyed by field name.",
              "additionalProperties": {
                "type": "object",
                "properties": {
                  "enum": {
                    "type": "string",
                    "description": "The enum operation to apply to the matching field: `append` to add values or `remove` to drop them.",
                    "enum": [
                      "append",
                      "remove"
                    ]
                  }
                },
                "additionalProperties": false
              }
            }
          },
          "required": [
            "type",
            "id",
            "attributes",
            "meta"
          ],
          "additionalProperties": false
        }
      }
    },
    "required": [
      "workspace",
      "data"
    ],
    "additionalProperties": false
  }
  ```
</details>

## Output reference

Standard tool result payload.

| Name | Type | Required | Default | Details |
| - | - | - | - | - |
| `result.data` | `object` | Yes | — | Provider response payload. |
| `result.data.data` | `array` | Yes | — | The validation results, one per patched field. |
| `result.data.data[].id` | `string` | Yes | — | The schema id the patch was applied to. |
| `result.data.data[].type` | `"schema-validation-result"` | Yes | — | The JSON:API resource type. Allowed: `schema-validation-result`. |
| `result.data.data[].attributes` | `object` | Yes | — | The validation result for the patched field. |
| `result.data.data[].attributes.isValid` | `boolean` | Yes | — | Whether the requested schema change passed validation. |
| `result.data.data[].attributes.errors` | `array` | No | — | Validation errors, present when `isValid` is false. |
| `result.data.data[].attributes.values` | `record` | No | — | The validated field values that were written. |
| `result.meta` | `object` | No | — | Additional response metadata (status, paging). |

<details>
  <summary>Show raw output schema</summary>

  ### Output JSON Schema

  ```json theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
  {
    "type": "object",
    "description": "Standard tool result payload.",
    "properties": {
      "data": {
        "type": "object",
        "description": "Provider response payload.",
        "properties": {
          "data": {
            "type": "array",
            "description": "The validation results, one per patched field.",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "description": "The schema id the patch was applied to."
                },
                "type": {
                  "type": "string",
                  "description": "The JSON:API resource type.",
                  "enum": [
                    "schema-validation-result"
                  ]
                },
                "attributes": {
                  "type": "object",
                  "description": "The validation result for the patched field.",
                  "properties": {
                    "isValid": {
                      "type": "boolean",
                      "description": "Whether the requested schema change passed validation."
                    },
                    "errors": {
                      "type": "array",
                      "description": "Validation errors, present when `isValid` is false.",
                      "items": {}
                    },
                    "values": {
                      "type": "object",
                      "description": "The validated field values that were written.",
                      "additionalProperties": {}
                    }
                  },
                  "required": [
                    "isValid"
                  ],
                  "additionalProperties": false
                }
              },
              "required": [
                "id",
                "type",
                "attributes"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "data"
        ],
        "additionalProperties": false
      },
      "meta": {
        "type": "object",
        "description": "Additional response metadata (status, paging).",
        "additionalProperties": true
      }
    },
    "required": [
      "data"
    ],
    "additionalProperties": false
  }
  ```
</details>

## Deepline cost

* Pricing model: `fixed` (per call).
* Estimated Deepline credits: `0` per pricing unit.
* Provider-native pricing may still exist outside Deepline credit billing.

## Related documentation

* [Connect integrations](https://deepline.com/docs/integrations.md)
* [SDK V2 quickstart](https://deepline.com/docs/sdk-v2/quickstart.md)
* [SDK reference](https://deepline.com/docs/sdk-v2/sdk-reference.md)
* [Run tools across a CSV](https://deepline.com/docs/sdk-v2/batch-csv.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.