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.
URI
GET https://{hostURL}/v4/user/repositories
| 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: Constraints: N/A Default value: created_at Default value: created_at Enumeration values: |
| sort | No | String | Definition: Sorting field Value range: Constraints: N/A Default value: desc Default value: desc Enumeration values: |
| archived | No | Boolean | Definition: Archived or not. Value range: 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: Constraints: N/A Default value: N/A Default value: false |
| membership | No | Boolean | Definition: Repositories that you participate in (as repository member) Value range: Constraints: N/A Default value: N/A Default value: false |
| user_created | No | Boolean | Definition: Created repository Value range: Constraints: N/A Default value: N/A Default value: false |
| include_abnormal | No | Boolean | Definition: Whether to include repositories in abnormal states. Value range: Constraints: N/A Default value: N/A |
Request Parameters
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| X-Auth-Token | Yes | String | Definition User token. Obtain a token by calling the IAM API for obtaining a user token. The value of X-Subject-Token in the response header is the user token. Constraints Mandatory. Range 1–100,000 characters. Default Value N/A. |
Response Parameters
Status code: 200
| Parameter | Type | Description |
|---|---|---|
| [items] | Array of RepositorySimplestDto objects | Repository list. |
| 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 | 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 |
| 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.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.