Removes tags from resources.
Debugging
Request headers
This operation uses only common request headers. For more information, see Common request parameters and common response parameters.
Request syntax
DELETE /tags HTTP/1.1
Request parameters
Parameter | Type | Position | Required | Example | Description |
---|---|---|---|---|---|
RegionId | String | Query | Yes | cn-beijing | The ID of the region. |
ResourceType | String | Query | Yes | application | The type of the resource. Set the value to |
ResourceIds | String | Query | Yes | ["d42921c4-5433-4abd-8075-0e536f8b****"] | The resource ID. Separate multiple resource IDs with commas (,). |
TagKeys | String | Query | No | ["k1","k2"] | The tag key. Separate multiple tag keys with commas (,). |
DeleteAll | Boolean | Query | No | false | Specifies whether to remove all the specified tags. This parameter takes effect when the TagKeys parameter is specified. Valid values:
|
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
RequestId | String | 91F93257-7A4A-4BD3-9A7E-2F6EAE6D**** | The ID of the request. |
Message | String | success | The returned message. |
TraceId | String | 0a98a02315955564772843261e**** | The ID of the trace. It can be used to query details of a request. |
Data | Boolean | true | The returned data. |
ErrorCode | String | This parameter is left empty. | The error code.
|
Code | String | 200 | The HTTP status code. Valid values:
|
Success | Boolean | true | Indicates whether the tags were removed. Valid values:
|
Examples
Sample requests
DELETE /tags?RegionId=cn-beijing&ResourceType=application&ResourceIds=["d42921c4-5433-4abd-8075-0e536f8b****"]&TagKeys=["k1","k2"]&DeleteAll=false HTTP/1.1
Host:sae.aliyuncs.com
Content-Type:application/json
Sample success responses
XML
format
HTTP/1.1 200 OK
Content-Type:application/xml
<UntagResourcesResponse>
<RequestId>91F93257-7A4A-4BD3-9A7E-2F6EAE6D****</RequestId>
<Message>success</Message>
<TraceId>0a98a02315955564772843261e****</TraceId>
<Data>true</Data>
<Code>200</Code>
<Success>true</Success>
</UntagResourcesResponse>
JSON
format
HTTP/1.1 200 OK
Content-Type:application/json
{
"RequestId" : "91F93257-7A4A-4BD3-9A7E-2F6EAE6D****",
"Message" : "success",
"TraceId" : "0a98a02315955564772843261e****",
"Data" : true,
"Code" : "200",
"Success" : true
}
Error codes
HttpCode | Error code | Error message | Description |
---|---|---|---|
400 | Duplicate.TagKey | The TagKey contains duplicate keys. | The specified tag key already exists. Make sure that you specify a unique tag key. |
400 | InvalidParameter.Obviously | The specified parameter is invalid {%s}. | The value of the %s parameter is invalid. |
400 | InvalidResourceType.NotFound | The specified resource type is not supported. | The specified resource type is not supported. |
400 | InvalidParameter.TagKey | The specified TagKey is invalid. | The tag key is invalid. |
400 | InvalidParameter.TagValue | The specified TagValue is invalid. | The tag value is invalid. |
400 | NumberExceed.Tags | The specified parameter Tags count exceed. | The number of tags for a resource exceeds the limit of 20. |
400 | NumberExceed.ResourceIds | The number of resource IDs cannot exceed 50. | The number of resource IDs exceeds the limit of 50. |
400 | Invalid.Param.Tag.Scope | The specified parameter is invalid: tag scope. | The value of the scope parameter is invalid. |
400 | No.Permission | The account has no permission. | Your account does not have the operation permissions. |
For a list of error codes, visit the API Error Center.