Detaches and deletes tags from a list of specified ECS resources.

Debug

By using API Explorer, you can easily debug APIs, automatically generate SDK code examples, and quickly search for APIs.

Request parameters

Parameter Type Required? Example value Description
RegionId String Yes cn-hangzhou

The ID of the region to which the ECS resource belongs. For more information, callDescribeRegions to obtain the latest region list.

ResourceId.N RepeatList Yes i-bp1j6qtvdm8w0z1o0XXX

The ID of the ECS resource. Value range of N: 1 to 50.

ResourceType String Yes instance

The type of the ECS resource. Valid values:

  • instance
  • disk
  • snapshot
  • image
  • securitygroup
  • volume
  • eni
  • ddh
  • keypair
  • launchtemplate
Action String No UntagResources

The name of this action. Value: UntagResources

All Boolean No false

Specifies whether to delete all the tags from the specified resources. This parameter is valid when TagKey.N is not specified in a request. Default value: false.

TagKey.N RepeatList No FinanceDept

The value of a tag. Value range of N: 1 to 20. The parameter can be a null string, and must be 1 to 128 characters in length.It can neither start with aliyun or acs:, nor contain http:// or https://.

Response parameters

Parameter Type Example value Description
RequestId String C46FF5A8-C5F0-4024-8262-B16B639225A0

The request ID.

Examples

Request example


https://ecs.aliyuncs.com/?Action=UntagResources
&RegionId=cn-hangzhou
&ResourceType=instance
&ResourceId.1=i-bp1j6qtvdm8w0z1o0XXX
&TagKey.1=FinanceDept
&<Common Request Parameters>

Response example

XML format

<UntagResourcesResponse>
  <RequestId>C46FF5A8-C5F0-4024-8262-B16B639225A0</RequestId>
</UntagResourcesResponse>

JSON format

{
	"RequestId":"C46FF5A8-C5F0-4024-8262-B16B639225A0"
}

Errors

HTTP status code Error codes Error message Description
404 MissingParameter.TagOwnerUid The parameter - TagOwnerUid should not be null The tag owner UID is not specified.
404 MissingParameter.TagOwnerBid The parameter - TagOwnerBid should not be null The tag owner BID is not specified.
404 MissingParameter.ResourceType The parameter - ResourceType should not be null The resource type is not specified.
404 MissingParameter.Tags The parameter - Tags should not be null The Tags parameter is not specified.
404 MissingParameter.RegionId The parameter - RegionId should not be null The region ID is not specified.
403 PermissionDenied.TagOwnerUid The specified operator not have permission to set TagOwnerUid value. You do not have permission to set the tag owner.
403 PermissionDenied.Scope The specified operator not have permission to set Scope value. You do not have permission to modify the scope value.
400 NumberExceed.ResourceIds The ResourceIds parameter's number is exceed , Valid : 50 The number of resource IDs cannot exceed 50.
400 NumberExceed.Tags The Tags parameter's number is exceed , Valid : 20 The number of tags cannot exceed 20.
400 Duplicate.TagKey The Tag.N.Key contain duplicate key. Duplicate tag keys exist.
404 InvalidResourceId.NotFound The specified ResourceIds are not found in our records. The specified resource does not exist.
404 InvalidResourceType.NotFound The ResourceType provided does not exist in our records. The specified resource type does not exist.
400 InvalidTagKey.Malformed The specified Tag.n.Key is not valid. The specified tag key is invalid.
400 InvalidTagValue.Malformed The specified Tag.n.Value is not valid. The specified tag value is invalid.
400 OperationDenied.QuotaExceed The quota of tags on resource is beyond permitted range. The quota of resource tags is reached.
403 InvalidResourceId.NotSupported The specified ResourceId does not support tagging. The specified resource ID does not support tags.
400 InvalidTag.Mismatch The specified Tag.n.Key and Tag.n.Value are not match. The specified Tag.n.Key and Tag.n.Value do not match.
400 InvalidTagCount The specified tags are beyond the permitted range. The specified number of tags exceeds the quota.
404 InvalidRegionId.NotFound The specified RegionId does not exist. The specified region ID does not exist. Please check if this product is available in this region.
400 Invalid.Scope The specified scope is invalid. The specified scope is invalid.
403 NoPermission.Tag The operator is not permission for the tag. You do not have permission to use this resource tag.

For a list of error codes, visit the API Error Center.