Update custom metadata field

Update an existing custom metadata field

PATCH https://api.imagekit.io/v1/customMetadataFields/:id

Update the label or schema of an existing custom metadata field.

Headers

NameTypeDescription

Authorization*

string

base64 encoding of your_private_api_key:

Note the colon in the end.

Request Body

NameTypeDescription

label

string

Label of the metadata field, unique across all non deleted custom metadata fields. 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.

{
    "id": "field_id",
    "name": "price",
    "label": "price",
    "schema": {
        "type": "Number",
        "minValue": 2000,
        "maxValue": 5000
    }
}

Examples

curl -X PATCH "https://api.imagekit.io/v1/customMetadataFields/field_id" \
-H 'Content-Type: application/json' \
-u your_private_key: -d'
{
    "schema": {
        "minValue": 500,
        "maxValue": 2500
    }
}
'

Last updated