---
title: "Update an attribute definition"
method: PATCH
path: "/attributes/{key}"
---

# Update an attribute definition

`PATCH /attributes/{key}`

## Request

- Base URL: `https://www.merchkit.com/api/v1`
- URL: `https://www.merchkit.com/api/v1/attributes/{key}`
- Auth: HTTP bearer

Identified by the path `key` + `entity_type` in the body. Provide only the fields to change; array fields replace wholesale.

Scope: `write:attributes`.

## Request body

- AttributeDefinitionUpdate: Update body — the attribute is identified by the path key + `entity_type`. Only provided fields change; array fields replace wholesale. Accepts the same config fields as create (all optional except `entity_type`).
  - `entity_type` string, required
  - `name` string
  - `data_type` 'single_line_text_field' | 'multi_line_text_field' | 'rich_text_field' | 'number' | 'boolean' | 'date' | 'url' | 'json' | 'single_select_list' | 'multi_select_list' | 'image' | 'video' | 'formula' | 'web_preview' | 'status' | 'progress' | 'rank'
  - `ai_generated` boolean
  - `custom_instructions` string
  - `formula_expression` string: New template of a computed column. A formula or web_preview attribute keeps its data type; any other attribute becomes a formula. Recomputes every row.
  - `acceptable_values` string
  - `default_value` string
  - `is_primary` boolean
  - `selected_tools` string[]
  - `source_attribute_keys` string[]
  - `required_dependencies` string[]
  - `image_model` 'gpt-image-1' | 'nano-banana'
  - `image_source_attribute_key` string[]
  - `aspect_ratio` '1:1' | '4:3' | '3:4' | '16:9' | '9:16': Image generation aspect ratio. Legacy values (`Square`→`1:1`, `Landscape`→`16:9`, `Portrait`→`9:16`) are still accepted for backward compatibility but are deprecated.
  - `video_model` 'veo3.1'
  - `video_source_attribute_key` string[]
  - `vision_image_source_attribute_key` string[]
  - `inheritance_mode` 'off' | 'inherit_from_parent' | 'rollup_from_children'
  - `rollup_aggregation` 'unique' | 'all'

## Response `200`

The updated attribute definition (full config).

- object
  - `data` AttributeDefinitionDetail: The full attribute-definition config returned by create/update — a superset of the discovery projection (raw `acceptable_values` string, generation `tool`, `constraints`).
    - `id` string, uuid
    - `name` string
    - `key` string
    - `data_type` string
    - `tool` string: Generation tool, e.g. `manual`, `prompt`, `image-generation`, `formula`.
    - `entity_type` string
    - `channel` string, nullable
    - `is_primary` boolean
    - `custom_instructions` string, nullable
    - `acceptable_values` string, nullable: The raw comma-separated string as stored.
    - `default_value` string, nullable
    - `constraints` object: Generation/inheritance config (model, tools, source keys).
    - `source_attributes` object[], nullable
      - `id` string
      - `key` string
      - `name` string

## Other responses

- `404`: Attribute not found for that type.

---

[API](https://skmtc.dev/merchkit/apis/merchkit-api.md) - [All operations](https://skmtc.dev/merchkit/apis/merchkit-api/llms.txt) - [OpenAPI document](https://skmtc.dev/merchkit/apis/merchkit-api/revisions/3062ca814757?raw)
