---
title: "Update Attribute"
method: PATCH
path: "/metadata/attributes/{attribute_id}"
tags: ["Metadata"]
---

# Update Attribute

`PATCH /metadata/attributes/{attribute_id}`

## Request

- Base URL: `https://api.aspect.inc`
- URL: `https://api.aspect.inc/metadata/attributes/{attribute_id}`
- Auth: API key in header `Authorization`

Update a project-specific metadata attribute.

Cannot update global attributes (source IN (SYSTEM, ASSET) & project_id=null).

## Path parameters

- `attribute_id` string, uuid, required: Attribute ID

## Request body

- MetadataAttributeUpdateRequest: API request schema for updating a metadata attribute. Omitted and null fields are untouched, except `generation_config`: null turns generation off.
  - `name` string, nullable: Human-readable name, unique per project
  - `options` SelectOption[], nullable: The choices of a `single_select` or `multi_select` attribute. Not allowed on other data types.
    - `id` string, uuid
    - `label` string, required
    - `archived` boolean
  - `generation_config` MetadataGenerationConfig: Settings for generating an attribute's values with AI.
    - `prompt` string, required: Prompt template; variables like {{transcript}} must match input_sources
    - `input_sources` GenerationInputSource[], required: Inputs the AI reads when generating a value
    - `watch` Watch: Directories an attribute watches, with an optional asset-type limit. New assets in them are generated automatically as they finish processing, and a `watch` run covers them. The trash directory isn't allowed, and a deleted directory stops matching.
      - `resource_ids` string[], required: Directories whose assets are watched. Use the project's root_directory_id for the whole project
      - `asset_types` AssetType[], nullable: Limit to these asset types; null means every compatible type

## Response `200`

Successful Response

- MetadataAttributeResponse: API response schema for metadata attribute.
  - `id` string, uuid, required: Unique identifier for this attribute
  - `project_id` string, uuid, nullable: Project ID for project-specific attributes, null for system global
  - `name` string, required: Human-readable display name
  - `data_type` 'string' | 'integer' | 'float' | 'boolean' | 'datetime' | 'single_select' | 'multi_select' | 'user_id' | 'person_id' | 'object_id' | 'directory_id', required: Type of value an attribute holds. - `string`: Text. - `integer`: A whole number. - `float`: A decimal number. - `boolean`: True or false. - `datetime`: A date and time. - `single_select`: One of the attribute's `options`. - `multi_select`: Any number of the attribute's `options`. - `user_id`: Users. - `person_id`: People recognized in the asset. Used by the built-in People attribute. - `object_id`: Objects recognized in the asset. Used by the built-in Objects attribute. - `directory_id`: The directories containing the asset. Used by the built-in Path attribute.
  - `options` SelectOption[], nullable: Available options for select types
    - `id` string, uuid
    - `label` string, required
    - `archived` boolean
  - `source` 'system' | 'user' | 'asset', required: Source of metadata attribute or value.
  - `category` string, nullable: Grouping category for UI display
  - `is_filterable` boolean, required: Whether this attribute can be used in filters
  - `is_editable` boolean, required: Whether values for this attribute can be edited through metadata APIs
  - `is_sortable` boolean, required: Whether assets can be sorted by this attribute
  - `generation_config` MetadataGenerationConfig: Settings for generating an attribute's values with AI.
    - `prompt` string, required: Prompt template; variables like {{transcript}} must match input_sources
    - `input_sources` GenerationInputSource[], required: Inputs the AI reads when generating a value
    - `watch` Watch: Directories an attribute watches, with an optional asset-type limit. New assets in them are generated automatically as they finish processing, and a `watch` run covers them. The trash directory isn't allowed, and a deleted directory stops matching.
      - `resource_ids` string[], required: Directories whose assets are watched. Use the project's root_directory_id for the whole project
      - `asset_types` AssetType[], nullable: Limit to these asset types; null means every compatible type
  - `created_by_user_id` string, uuid, nullable: User who created the attribute; null for system attributes and ones created before creators were recorded
  - `created` string, date-time, required: When the attribute was created
  - `updated` string, date-time, required: When the attribute was last updated

## Other responses

- `422`: Validation Error

---

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