pydo.tags.create()
Generated on 8 May 2026
from pydo version
v0.34.0
Usage
client.tags.create(
body={
"name": "extra-awesome",
},
)Description
To create a tag you can send a POST request to /v2/tags with a name attribute.
Parameters
namestring optionalExample:
extra-awesomeThe 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 behttps://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".resourcesobject optional read-onlyExample:
{'count': 5, 'last_tagged_uri': 'https://api.digitalocean.com/v2/images/7555620', 'droplets': {'count': 1, 'last_tagged_uri': 'https://api.digitalocean.com/v2/droplets/3164444'}, 'images': {'count': 1, 'last_tagged_uri': 'https://api.digitalocean.com/v2/images/7555620'}, 'volumes': {'count': 1, 'last_tagged_uri': 'https://api.digitalocean.com/v2/volumes/3d80cb72-342b-4aaa-b92e-4e4abb24a933'}, 'volume_snapshots': {'count': 1, 'last_tagged_uri': 'https://api.digitalocean.com/v2/snapshots/1f6f46e8-6b60-11e9-be4e-0a58ac144519'}, 'databases': {'count': 1, 'last_tagged_uri': 'https://api.digitalocean.com/v2/databases/b92438f6-ba03-416c-b642-e9236db91976'}}An 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 alast_tagged_uriattribute set to the last resource tagged with the current tag.
This will only include resources that you are authorized to see. For example, to see tagged Droplets, include thedroplet:readscope.Show child properties
countinteger optionalExample:
5The number of tagged objects for this type of resource.
last_tagged_uristring optionalExample:
https://api.digitalocean.com/v2/images/7555620The URI for the last tagged object for this type of resource.
dropletsobject optionalShow child properties
countinteger optionalExample:
5The number of tagged objects for this type of resource.
last_tagged_uristring optionalExample:
https://api.digitalocean.com/v2/images/7555620The URI for the last tagged object for this type of resource.
imgagesobject optionalShow child properties
countinteger optionalExample:
5The number of tagged objects for this type of resource.
last_tagged_uristring optionalExample:
https://api.digitalocean.com/v2/images/7555620The URI for the last tagged object for this type of resource.
volumesobject optionalShow child properties
countinteger optionalExample:
5The number of tagged objects for this type of resource.
last_tagged_uristring optionalExample:
https://api.digitalocean.com/v2/images/7555620The URI for the last tagged object for this type of resource.
volume_snapshotsobject optionalShow child properties
countinteger optionalExample:
5The number of tagged objects for this type of resource.
last_tagged_uristring optionalExample:
https://api.digitalocean.com/v2/images/7555620The URI for the last tagged object for this type of resource.
databasesobject optionalShow child properties
countinteger optionalExample:
5The number of tagged objects for this type of resource.
last_tagged_uristring optionalExample:
https://api.digitalocean.com/v2/images/7555620The URI for the last tagged object for this type of resource.
Request Sample
Response Example
More Information
See /v2/tags in the API reference for additional detail on responses, headers, parameters, and more.