All Products
Search
Document Center

Cloud Storage Gateway:UntagResources

Last Updated:Oct 11, 2025

Detaches tags from a specified gateway.

Operation description

When you call this operation, note the following:

  • You can detach a maximum of 20 tags at a time.

  • After a tag is detached from an instance, the tag is automatically deleted if it is not attached to any other instances.

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

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

hcs-sgw:UntagResources

update

*All Resource

*

None

None

Request parameters

Parameter

Type

Required

Description

Example

RegionId

string

Yes

The region ID. You can call the DescribeRegions operation to query the region list.

cn-hangzhou

ResourceRegionId

string

No

The region ID of the resource.

cn-hangzhou

ResourceType

string

Yes

The resource type. The value must be GATEWAY.

GATEWAY

All

boolean

No

Specifies whether to remove all tags from the instance. The default value is false. Valid values:

  • true.

  • false.

false

ResourceId

array

Yes

The list of resource IDs.

gw-uf6wjk5xxxxxxx

string

No

The list of gateway IDs. You can detach tags from N instances at a time. N can be a value from 1 to 50.

gw-uf6wjk5xxxxxxx

TagKey

array

No

The tag key.

Note
  • If the All parameter is not specified or is set to false, you must specify TagKey.

testkey1

string

No

The tag key. You can remove N tag keys at a time. N can be a value from 1 to 20. An empty string is not allowed.

testkey1

Response elements

Element

Type

Description

Example

object

RequestId

string

The request ID.

601B6F25-21E7-4484-99D5-3EF2625C0088

Examples

Success response

JSON format

{
  "RequestId": "601B6F25-21E7-4484-99D5-3EF2625C0088"
}

Error codes

HTTP status code

Error code

Error message

Description

400

MissingParameter.ResourceIds

The parameter - ResourceIds.N should not be null.

400

MissingParameter.Tags

The parameter - Tags should not be null.

400

Missing.TagKey

The Tag.N.Key parameter is blank.

400

InvalidParameter.TagKey

The Tag.N.Key parameter is invalid.

400

InvalidParameter.TagValue

The Tag.N.Value parameter is invalid.

400

InvalidParameter.ResourceType

The ResourceType parameter is invalid.

400

Duplicate.TagKey

The Tag.N.Key contain duplicate key.

400

The specified ResourceId is not found in our records.

The specified Tags and ResourcesIds are not allow to both empty.

400

NumberExceed.ResourceIds

The ResourceIds parameter's number is exceed , Valid : 50

400

NumberExceed.Tags

The Tags parameter's number is exceed , Valid : 20

403

PermissionDenied.Scope

The specified operator not have permission to set Scope value.

403

PermissionDenied.TagOwnerUid

The specified operator not have permission to set TagOwnerUid value.

403

PermissionDenied.TagOwnerBid

The specified operator not have permission to set TagOwnerBid value.

403

NoPermissionKey.Operator

These keys are not permission for this operator.

403

NoPermissionKey.Scope

These keys are not permission for this scope.

403

NoPermissionKey.Category

These keys are not permission for this category.

403

NoPermission.SystemTag

The operator is not permission for the system tag.

403

NoPermission.Operator

The operator is not permission for this operate.

404

InvalidResourceType.NotFound

The ResourceType provided does not exist in our records.

404

InvalidResourceId.NotFound

The specified ResourceId is not found in our records.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.