Asset Metadata

Sets structured metadata values on multiple assets

POST
/v1_1/{cloud_name}/{resource_type}/metadata

Assigns structured metadata field values to the given assets, addressing them by public ID.

Values are merged into each asset's existing structured metadata: fields not mentioned keep their current values, and an empty value clears the field. Every referenced field must already exist in the product environment. Conditional metadata rules are evaluated as part of the update.

Authorization

AuthorizationBasic <token>

Basic authentication using Cloudinary API Key and API Secret.

In: header

Path Parameters

cloud_name*string

The cloud name of your product environment.

resource_type*string

The type of resource (image, video, or raw).

Value in

  • "image"
  • "video"
  • "raw"

Request Body

application/json

The structured metadata values to assign and the assets to assign them to.

Structured metadata values plus the assets they apply to.

public_ids*array<string>

The public IDs of the assets to apply the operation to. At most 1000 are processed per request; any beyond the first 1000 are ignored rather than rejected. Public IDs that do not exist, or that the caller lacks update permission for, are skipped rather than failing the request, so the returned public_ids may be shorter than the requested list.

Itemsitems <= 1000
type?|||||

All supported delivery types.

metadata*|

A pipe-separated list or a map of custom metadata fields (by external_id) and the values to assign to each of them. The = " and | characters can be supported as values when escaped with a prepended backslash (). For a multi-select field, you can set a maximum of 3000 different metadata values on an asset.

clear_invalid?boolean

Whether to clear a value already stored on the asset that is no longer valid — for example because its datasource entry was deleted — instead of failing the update for that asset. Applies only to fields governed by an active conditional metadata rule; an invalid value sent in this request is always rejected. Default is false.

Response Body

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/v1_1/my_cloud/image/metadata" \  -H "Content-Type: application/json" \  -d '{    "public_ids": [      "sample",      "product_image",      "banner_2023"    ],    "metadata": {      "in_stock_id": 50,      "color_id": [        "green",        "red"      ]    }  }'
{  "public_ids": [    "sample",    "product_image",    "banner_2023"  ]}