Adds tags to one or more resources.
Try it now
Test
RAM authorization
Request syntax
POST /api/v1/tag HTTP/1.1
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| RegionId |
string |
No |
The region ID. |
cn-beijing |
| body |
object |
No |
The request body. |
|
| category |
string |
No |
The resource type. Valid values:
|
Custom |
| tagOwnerUid |
integer |
No |
The ID of the account that owns the tag. |
1062017779051424 |
| resourceIds |
array |
No |
The instance IDs. |
|
|
string |
No |
The instance ID. |
hgprecn-cn-zpr7886u9008 |
|
| tags |
array<object> |
No |
A collection of tags to add. |
|
|
object |
No |
|||
| key |
string |
No |
The tag key. |
any_string |
| value |
string |
No |
The tag value. |
any_string |
| ResourceType |
string |
No |
The instance type. Set the value to |
Instance |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response object. |
||
| RequestId |
string |
The request ID. |
15CEB459-CEE0-5528-87F5-B5A9B9F9B184 |
| Data |
boolean |
Indicates whether the tagging operation succeeded. Valid values:
|
true |
| Success |
boolean |
Indicates if the API call was accepted. This is separate from whether the tagging operation itself succeeded. Valid values:
|
true |
| ErrorCode |
string |
The error code. |
404 |
| ErrorMessage |
string |
The error message. |
Internal server error. |
| HttpStatusCode |
string |
The HTTP status code. |
200 |
Examples
Success response
JSON format
{
"RequestId": "15CEB459-CEE0-5528-87F5-B5A9B9F9B184",
"Data": true,
"Success": true,
"ErrorCode": "404",
"ErrorMessage": "Internal server error.",
"HttpStatusCode": "200"
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.