Help Center/ CodeArts Check/ API Reference/ APIs/ Task Management/ Obtaining the Code Repository List from CodeArts Repo
Updated on 2026-02-03 GMT+08:00

Obtaining the Code Repository List from CodeArts Repo

Function

This API is used to query CodeArts Repo repositories in a project with pagination based on the project ID and code repository name. Information such as the code repository address, repository name, and Repo ID is 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:get

Read

task *

-

-

-

-

codeartscheck:ProjectId

URI

GET /v4/codehub/repo-list

Table 1 Query Parameters

Parameter

Mandatory

Type

Description

project_id

No

String

Definition :

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

Constraints:

N/A

Value range:

32 characters.

Default value:

N/A

page

No

Integer

Definition:

Page number, starting from 0.

Constraints:

N/A

Value range:

0-999999

Default value:

0

page_size

No

Integer

Definition:

Page size.

Constraints:

N/A

Value range:

1–200

Default value:

100

search

No

String

Definition:

Search for a code repository by name.

Constraints:

N/A

Value range:

N/A

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

Referer

No

String

Definition:

Forwarding host information.

Constraints:

N/A

Value range:

N/A

Default value:

N/A

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

total

Integer

Definition:

Total number of records.

Value range:

≥0

data

Array of CodeHubRepoInfo objects

Definition:

Response data.

Range:

N/A

Table 4 CodeHubRepoInfo

Parameter

Type

Description

repoId

String

Definition:

Code repository ID.

Value range:

N/A

repoName

String

Definition:

Code repository name.

Range:

N/A

codeHubName

String

Definition:

Repository address.

Range:

N/A

language

String

Definition:

Code repository language type.

Range:

N/A

isLanguageSupported

Boolean

Definition:

Whether the language type is supported.

Value range:

  • null: undefined.

  • false: not supported.

  • true: supported.

developMode

String

Definition:

Development mode.

Range:

N/A

taskList

Array of CodeHubTask objects

Definition:

CodeArts Repo task list.

Range:

N/A

Table 5 CodeHubTask

Parameter

Type

Description

id

String

Definition:

Task ID.

Value range:

N/A

name

String

Definition:

Task name.

Range:

N/A

branch

String

Definition:

Branch name.

Range:

N/A

gitUrl

String

Definition:

Repository address.

Range:

N/A

Status code: 400

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

Status code: 401

Table 7 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

This API is used to query the CodeArts Repo repository list.

GET https://{endpoint}/v4/codehub/repo-list?project_id=cebdbff4535f4c1f8c790d53xxxxxxxx&page=1&page_size=10&search=&

Example Responses

Status code: 200

CodeArts Repo repository list is obtained.

{
  "total" : 10,
  "data" : [ {
    "repoId" : "2112041445",
    "repoName" : "test",
    "codeHubName" : "git@codehub.devcloud.example.com/test.git",
    "language" : "",
    "isLanguageSupported" : false,
    "developMode" : "normal",
    "taskList" : [ {
      "id" : "53f7055bedc44a3086bbc005xxxxxxxx",
      "name" : "testxxxxx",
      "branch" : "master",
      "gitUrl" : "git@codehub.devcloud.example.com/test.git"
    } ]
  }, {
    "repoId" : "2112041446",
    "repoName" : "test2",
    "codeHubName" : "git@codehub.devcloud.example.com/test2.git",
    "language" : "",
    "isLanguageSupported" : false,
    "developMode" : "normal",
    "taskList" : [ ]
  } ]
}

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

CodeArts Repo repository list is obtained.

400

Bad Request

401

Unauthorized

Error Codes

See Error Codes.