Last updated: Nov-06-2023
Tags are used to categorize and organize your assets, and can also be used to bulk delete assets, create sprites, ZIP files, JSON lists, and generate PDFs and animated GIFs. A tag is a short name (up to 255 characters) that you can dynamically use (no need to predefine tags). Each asset can be assigned up to 1000 tags.
You can assign tags to assets while uploading them by also specifying the
tags parameter in the upload method.
For example, uploading the image
boots.jpg and adding the tag
shoes to the image:
Cloudinary provides various add-ons to help you automatically tag your assets. By providing the
auto_tagging parameter to an
update call, assets are automatically assigned resource tags based on the detected scene categories. You also set the
categorization parameter to one or more of the following values:
||Google Auto Tagging|
||Google Automatic Video Tagging|
||Imagga Auto Tagging|
||Amazon Rekognition Auto Tagging|
For example, using Google Auto Tagging to automatically tag an uploaded image with all detected categories that have a confidence score higher than 0.6.
tags method can be used to manage asset tags by setting the value of the command parameter to either add, remove, remove_all, or replace tags. This method accepts two parameters (use an array for multiple values): the tag(s) to add and the Public ID(s) of the asset(s) to be tagged. The Cloudinary SDKs wrap the tags method and offer four separate methods:
For example, adding the tag "shoes" to the assets with the Public IDs of "slippers" and "boots":
For example, to list all assets that share the tag "shoes":
You can monitor for changes to the tags on your media assets, including tags that have been added or removed via API or the Cloudinary Console UI. These changes are sent as webhook notifications to the Notification URL specified in the Upload page of your Console Settings. To capture these changes, monitor for the response parameter:
resource_tags_changed. Within it, you'll find information about which resource was changed, the source of the change (UI or API), and whether tags were added, removed, or both. For example:
See the documentation on Notifications for more information.