Help Center/ CodeArts Repo/ API Reference/ APIs/ V4/ Repository/ Obtaining the Repository of the Current Login User
Updated on 2026-01-27 GMT+08:00

Obtaining the Repository of the Current Login User

Function

This API is used to obtain the repository of the current login user.

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

codeartsrepo:repository:getRepository

Read

-

-

-

-

URI

GET https://{hostURL}/v4/user/repositories

Table 1 Query Parameters

Parameter

Mandatory

Type

Description

offset

No

Integer

Definition

Offset, which starts from 0.

Value range:

0~2147483647

Default value:

0

limit

No

Integer

Definition

Number of returned records.

Value range:

1~100

Default value:

20

order_by

No

String

Definition:

Sorting field

Value range:

  • created_at: creation time

  • updated_at: update time

Constraints:

N/A

Default value:

created_at

Default value:

created_at

Enumeration values:

  • created_at

  • updated_at

sort

No

String

Definition:

Sorting field

Value range:

  • asc: ascending order

  • desc: descending order

Constraints:

N/A

Default value:

desc

Default value:

desc

Enumeration values:

  • asc

  • desc

archived

No

Boolean

Definition:

Archived or not.

Value range:

  • true: yes

  • false: no

Constraints:

N/A

Default value:

false.

Default value:

false

search

No

String

Definition:

Repository search

Value range:

1–512

Constraints:

N/A

Default value:

N/A

starred

No

Boolean

Definition:

Favorited repository

Value range:

  • true: favorited

  • false: not favorited

Constraints:

N/A

Default value:

N/A

Default value:

false

membership

No

Boolean

Definition:

Repositories that you participate in (as repository member)

Value range:

  • true: joined repositories

  • false: no filtering

Constraints:

N/A

Default value:

N/A

Default value:

false

user_created

No

Boolean

Definition:

Created repository

Value range:

  • true: Filter the repositories created by the current user.

  • false: no filtering

Constraints:

N/A

Default value:

N/A

Default value:

false

include_abnormal

No

Boolean

Definition:

Whether to include repositories in abnormal states.

Value range:

  • true: yes

  • false: no

Constraints:

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

Range

1–100,000 characters.

Default Value

N/A

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

[items]

Array of RepositorySimplestDto objects

Repository list.

Table 4 RepositorySimplestDto

Parameter

Type

Description

id

Integer

Definition:

Repository ID.

Constraints:

N/A.

Value range:

1~2147483647

name

String

Definition:

Repository name.

Constraints:

N/A.

namespace

String

Definition:

Namespace.

Constraints:

N/A.

path

String

Definition:

Repository path.

Constraints:

N/A.

develop_mode

String

Definition:

Development mode.

Constraints:

N/A.

visibility

String

Definition:

Visibility.

Constraints:

N/A.

security

String

Definition:

Security level.

Constraints:

N/A.

star_count

Integer

Definition:

Follows.

Constraints:

N/A.

Value range:

1~2147483647

forks_count

Integer

Definition:

Number of forks.

Constraints:

N/A.

Value range:

1~2147483647

open_issues_count

Integer

Definition:

Number of enabled issues.

Constraints:

N/A.

Value range:

1~2147483647

open_merge_requests_count

Integer

Definition:

Number of enabled merge requests.

Constraints:

N/A.

Value range:

1~2147483647

starred

Boolean

Definition:

Favorite or not.

Constraints:

N/A.

name_with_namespace

String

Definition:

Repository name with a namespace.

Constraints:

N/A.

last_activity_at

String

Definition:

Time when the last action was performed.

Constraints:

N/A.

forked_from_repository

ForkedFromRepositorySimplestDto object

Definition:

Source repository of the fork repository.

Constraints:

N/A.

permissions

Integer

Definition:

Permission.

Constraints:

N/A.

Value range:

1~2147483647

archived

Boolean

Definition:

Archived or not.

Constraints:

N/A.

member_count

Integer

Definition:

Number of members.

Constraints:

N/A.

Value range:

1~2147483647

uuid

String

Definition:

Unique repository identifier.

Constraints:

N/A.

description

String

Definition:

Repository description.

Constraints:

N/A.

last_repository_updated_at

String

Definition:

Last update time.

Constraints:

N/A.

ssh_url_to_repo

String

Definition:

SSH repository URL.

Constraints:

N/A.

http_url_to_repo

String

Definition:

HTTP repository URL.

Constraints:

N/A.

status

String

Definition:

Repository status.

Constraints:

N/A.

active_statistic

Array of integers

Definition:

Active user statistics.

Constraints:

N/A.

Value range:

1~2147483647

project_name

String

Definition:

Project name.

Constraints:

N/A.

project_id

String

Definition:

Project ID.

Constraints:

N/A.

project_is_delete

Boolean

Definition:

Whether to delete the project.

Constraints:

N/A.

creator_id

Integer

Definition:

Creator ID.

Constraints:

N/A.

Value range:

1~2147483647

Table 5 ForkedFromRepositorySimplestDto

Parameter

Type

Description

name_with_namespace

String

Definition:

Name of a repository that has a namespace.

Constraints:

N/A.

path_with_namespace

String

Definition:

Repository path that has a namespace.

Constraints:

N/A.

name

String

Definition:

Repository name.

Constraints:

N/A.

namespace

String

Definition:

Namespace.

Constraints:

N/A.

id

Integer

Definition:

Repository ID.

Constraints:

N/A.

Value range:

1~2147483647

project_id

String

Definition:

Product ID.

Constraints:

N/A.

project_name

String

Definition:

Product name.

Constraints:

N/A.

Example Requests

None

Example Responses

Status code: 200

Repository list.

[ {
  "id" : 2112036156,
  "name" : "GPublic01",
  "namespace" : "80ffa3ec7a6d4ba9ba33aaddce828d26/G001/GPublic01",
  "path" : "GPublic01",
  "develop_mode" : "normal",
  "visibility" : "private",
  "security" : "internal",
  "star_count" : 0,
  "forks_count" : 0,
  "open_merge_requests_count" : 0,
  "starred" : false,
  "name_with_namespace" : "80ffa3ec7a6d4ba9ba33aaddce828d26 / G001 / GPublic01",
  "last_activity_at" : "2025-06-19T19:30:41.000+08:00",
  "forked_from_repository" : { },
  "permissions" : 50,
  "archived" : false,
  "member_count" : 4,
  "uuid" : "589234dcfd5f4dbfa3dd365c80dd035f",
  "description" : "",
  "last_repository_updated_at" : "2025-06-19T19:30:41.000+08:00",
  "ssh_url_to_repo" : "git@repo.com:80ffa3ec7a6d4ba9ba33aaddce828d26/G001/GPublic01.git",
  "http_url_to_repo" : "https://repo.com/80ffa3ec7a6d4ba9ba33aaddce828d26/G001/GPublic01.git",
  "status" : "0",
  "active_statistic" : [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0 ],
  "project_name" : "sec_cz_test",
  "project_id" : "80ffa3ec7a6d4ba9ba33aaddce828d26",
  "project_is_delete" : false,
  "creator_id" : 1
} ]

Status Codes

Status Code

Description

200

Repository list.

Error Codes

See Error Codes.