Updated on 2026-08-20 GMT+08:00

Querying Project Tags

Function

This API is used to query all key pair tags of a user in a specified project.

Calling Method

For details, see Calling APIs.

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, no identity policy-based permission required for calling this API.

URI

GET /v3/{project_id}/keypairs/tags

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Definition

Project ID. For details, see Obtaining a Project ID.

Constraints

N/A

Range

The value returned by the IAM API is used, which contains 32 characters.

Default Value

N/A

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

limit

No

Integer

Definition

Number of records to be queried

Constraints

  • The value of limit must be an integer.

Range

1 to 1000

Default Value

1000

offset

No

Integer

Definition

Index location. The query starts from the next data specified by offset. When you query resources on subsequent pages, set offset to the location returned in the response body for the previous query.

Constraints

  • The value of offset must be an integer.

Range

N/A

Default Value

The default value of offset is 0.

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Definition

User token. It can be obtained by calling the IAM API. The value of X-Subject-Token in the response header is the user token.

Constraints

N/A

Range

Obtain the value by calling the IAM API for obtaining the user token.

Default Value

N/A

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

tags

Array of TagResponse objects

Definition

Tag list, which is the value pairs of tag keys and values. key indicates the tag key. A key pair can have at most 20 keys. A key and its value must be unique and the key cannot be empty. Each key can contain at most 128 characters. value indicates the tag value. Each value can contain at most 255 characters. A search result matches all the values.

Range

N/A

total_count

Integer

Definition

Number of tags in a list

Range

N/A

Table 5 TagResponse

Parameter

Type

Description

key

String

Definition

Tag key

Range

N/A

values

Array of strings

Definition

Tag value set.

Range

N/A

Example Requests

None

Example Responses

Status code: 200

{
  "tags" : [ {
    "key" : "key1",
    "values" : [ "val1" ]
  }, {
    "key" : "key2",
    "values" : [ "val2" ]
  } ]
}

Status Codes

Status Code

Description

200

400

Invalid parameter.

401

Authorization failed.

403

Insufficient permissions.

404

Resource not found.

500

System error.

Error Codes

See Error Codes.