Adds or clears contextual metadata on multiple assets
Applies a contextual-metadata command to the given assets, addressing them by public ID.
Basic authentication using Cloudinary API Key and API Secret.
In: header
Path Parameters
The cloud name of your product environment.
The type of resource (image, video, or raw).
Value in
- "image"
- "video"
- "raw"
Request Body
application/json
The context command, the metadata to apply, and the assets to apply it to.
A contextual-metadata command plus the assets it applies to.
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.
items <= 1000All supported delivery types.
The contextual-metadata operation to apply.
addmerges the given key-value pairs into each asset's existing context. Keys already present are overwritten; keys not mentioned are left intact.contextis required.remove_allclears all contextual metadata. Thecontextfield is ignored.
Value in
- "add"
- "remove_all"
The key-value pairs to merge. Required for add; ignored for remove_all.
An empty value deletes that key rather than storing an empty string, so "alt=" removes alt while leaving other keys intact. Deletes and sets may be combined: "alt=|owner=new".
A literal = or | inside a value must be escaped with a prepending backslash, and a literal backslash must be doubled. A double quote must not be escaped.
Response Body
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/v1_1/my_cloud/image/context" \ -H "Content-Type: application/json" \ -d '{ "command": "add", "public_ids": [ "sample", "product_image", "banner_2023" ], "context": "alt=My image|caption=Nice photo" }'{ "public_ids": [ "sample", "product_image", "banner_2023" ]}Adds, removes, or replaces tags on multiple assets POST
Applies a tag command to the given assets, addressing them by public ID. The number of tags multiplied by the number of public IDs must not exceed 10,000.
Sets structured metadata values on multiple assets POST
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.