Skip to main content

tags

Overview

Nametags
TypeResource
Iddigitalocean.tags.tags

Fields

NameDatatypeDescription
namestringThe name of the tag. Tags may contain letters, numbers, colons, dashes, and underscores.
There is a limit of 255 characters per tag.

Note: Tag names are case stable, which means the capitalization you use when you first create a tag is canonical.

When working with tags in the API, you must use the tag's canonical capitalization. For example, if you create a tag named "PROD", the URL to add that tag to a resource would be https://api.digitalocean.com/v2/tags/PROD/resources (not /v2/tags/prod/resources).

Tagged resources in the control panel will always display the canonical capitalization. For example, if you create a tag named "PROD", you can tag resources in the control panel by entering "prod". The tag will still display with its canonical capitalization, "PROD".
resourcesobjectAn embedded object containing key value pairs of resource type and resource statistics. It also includes a count of the total number of resources tagged with the current tag as well as a last_tagged_uri attribute set to the last resource tagged with the current tag.

Methods

NameAccessible byRequired ParamsDescription
getSELECTtag_idTo retrieve an individual tag, you can send a GET request to /v2/tags/$TAG_NAME.
listSELECTTo list all of your tags, you can send a GET request to /v2/tags.
createINSERTTo create a tag you can send a POST request to /v2/tags with a name attribute.
deleteDELETEtag_idA tag can be deleted by sending a DELETE request to /v2/tags/$TAG_NAME. Deleting a tag also untags all the resources that have previously been tagged by the Tag
_getEXECtag_idTo retrieve an individual tag, you can send a GET request to /v2/tags/$TAG_NAME.
_listEXECTo list all of your tags, you can send a GET request to /v2/tags.