Help Center/ CodeArts Check/ API Reference/ APIs/ Task Management/ Querying Groups of a Project
Updated on 2026-02-03 GMT+08:00

Querying Groups of a Project

Function

This API is used to query all groups of a project by project ID. The group ID, group name, and number of code check tasks in the group are returned.

Calling Method

For details, see Calling APIs.

Authorization Information

Each account root user has all the permissions required to call all APIs, but IAM users must be assigned the following required identity policy-based permissions. For details about the required permissions, see Permissions Policies and Supported Actions.

Action

Access Level

Resource Type (*: required)

Condition Key

Alias

Dependencies

codeartscheck:task:list

List

task *

-

-

-

-

codeartscheck:ProjectId

URI

GET /v4/projects/{project_id}/task-groups

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Definition :

32-character project UUID. Obtain it by calling the API used to query the project list.

Constraints:

N/A

Value range:

1 to 32 characters.

Default value:

N/A

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Definition :

User token. Obtain one by calling the IAM API Obtaining a User Token. The value of X-Subject-Token in the response header is a token.

Constraints:

N/A

Value range:

1–100,000 characters.

Default value:

N/A

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

group_total

Integer

Definition:

Total number of task groups.

Value range:

≥0

task_total

Integer

Definition:

Total number of tasks

Value range:

≥0

result

Array of TaskGroupResult objects

Definition:

Task group response result, which is returned in a tree structure.

Range:

N/A

Table 4 TaskGroupResult

Parameter

Type

Description

id

String

Definition:

ID of the task group node.

Value range:

1 to 128 characters.

name

String

Definition:

Name of the task group node.

Range:

N/A

task_total

Integer

Definition:

Total number of tasks in the task group node.

Value range:

≥0

sons

TaskGroupResult object

Definition:

Task group node information.

Value range:

N/A

Status code: 400

Table 5 Response body parameters

Parameter

Type

Description

error_code

String

Definition:

Error code.

Value range:

N/A

error_msg

String

Definition:

Error message.

Value range:

N/A

Status code: 401

Table 6 Response body parameters

Parameter

Type

Description

error_code

String

Definition:

Error code.

Value range:

N/A

error_msg

String

Definition:

Error message.

Value range:

N/A

Example Requests

Obtain the task group information of the project specified by project_id.

GET https://{endpoint}/v4/projects/40a381e7abf9xxxxxx5d686561ad8a76/task-groups

Example Responses

Status code: 200

Request succeeded!

{
  "group_total" : 16,
  "task_total" : 17,
  "result" : [ {
    "id" : "fxxxx7ba3ae14a87a32b151bcbe20801",
    "name" : "task group name1",
    "sons" : [ {
      "id" : "fxxxx7ba3ae14a87a32b151bcbe20802",
      "name" : "task group name2"
    } ],
    "task_total" : 5
  }, {
    "id" : "fxxxx7ba3ae14a87a32b151bcbe20803",
    "name" : "task group name3",
    "task_total" : 12
  }, {
    "id" : "fxxxx7ba3ae14a87a32b151bcbe20804",
    "name" : "task group name4"
  } ]
}

Status code: 400

Bad Request

{
  "error_code" : "CC.xxxxxxxx.400",
  "error_msg" : "Verify request parameter failed. Check whether the request parameters are correct."
}

Status code: 401

Unauthorized

{
  "error_code" : "CC.00000003",
  "error_msg" : "Authentication information expired."
}

Status Codes

Status Code

Description

200

Request succeeded!

400

Bad Request

401

Unauthorized

Error Codes

See Error Codes.