Updated on 2025-11-12 GMT+08:00

Querying Resource Tags

Function

This API is used to query tags attached to the specified resource.

Authorization Information

Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions.

  • If you are using role/policy-based authorization, see Permissions Policies and Supported Actions for details on the required permissions.
  • If you are using identity policy-based authorization, the following identity policy-based permissions are required.

    Action

    Access Level

    Resource Type (*: required)

    Condition Key

    Alias

    Dependencies

    organizations:resources:list

    List

    -

    -

    -

    -

URI

GET /v1/organizations/{resource_type}/tags

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

resource_type

Yes

String

Resource type. It can be organizations:policies, organizations:ous, organizations:accounts, or organizations:roots.

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Security-Token

No

String

Security token (session token) of your temporary security credentials. If a temporary security credential is used, this header is required.

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

tags

Array of TagsDTO objects

A custom key-value pair.

Table 4 TagsDTO

Parameter

Type

Description

key

String

Key. Each tag key can contain a maximum of 127 Unicode characters and cannot be left blank.

values

Array of strings

List of values. Each value can contain a maximum of 255 Unicode characters.

Example Requests

Querying resource tags

GET https://{endpoint}/v1/organizations/{resource_type}/tags

Example Responses

Status code: 200

Successful

{
  "tags" : [ {
    "key" : "key1",
    "values" : [ "value1", "velua2" ]
  } ]
}

Status Codes

Status Code

Description

200

Successful

Error Codes

See Error Codes.