- Documentation
Transit Router
API reference
Tags
TagResources - Adding a custom tag to a resource
Tags
TagResources - Adding a custom tag to a resource
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 (&).
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
"RequestId": "202507171744120171792131840FA5C8",
"Action": "TagResources",
"Version": "2020-04-01",
"Service": "transitrouter",
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. Last updated: 2026.01.06 11:56:31