---
title: "Update existing field"
method: PATCH
path: "/v1/customMetadataFields/{id}"
tags: ["Digital Asset Management (DAM)", "Custom metadata fields"]
---

# Update existing field

`PATCH /v1/customMetadataFields/{id}`

This API updates the label or schema of an existing custom metadata field.

## Path parameters

- `id` string, required

## Request body

- object
  - `label` string — Human readable name of the custom metadata field. This should be unique across all non deleted custom metadata fields. This name is displayed as form field label to the users while setting field value on an asset in the media library UI. This parameter is required if `schema` is not provided.
  - `schema` object — An object that describes the rules for the custom metadata key. This parameter is required if `label` is not provided. Note: `type` cannot be updated and will be ignored if sent with the `schema`. The schema will be validated as per the existing `type`.
    - `selectOptions` union[] — An array of allowed values. This property is only required if `type` property is set to `SingleSelect` or `MultiSelect`.
      - union
        - string
        - number
        - boolean
    - `defaultValue` union — The default value for this custom metadata field. This property is only required if `isValueRequired` property is set to `true`. The value should match the `type` of custom metadata field.
      - string
      - number
      - boolean
      - union[] — Default value should be of type array when custom metadata field type is set to `MultiSelect`.
        - union
          - string
          - number
          - boolean
    - `isValueRequired` boolean — Sets this custom metadata field as required. Setting custom metadata fields on an asset will throw error if the value for all required fields are not present in upload or update asset API request body.
    - `minValue` union — Minimum value of the field. Only set this property if field type is `Date` or `Number`. For `Date` type field, set the minimum date in ISO8601 string format. For `Number` type field, set the minimum numeric value.
      - string
      - number
    - `maxValue` union — Maximum value of the field. Only set this property if field type is `Date` or `Number`. For `Date` type field, set the minimum date in ISO8601 string format. For `Number` type field, set the minimum numeric value.
      - string
      - number
    - `minLength` number — Minimum length of string. Only set this property if `type` is set to `Text` or `Textarea`.
    - `maxLength` number — Maximum length of string. Only set this property if `type` is set to `Text` or `Textarea`.

## Response `200`

Custom metadata field updated successfully.

- CustomMetadataField — Object containing details of a custom metadata field.
  - `id` string, required — Unique identifier for the custom metadata field. Use this to update the field.
  - `name` string, required — API name of the custom metadata field. This becomes the key while setting `customMetadata` (key-value object) for an asset using upload or update API.
  - `label` string, required — Human readable name of the custom metadata field. This name is displayed as form field label to the users while setting field value on the asset in the media library UI.
  - `schema` object, required — An object that describes the rules for the custom metadata field value.
    - `type` 'Text' | 'Textarea' | 'Number' | 'Date' | 'Boolean' | 'SingleSelect' | 'MultiSelect', required — Type of the custom metadata field.
    - `selectOptions` union[] — An array of allowed values when field type is `SingleSelect` or `MultiSelect`.
      - union
        - string
        - number
        - boolean
    - `defaultValue` union — The default value for this custom metadata field. Data type of default value depends on the field type.
      - string
      - number
      - boolean
      - union[] — Default value should be of type array when custom metadata field type is set to `MultiSelect`.
        - union
          - string
          - number
          - boolean
    - `isValueRequired` boolean — Specifies if the this custom metadata field is required or not.
    - `minValue` union — Minimum value of the field. Only set if field type is `Date` or `Number`. For `Date` type field, the value will be in ISO8601 string format. For `Number` type field, it will be a numeric value.
      - string
      - number
    - `maxValue` union — Maximum value of the field. Only set if field type is `Date` or `Number`. For `Date` type field, the value will be in ISO8601 string format. For `Number` type field, it will be a numeric value.
      - string
      - number
    - `minLength` number — Minimum length of string. Only set if `type` is set to `Text` or `Textarea`.
    - `maxLength` number — Maximum length of string. Only set if `type` is set to `Text` or `Textarea`.

## Other responses

- `400` — Bad request.
- `401` — Unauthorized request.
- `403` — Forbidden.
- `404` — Custom metadata field doesn't exist.
- `429` — The request exceeded the rate limit. Contains headers indicating the limits and a message detailing the error.

---

[API](https://skmtc.dev/imagekit-developer/apis/imagekit-api.md) · [All operations](https://skmtc.dev/imagekit-developer/apis/imagekit-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/imagekit-developer/imagekit-api/revisions/bb3e9ff84b3e/schema)
