Tagging resources
How to tag a resource via API
Last updated
How to tag a resource via API
Last updated
can be tagged using one or more existing . To do that, you need to update the resource setting the relationship with the desired tag(s).
The following request tags the resource identified by the "xYZkjABcde" ID with the two tags identified by the "geJmexflJQ" and "mWJAPvfBaV" IDs:
To remove one or more tags from a resource you need to update the resource setting the relationship with the updated list of tags. To remove all the tags from a resource, just set the tags relationship as an empty array.
The following request removes all the tags associated with the resource identified by the "xYZkjABcde" ID:
The following request changes the list of tags associated with the resource identified by the "xYZkjABcde" ID:
automatically removes any existing association.
If a resource is already associated with one or more tags, tagging the resource by will remove all the currently associated tags and replace them with the new list of tags. If you just need to change the list of the tags currently associated with a resource, you can patch the taggable resource and send the trigger attributes _add_tags
and/or _remove_tags
specifying the comma-separated list of tag names that you want to add and/or remove.
The specified names must belong to existing tags, meaning that the related tags must be previously . The provided tags are automatically and non-existing ones are ignored and not associated with the resource without returning any errors.
The two trigger attributes can be sent within the same PATCH
request (i.e. adding some tags and removing some others in just one API call — ). In that case, remember that tag removal is always performed after tag addition.