Help Center/ ModelArts/ API Reference/ Model Training/ Training Job Management (New Version)/ Obtaining the List of Training Job Tags in a Project
Updated on 2026-09-01 GMT+08:00

Obtaining the List of Training Job Tags in a Project

Function

This API is used to obtain the set of tags used by all training jobs in a specified project. The tags are aggregated by tag key, and each key contains all different values.

This API is used when you need to obtain the list of all tag key-value pairs used by training jobs in a project for tag filtering, resource classification, or management. Before using this API, ensure that you have the permission to view tags. After the query is complete, the platform returns the aggregation result of all training job tags in the project. The tags are grouped by key, and all different values of each key are listed. If you do not have the permission to perform operations, the API will return an error message.

Debugging

You can debug this API through automatic authentication in API Explorer or use the SDK sample code generated by API Explorer.

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 /v2/{project_id}/modelarts-training-job/tags

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Definition: Project ID. For details, see Obtaining a Project ID and Name.

Constraints: N/A

Range: The value can contain 1 to 64 characters. Only letters, digits, and hyphens (-) are allowed.

Default Value: N/A

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

limit

No

Integer

Definition: Number of tag keys returned on each page.

Constraints: N/A

Range: 1 to 1000.

Default Value: 1000

offset

No

Integer

Definition: Offset of pagination query.

Constraints: N/A

Range: greater than or equal to 0

Default Value: 0

Request Parameters

None

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

tags

Array of ProjectTag objects

Definition: Tag list, which is aggregated by key. Each key contains all different values that have appeared under the key in the project.

Range: N/A

Table 4 ProjectTag

Parameter

Type

Description

key

String

Definition: Tag key.

Range: 1 to 128 characters. Only letters, digits, and special characters (_.:=+-@) are allowed. The value cannot start with sys.

values

Array of strings

Definition: List of all different values under the key, which has been deduplicated.

Range: 0 to 255 characters. Only letters, digits, and special characters (_.:/=+-@) are allowed.

Example Requests

Obtain all training job tags in the project.

GET https://{endpoint}/v2/{project_id}/modelarts-training-job/tags

Example Responses

Status code: 200

Query succeeded.

{
  "tags" : [ {
    "key" : "111",
    "values" : [ "v2", "v3" ]
  }, {
    "key" : "k2",
    "values" : [ "v2" ]
  }, {
    "key" : "test",
    "values" : [ "1122" ]
  } ]
}

Status Codes

Status Code

Description

200

Query succeeded.

Error Codes

See Error Codes.