Asset Metadata

Adds, removes, or replaces tags on multiple assets

POST
/v1_1/{cloud_name}/{resource_type}/tags

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.

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 tag command, the tags to apply, and the assets to apply them to.

A tag command plus the assets it applies 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.

command*string

The tag operation to apply.

  • add adds the given tags, leaving existing tags untouched.
  • remove removes the given tags, leaving other tags untouched.
  • replace overwrites the full tag list with the given tags.
  • remove_all clears every tag. The tags field is ignored.

Value in

  • "add"
  • "remove"
  • "replace"
  • "remove_all"
tags?array<string>

The tag names to apply. Required for add, remove, and replace; ignored for remove_all. A tag name must not contain a comma.

Response Body

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/v1_1/my_cloud/image/tags" \  -H "Content-Type: application/json" \  -d '{    "command": "add",    "public_ids": [      "sample",      "product_image",      "banner_2023"    ],    "tags": [      "animal",      "dog"    ]  }'
{  "public_ids": [    "sample",    "product_image",    "banner_2023"  ]}