You need to enable JavaScript to run this app.
Transit Router

Transit Router

Copy page
Download PDF
Tags
TagResources - Adding a custom tag to a resource
Copy page
Download PDF
TagResources - Adding a custom tag to a resource
Call the TagResources API to add custom tags to a resource.​
Notes​
  • ​​If multiple tags with the same key are applied to a resource, the most recent value overwrites any previous ones.​​
  • Each resource supports up to 50 custom tags, while a single API call can add a maximum of 20 tags.​​​
  • In a request parameter such as Tags.N.a, the "N" represents the serial number of the tag entry. It must be assigned a value in strict numerical order, starting from 1 up to 50. Separate multiple tags with ampersands (&). Each tag key pairs one tag value.​
Debug​
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​
The following only details request parameters specific to this API and key common parameters. For more information, see Common parameters.​
Action string required Example value: TagResources​
The interface name. The current API name is TagResources.​
​
Version String required Example value: 2020-04-01​
The interface version. The current API version is 2020-04-01.​
​
ResourceType String required Example value: transitrouter​
The resource type. Values:​
  • transitrouter: TR instance.​
  • transitrouterroutetable: TR route table.​
  • transitrouterattachment: Attachment, including network instance attachments (VPC, VPN, or DC Gateway) and inter-region attachments.​
  • transitroutermulticastdomain: TR multicast domain.​
  • transitrouterbandwidthpackage: TR bandwidth package.​
​
ResourceIds.N String required Example value: tr-2fe6fszjgeznk5oxruv0u****​
The resource ID.​
  • N represents the serial number of the resource ID, ranging from 1 to 50.​
  • Separate multiple resource IDs with ampersands (&).​
tip​
​
Tags.N.Key String required Example: k1​
The tag key of the custom tag.​
  • Must be 1 to 128 characters.​
  • Case-sensitive. Must not start with volc: or sys: in any case form.​
  • Must not start or end with a space.​
  • May include characters (any language), numbers, spaces ( ), underscores (_), periods (.), half-width colons (:), slashes (/), equal signs (=), plus signs (+), minus signs (-) and at signs (@).​
tip​
  • Tag keys of the same resource must be unique. If the applied Tags.N.Key duplicates an existing tag key, the most recent tag overwrites any previous ones.​​
  • If you do not provide this parameter or leave it unset, it defaults to empty.​
​
Tags.N.Value String optional example: v1​
The tag value of the custom tag.​
  • Must be 1 to 256 characters.​
  • Case-sensitive. Must not start or end with a space.​
  • May include characters (any language), numbers, spaces ( ), underscores (_), periods (.), half-width colons (:), slashes (/), equal signs (=), plus signs (+), minus signs (-) and at signs (@).​
tip​
To provide this parameter, provide Tags.N.Key first.​
​
​
Response parameters​
This API does not have specific response parameters. For more information, see Response structure.​
Request examples​
​
GET /?Action=TagResources&Version=2020-04-01&ResourceType=transitrouter&ResourceIds.1=tr-273sdsdsxxxxxp8u2j**** HTTP/1.1​
Host: transitrouter.cn-beijing.volcengineapi.com​
X-Date: 20250717T094408Z​
Authorization: HMAC-SHA256 Credential=Adfks******wekfwe/20250717/cn-beijing/transitrouter/request, SignedHeaders=host;x-date, Signature=47a7d934ff7b37c03938******cd7b8278a40a1057690c401e92246a0e41085f​
​
Response examples​
​
{​
"ResponseMetadata": {​
"RequestId": "202507171744120171792131840FA5C8",​
"Action": "TagResources",​
"Version": "2020-04-01",​
"Service": "transitrouter",​
"Region": "cn-beijing"​
},​
"Result": {}​
}​
​
Error codes​
The table below describes the error codes for this API that are associated with business logic. For more information, see Common error codes.​
​
Status code​
Error codes​
Error message​
Explanation​
400​
InvalidResourceType.Malformed​
The specified parameter resource type is invalid.​
The resource type is invalid.​
400​
InvalidTag.Disorder​
The specified index order of tag is malformed.​
The index order format of the specified tag is invalid​
400​
InvalidTagKey.Malformed​
The specified parameter tag key is invalid.​
The tag key is invalid.​
400​
InvalidTagValue.Malformed​
The specified parameter tag value is invalid.​
The tag value is invalid.​
400​
LimitExceeded.Resource​
You've reached the limit on the number of resources that you can operate at a time.​
You have reached the maximum number of tags that you can manage in a single request.​
400​
LimitExceeded.Tags​
You've reached the limit on the number of tags that you can operate at a time.​
You have reached the maximum number of tags that you can manage in a single request.​
400​
QuotaExceeded.ResourceSystemTags​
You've reached the limit on the number of system tags that you can create.​
You have reached the maximum number of system tags that you can add to a single resource.​
400​
QuotaExceeded.ResourceTags​
You've reached the limit on the number of resource tags that you can create.​
You have reached the maximum number of custom tags that you can add to a single resource.​
404​
InvalidResource.NotFound​
The specified resource does not exist.​
The specified resource does not exist.​
​
Last updated: 2026.01.06 11:56:31