You can call this operation to create tags for one or more resources.


OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes TagResources

The operation that you want to perform. Set the value to TagResources.

RegionId String Yes cn-hangzhou

The ID of the region.

ResourceIds Json Yes ["templateNam1","templateName2"]

The IDs of resources. The number of resource IDs ranges from 1 to 50.

ResourceType String Yes template

The type of the resource. Valid values:



Tags Json Yes {"k1":"v2","k2":"v2"}

The tag keys and values. The number of key-value pairs ranges from 1 to 20.

Response parameters

Parameter Type Example Description
RequestId String B19AE203-FD99-49C7-9253-FAAACAD46F4A

The ID of the request.


Sample requests

http(s)://[Endpoint]/? Action=TagResources
&<Common request parameters>

Sample success responses

XML format


JSON format


Error codes

For a list of error codes, visit the API Error Center.