All Products
Search
Document Center

Resource Management:UntagResources

Last Updated:Mar 03, 2024

Removes tags from the resources of various Alibaba Cloud services.

Operation description

After you remove a tag, the tag is automatically deleted within 24 hours if it is not added to other resources.

For information about the Alibaba Cloud services that support tags, see Services that work with Tag.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

There is currently no authorization information disclosed in the API.

Request parameters

ParameterTypeRequiredDescriptionExample
RegionIdstringYes

The region ID.

cn-hangzhou
ResourceARNarrayYes

The Alibaba Cloud Resource Name (ARN) of a resource.

stringYes

The ARN of a resource.

Valid values of N: 1 to 50.

Format: arn:acs:${ProductCode}:${Region}:${Account}:${ResourceType}/${ResourceId}. Fields:

  • ProductCode: the service code. You can set this field to a value obtained from the response of the ListSupportResourceTypes operation.
  • Region: the region ID of the resource. You can set this field to an asterisk (*) to indicate the current region.
  • Account: the ID of the Alibaba Cloud account to which the resource belongs. You can set this field to an asterisk (*) to indicate the current Alibaba Cloud account.
  • ResourceType: the resource type. You can set this field to a value obtained from the response of the ListSupportResourceTypes operation.
  • ResourceId: the resource ID.
Note You can set ProductCode and ResourceType in ResourceARN to values defined in Resource Group, ActionTrail, or Resource Center.
arn:acs:vpc:cn-hangzhou:123456789****:vpc/vpc-bp19dd90tkt6tz7wu****
TagKeyarrayYes

A tag key.

stringYes

A tag key.

Valid values of N: 1 to 10.

k1

For more information about common request parameters, see Common parameters.

Response parameters

ParameterTypeDescriptionExample
object

The returned result.

RequestIdstring

The ID of the request.

43D12436-B10F-4469-8136-FD1C5D2B2083
FailedResourcesobject []

The information about the resources from which tags fail to be removed.

Note
  • If tags are removed from all resources, the value of FailedResources is empty.

  • If tags fail to be removed from some or all resources, the value of FailedResources contains the detailed information about the resources.

ResourceARNstring

The ARN of the resource.

arn:acs:ecs:cn-hangzhou:123456789****:instance/i-xxxxxxxxxx1
Resultobject

The information about the error.

Codestring

The error code.

InvalidResourceId.NotFound
Messagestring

The error message.

The specified ResourceIds are not found in our records.

Examples

Sample success responses

JSONformat

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

Error codes

HTTP status codeError codeError messageDescription
400InvalidParameter.ServiceCodeThe ServiceCode parameter of ResourceIdARN is invalid.-
403Duplicate.TagKeyThe Tag.N.Key contains duplicate keys.The Tag.N.Key contains duplicate keys.
403InvalidParameter.CategoryThe specified Category is invalid. Valid values are Custom and System.The specified Category is invalid. Valid values are Custom and System.
403MissingParameter.CreatebyYou must specify Createby.You must specify Createby.
403MissingParameter.ResourceIdsYou must specify ResourceIds.You must specify ResourceIds.
403NoPermission.OperatorThe user is not authorized to operate on the specified resource.The user is not authorized to operate on the specified resource.
403NoPermission.SystemTagThe user does not have permission to operate the system tag.The user does not have permission to operate the system tag.
403NoPermissionKey.CategorySome keys cannot be modified because the user does not have permission.Some keys cannot be modified because the user does not have permission.
403NoPermissionKey.OperatorYou are not authorized to operate the tag key.You are not authorized to operate the tag key.
403NumberExceed.ResourceIdsThe maximum number of ResourceIds is exceeded.The maximum number of ResourceIds is exceeded.
403NumberExceed.TagsThe maximum number of Tags is exceeded.The maximum number of Tags is exceeded.
403QuotaExceed.TagsPerResourceThe maximum number of tags for each resource is exceeded.The maximum number of tags for each resource is exceeded.
403Invalid.ResourceIdARNThe parameter ResourceIdARN is invalid.The parameter ResourceIdARN is invalid.
403Missing.ServiceCodeYou must specify ServiceCode.You must specify ServiceCode.
403InvalidParameter.ResourceTypeThe ResourceType parameter is invalid.The ResourceType parameter is invalid.
403InvalidParameter.TagKeyThe Tag.N.Key parameter is invalid.The Tag.N.Key parameter is invalid.
403InvalidParameter.TagValueThe Tag.N.Value parameter is invalid.The Tag.N.Value parameter is invalid.
404Missing.TagKeyTag.N.Value has been specified and you must specify Tag.N.Key.Tag.N.Value has been specified and you must specify Tag.N.Key.
404MissingParameter.AliUidYou must specify AliUid.You must specify AliUid.
404MissingParameter.BidYou must specify Bid.You must specify Bid.
404MissingParameter.TagKeyYou must specify TagKey.You must specify TagKey.

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

Change history

Change timeSummary of changesOperation
2024-02-27The Error code has changedsee changesets
Change itemChange content
Error CodesThe Error code has changed.
    Error Codes 400 change
    Error Codes 403 change
    delete Error Codes: 404