Unbinds tags from the resources of various cloud services. After a tag is unbound, the tag is automatically deleted within 24 hours if it is not bound to any other resources.

Note You cannot call this operation as a RAM user or by using Security Token Service (STS).

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

Parameter Type Required Example Description
Action String Yes UntagResources

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

RegionId String Yes cn-hangzhou

The region ID of the resource.

ResourceARN.N RepeatList Yes arn:acs:ecs:cn-hangzhou:123456789****:instance/i-xxxxxxxxxx1

The Alibaba Cloud Resource Name (ARN) of resource N. For more information about supported resource types and ARN examples, see Types of resources that support tag API operations.

Valid values of N: 1 to 10.

Example: ResourceARN.1 = arn:acs:${Service}:${Region}:${Account}:${ResourceType}/${ResourceId}.

TagKey.N RepeatList Yes k1

The key of tag N. Valid values of N: 1 to 10.

Response parameters

Parameter Type Example Description
FailedResources Array

The information of resources with tag unbinding errors.

FailedResource
ResourceARN String arn:acs:ecs:cn-hangzhou:123456789****:instance/i-xxxxxxxxxx1

The ARN of the resource.

Result Struct

The information of the error.

Code String InvalidResourceId.NotFound

The error code.

Message String The specified ResourceIds are not found in our records.

The error message.

RequestId String 43D12436-B10F-4469-8136-FD1C5D2B2083

The ID of the request.

Note
  • If tags are unbound from all resources, the value of FailedResources is empty.
  • If tags failed to be unbound from some or all resources, the value of FailedResources includes the resource ARNs, error codes, and error messages.

Examples

Sample requests

https://tag.aliyuncs.com/?Action=UntagResources
&RegionId=cn-hangzhou
&ResourceARN.1=arn:acs:ecs:cn-hangzhou:123456789****:instance/i-xxxxxxxxxx1
&TagKey.1=k1
&<Common request parameters>

Sample success responses

XML format

<UntagResourcesResponse>
      <RequestId>43D12436-B10F-4469-8136-FD1C5D2B2083</RequestId>
      <FailedResources>
            <FailedResource>
                  <ResourceARN>arn:acs:ecs:cn-hangzhou:123456789****:instance/i-xxxxxxxxxx1</ResourceARN>
                  <Result>
                        <Message>The specified ResourceIds are not found in our records. </Message>
                        <Code>InvalidResourceId.NotFound</Code>
                  </Result>
            </FailedResource>
      </FailedResources>
</UntagResourcesResponse>

JSON format

{
    "RequestId": "43D12436-B10F-4469-8136-FD1C5D2B2083",
    "FailedResources": {
        "FailedResource": [
            {
                "ResourceARN": "arn:acs:ecs:cn-hangzhou:123456789****:instance/i-xxxxxxxxxx1",
                "Result": {
                    "Message": "The specified ResourceIds are not found in our records.",
                    "Code": "InvalidResourceId.NotFound"
                }
            }
        ]
    }
}

Error codes

HTTP status code Error code Error message Description
403 Duplicate.TagKey The Tag.N.Key contains duplicate keys. The error message returned because a duplicate tag key is specified.
403 InvalidParameter.Category The specified Category is invalid. Valid values are Custom and System. The error message returned because the value of the Category parameter is invalid. The value can be Custom or System.
404 Missing.TagKey Tag.N.Value has been specified and you must specify Tag.N.Key. The error message returned because the key of tag N is not specified.
404 MissingParameter.AliUid You must specify AliUid. The error message returned because the AliUid parameter is not specified.
404 MissingParameter.Bid You must specify Bid. The error message returned because the Bid parameter is not specified.
403 MissingParameter.Createby You must specify Createby. The error message returned because the Createby parameter is not specified.
403 MissingParameter.ResourceIds You must specify ResourceIds. The error message returned because the ResourceIds parameter is not specified.
404 MissingParameter.TagKey You must specify TagKey. The error message returned because the TagKey parameter is not specified.
403 NoPermission.Operator The user is not authorized to operate on the specified resource. The error message returned because you are not authorized to perform the operation.
403 NoPermission.SystemTag The user does not have permission to operate the system tag. The error message returned because you are not authorized to perform operations on the system tag.
403 NoPermissionKey.Category Some keys cannot be modified because the user does not have permission. The error message returned because you are not authorized to perform operations on some tag keys.
403 NoPermissionKey.Operator You are not authorized to operate the tag key. The error message returned because you are not authorized to perform operations on the tag key.
403 NumberExceed.ResourceIds The maximum number of ResourceIds is exceeded. The error message returned because the maximum value of the ResourceIds parameter has been reached.
403 NumberExceed.Tags The maximum number of Tags is exceeded. The error message returned because the maximum value of the Tags parameter has been reached.
403 QuotaExceed.TagsPerResource The maximum number of tags for each resource is exceeded. The error message returned because the maximum number of tags for a resource has been reached.
403 Invalid.ResourceIdARN The parameter ResourceIdARN is invalid. The error message returned because the value of the ResourceIdARN parameter is invalid.
400 InvalidParameter.ServiceCode The ServiceCode parameter of ResourceIdARN is invalid. The error message returned because the value of the ServiceCode parameter for the resource specified by the ResourceIdARN parameter is invalid.
403 Missing.ServiceCode You must specify ServiceCode. The error message returned because the ServiceCode parameter is not specified.
403 InvalidParameter.ResourceType The ResourceType parameter is invalid. The error message returned because the value of the ResourceType parameter is invalid.
403 InvalidParameter.TagKey The Tag.N.Key parameter is invalid. The error message returned because the value of the TagKey parameter is invalid.
403 InvalidParameter.TagValue The Tag.N.Value parameter is invalid. The error message returned because the value of the TagValue parameter is invalid.

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