Removes tags from keys or secrets.

You can remove multiple tags from multiple keys or multiple secrets at a time. You cannot remove tags that start with aliyun or acs:.

If you enter multiple tag keys in the request parameters and only some of the tag keys are associated with resources, the operation can be called and the tags whose keys are associated with resources are removed from the resources.

Debugging

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

ParameterTypeRequiredExampleDescription
ActionStringYesUntagResources

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

RegionIdStringYescn-hangzhou

The ID of the region to which the resource belongs.

Note You can call the DescribeRegions operation to query a list of available regions of the current Alibaba Cloud account.
ResourceTypeStringYeskey

The type of the resource from which you want to remove tags. Valid values:

  • key
  • secret
AllBooleanNofalse

Specifies whether to remove all tags from resources. Valid values:

  • true
  • false (default)
Note This parameter takes effect only when you specify an empty tag key.
ResourceId.NStringNokey-hzz62f1cb66fa42qo****

The IDs of the resources from which you want to remove tags. You can enter up to 50 resource IDs.

Enter multiple resource IDs in the ["ResourceId. 1","ResourceId. 2",...] format.

TagKey.NStringNodisk-encryption

The key of the tag that you want to remove. You can enter up to 20 tag keys.

Enter multiple tag keys in the ["key. 1","key. 2",...] format.

Note The tag key cannot start with aliyun or acs:.

Response parameters

ParameterTypeExampleDescription
RequestIdStringb1f210dc-e52c-4a86-b9dd-7492343d46c7

The request ID.

Examples

Sample requests

http(s)://[Endpoint]/?Action=UntagResources
&RegionId=cn-hangzhou
&ResourceType=key
&All=false
&ResourceId=["key-hzz62f1cb66fa42qo****"]
&TagKey=["disk-encryption"]
&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<UntagResourcesResponse>
    <RequestId>b1f210dc-e52c-4a86-b9dd-7492343d46c7</RequestId>
</UntagResourcesResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "RequestId" : "b1f210dc-e52c-4a86-b9dd-7492343d46c7"
}

Error codes

Http status codeError codeError messageDescription
404InvalidAccessKeyId.NotFoundThe Access Key ID provided does not exist in our records.The specified AccessKey ID does not exist.
404InvalidResourceId.NotFoundThe specified ResourceId is not found.The specified resource ID is not found.

For a list of error codes, see Service error codes.