- Documentation
Elastic Compute Service
Elastic Compute Service
API Reference
Tags
Volume tag
CreateTags - Create Tags
Volume tag
CreateTags - Create Tags
CreateTags - Create Tags
Use the CreateTags API to add tags to one or more resources.
precautions
- A single resource can have up to 50 tags, and a single API call can support adding up to 20 tags.
- When adding the same tag key to the same resource repeatedly, the new tag value will automatically overwrite the original tag value.
- Resources that are being deleted are not allowed to have tags added.
Debugging
API Explorer
You can initiate calls online through API Explorer without paying attention to the signature generation process and quickly obtain the call results.
request parameters
Only the parameters specific to this API and some common parameters are listed below. For more information, see Public Parameters. Action string required Example: CreateTags
The operation to be performed is: CreateTags.
Version string required Example value: 2020-04-01
The version of the API is: 2020-04-01.
ResourceType string required Example value: volume
Resource Type, values:
- Snapshot Policy: automatic snapshot policy.
- snapshotgroup: snapshot consistency group.
ResourceIds.N string[] required Example: ResourceIds.1=vol-76pwr6rilv8lzwxv****&ResourceIds.2=vol-76pwr6rilv8lzwxv****
Resource ID to be associated with a tag. Description as follows:
- ResourceIds.N: N indicates the resource number, valid values: 1–50.
- Separate multiple resources with &.
Tags.N.Key string[] required Example value: tag
The tag key for the label.
- Tags.N.Key: N indicates the index of the tag key. Value range: 1-20.
- Use & to separate multiple tag keys.
The naming conventions are as follows:
- Cannot start with any case form of volc: or sys:; volc: or sys: prefixes are reserved for system tag keys and creation is prohibited.
- Only include language characters, numbers, spaces, and special symbols _.:/=+-@.
- Length is limited between 1 and 128 characters.
Tags.N.Value string[] Optional Example: test
Tag value of the label.
- Tags.N.Value: N indicates the index number of the tag value. Value range: 1-20.
- Separate multiple tag values with &.
The naming conventions are as follows:
- Only include language characters, numbers, spaces, and special symbols _.:/=+-@.
- Allowed to be empty, with a length limit of 0 to 256 characters.
Return parameters
Below are the unique return parameters for this endpoint. For more information, see Return Structure. OperationDetails object[] Example: -
Tag operation result.
ResourceId string Example: vol-76pwr6rilv8lzwxv****
Resource ID.
Error object Example value: -
Error message.
Code string Example: InvalidResourceId.NotFound
Error details for the requested resource.
Message string Example value: The specified ResourceId does not exist.
Error message for failed request.
Request example
Back to example
error code
The following table lists error codes related to this endpoint's business logic. For public error codes, refer to the Public Error Codes documentation.
Last updated: 2026.01.09 18:19:56