Help Center/ CodeArts Repo/ API Reference/ APIs/ Project (V2)/ Querying All Repositories of a User
Updated on 2025-03-28 GMT+08:00

Querying All Repositories of a User

Function

This API is used to obtain all repository information of a user.

URI

GET /v2/projects/repositories

Table 1 Query parameters

Parameter

Mandatory

Type

Description

page_index

No

Integer

Explanation:

Page index.

Range:

Minimum value: 1

Maximum value: 2147483647

Default value:

1

page_size

No

Integer

Explanation:

Number of records on each page.

Range:

Minimum value: 1

Maximum value: 100

Default value:

100

search

No

String

Explanation:

Search keyword.

Range:

1–512 characters.

Default value:

Empty.

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Explanation:

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

Constraints:

Mandatory

Range:

1–100,000 characters.

Default value:

None

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

error

Error object

Explanation:

Response error.

Range:

None

result

RepoListInfoV2 object

Explanation:

Response result.

Range:

None

status

String

Explanation:

Response status of the API.

Range:

  • success: The API call is successful.
  • failed: The API call failed.
Table 4 Error

Parameter

Type

Description

code

String

Explanation:

Error code returned when the API fails to be called.

Range:

  • CH.080002

message

String

Explanation:

Error code returned when the API fails to be called.

Range:

  • CH.080002: Invalid parameter.
Table 5 RepoListInfoV2

Parameter

Type

Description

repositories

Array of RepoInfoV2 objects

Explanation:

Repository list.

total

Integer

Explanation:

Total number of repositories.

Range:

0–2147483647

Table 6 RepoInfoV2

Parameter

Type

Description

created_at

String

Explanation:

Creation time.

Constraints:

Format: yyyy-MM-dd HH:mm:ss

creator_name

String

Explanation:

Name of the creator.

Range:

128 digits and letters.

domain_name

String

Explanation:

Tenant name of the creator.

Range:

128 digits and letters.

group_name

String

Explanation:

Repository group name (the segment between the domain name and repository name in a clone address).

Example: Demo00228 in [email protected]:Demo00228/testword.git

Range:

2–255 characters.

https_url

String

Explanation:

HTTPS repository address.

Range:

Max. 2,000 characters.

iam_user_uuid

String

Explanation:

IAM user ID.

Range:

32 digits and letters.

is_owner

Integer

Explanation:

Whether the user is the repository creator.

Range:

1: Yes

0: No

lfs_size

String

Explanation:

Repository LFS capacity.

Constraints:

Measured in MB or GB, with two decimal places.

project_is_deleted

String

Explanation:

Whether the project has been deleted.

Range:

false: No

true: Yes

project_uuid

String

Explanation:

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

Range:

32 digits and letters.

repository_id

Integer

Explanation:

Repository ID.

Range:

0–2147483647

repository_name

String

Explanation:

Repository name.

Range:

2–255 characters.

repository_size

String

Explanation:

Total repository capacity = Repository LFS capacity + Git repository capacity.

Constraints:

Measured in MB or GB, with two decimal places.

repository_uuid

String

Explanation:

Repo UUID, which is returned by the CreateRepository API.

Constraints:

32 digits and letters.

ssh_url

String

Explanation:

SSH repository address.

Range:

Max. 2,000 characters.

star

Boolean

Explanation:

Whether you have followed the repository.

Range:

false: No

true: Yes

status

Integer

Explanation:

Repository status.

Range:

0: The repository has been created.

1: The repository is being created.

2: The creation failed.

3: The repository is frozen.

4: The repository is closed.

updated_at

String

Explanation:

Update time.

Constraints:

Format: yyyy-MM-dd HH:mm:ss

userRole

Integer

Explanation:

Your role in the repository.

Constraints:

20: Read-only member

30: Common member

40: Administrator

visibility_level

Integer

Explanation:

Repository visibility.

Range:

0: Private repository

20: Public repository

web_url

String

Explanation:

Web URL, which redirects you to the repository details page.

Range:

Max. 2,000 characters.

Example Requests

GET https://{endpoint}/v2/projects/repositories

Example Responses

Status code: 200

OK

{
  "result" : {
    "total" : 29,
    "repositories" : {
      "repository_uuid" : "0bf1e7ceb5b341318cb72b42901abe54",
      "repository_id" : 468564,
      "repository_name" : "test",
      "ssh_url" : "[email protected]:test_new00001/test.git",
      "https_url" : "https://repo.alpha.devcloud.test.com/test_new00001/test.git",
      "group_name" : "test_new00001",
      "web_url" : "https://alpha.devcloud.test.com/repo/468564/home",
      "visibility_level" : 0,
      "created_at" : "2019-10-15 11:00:11",
      "updated_at" : "2019-10-15 11:00:11",
      "repository_size" : "0.05M",
      "lfs_size" : "0.00M",
      "creator_name" : "repo",
      "domain_name" : "repo",
      "star" : true,
      "status" : 0,
      "is_owner" : 1,
      "iam_user_uuid" : "a618e34bd5704be3ae3395dfede06041",
      "project_uuid" : "dc19b3ca6f334ce894a1ec467689797d",
      "project_is_deleted" : "false",
      "userRole" : null
    }
  },
  "status" : "success"
}

Status Codes

Status Code

Description

200

OK

Error Codes

See Error Codes.