All Products
Search
Document Center

Resource Management:ListTagResources

Last Updated:Aug 28, 2026

Queries tags added to resource groups or resource directory members.

Operation description

The following example queries tags on resource group rg-aekz6bre2uq****. The response shows that only the k1:v1 tag is added.

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

resourcemanager:ListTagResources

list

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

NextToken

string

No

The pagination token for the next query.

caeba0bbb2be03f84eb48b699f0a****

MaxResults

integer

No

The number of entries per page.

Valid values: 1 to 100. Default value: 10.

10

Tag

array<object>

No

The tag key and value.

object

No

The tag key and value.

Key

string

No

A tag key.

k1

Value

string

No

A tag value.

v1

ResourceId

array

No

The resource ID.

string

No

The ID of a resource group or member.

Note

To query tags on resource directory members, specify both ResourceId.N and ResourceType, and set ResourceType to Account.

rg-aekz6bre2uq****

ResourceType

string

No

The resource type to query. Valid values:

  • ResourceGroup: resource group. This is the default value.

  • Account: member.

ResourceGroup

This operation also uses Common parameters.

Response elements

Element

Type

Description

Example

object

NextToken

string

The pagination token.

  • Empty ("NextToken": ""): all results have been returned.

  • Non-empty: pass this value as NextToken in the next request to retrieve more results.

caeba0bbb2be03f84eb48b699f0a****

RequestId

string

The request ID.

8054B059-6B36-53BF-AA45-B8C9A0ED05AB

TagResources

array<object>

The tags.

object

ResourceId

string

The ID of the resource group or member.

rg-aekz6bre2uq****

ResourceType

string

The resource type. Valid values:

  • resourcegroup: resource group

  • Account: member

resourcegroup

TagKey

string

The tag key.

k1

TagValue

string

The tag value.

k1

Examples

Success response

JSON format

{
  "NextToken": "caeba0bbb2be03f84eb48b699f0a****",
  "RequestId": "8054B059-6B36-53BF-AA45-B8C9A0ED05AB",
  "TagResources": [
    {
      "ResourceId": "rg-aekz6bre2uq****",
      "ResourceType": "resourcegroup",
      "TagKey": "k1",
      "TagValue": "k1"
    }
  ]
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.