All Products
Search
Document Center

Key Management Service:UntagResources

Last Updated:Jul 29, 2025

Removes tags from keys or secrets.

Operation description

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

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

There is currently no authorization information disclosed in the API.

Request parameters

ParameterTypeRequiredDescriptionExample
RegionIdstringYes

The region ID of the resource.

Note You can call the DescribeRegions operation to query the most recent region list.
cn-hangzhou
ResourceTypestringYes

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

  • key
  • secret
key
AllbooleanNo

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.
false
ResourceIdarrayYes

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.

stringYes

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.

key-hzz62f1cb66fa42qo****
TagKeyarrayNo

The keys of the tags 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:.
stringNo

The keys of the tags 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:.
disk-encryption

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The request ID.

b1f210dc-e52c-4a86-b9dd-7492343d46c7

Examples

Sample success responses

JSONformat

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

Error codes

HTTP status codeError codeError message
404InvalidAccessKeyId.NotFoundThe Access Key ID provided does not exist in our records.
404InvalidResourceId.NotFoundThe specified ResourceId is not found.

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2023-05-30The Error code has changedView Change Details