All Products
Search
Document Center

Key Management Service:UntagResources

Last Updated:Aug 28, 2026

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 specify multiple tag keys and only some are associated with resources, the call succeeds and removes only the tags associated with the resources.

For the access policy required by RAM users or RAM roles to call this operation, see Resource Access Management.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

No authorization for this operation. If you encounter issues with this operation, contact technical support.

Request parameters

Parameter

Type

Required

Description

Example

RegionId

string

Yes

The region ID of the resource.

Note

You can call the DescribeRegions operation to query the most recent region list.

cn-hangzhou

ResourceType

string

Yes

The type of resource to untag. Valid values:

  • key

  • secret

key

All

boolean

No

Whether to remove all tags from the specified resources. Valid values:

  • true

  • false (default)

Note

This parameter takes effect only when you specify an empty tag key.

false

ResourceId

array

Yes

The resource IDs. You can specify up to 50 IDs.

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

string

No

The resource IDs. You can specify up to 50 IDs.

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

key-hzz62f1cb66fa42qo****

TagKey

array

No

The tag keys to remove. You can specify 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:.

string

No

The tag keys to remove. You can specify 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 elements

Element

Type

Description

Example

object

RequestId

string

The request ID.

b1f210dc-e52c-4a86-b9dd-7492343d46c7

Examples

Success response

JSON format

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

Error codes

HTTP status code

Error code

Error message

Description

404 InvalidAccessKeyId.NotFound The Access Key ID provided does not exist in our records.
404 InvalidResourceId.NotFound The specified ResourceId is not found.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.