Transferring a Repository
Function
This API is used to transfer a repository to another repository group.
Debugging
You can debug this API through automatic authentication in API Explorer or use the SDK sample code generated by API Explorer.
Authorization Information
No identity policy-based permission required for calling this API.
URI
POST https://{hostURL}/v4/repositories/{repository_id}/transfer
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| repository_id | Yes | Integer | Definition You can call the API used to query all repositories of the user to query the project list to obtain the repository ID. Constraints N/A Default Value N/A Value range: 1~2147483647 |
Request Parameters
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| X-Auth-Token | Yes | String | Definition User token. You can obtain the token by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token. Constraints N/A Range A string that can contain 1 to 100,000 characters. Default Value N/A |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| namespace | No | String | Definition Namespace path. Constraints Mandatory. Range N/A Default Value N/A |
Response Parameters
Status code: 200
| Parameter | Type | Description |
|---|---|---|
| id | Integer | Definition: Repository ID. Value range: 1~2147483647 |
| description | String | Definition: Repository description. |
| name | String | Definition: Repository name. |
| name_with_namespace | String | Definition: Repository full name. |
| path | String | Definition: Repository path. |
| path_with_namespace | String | Definition: Complete repository path. |
| created_at | String | Definition: Creation time. |
| updated_at | String | Definition: Update time. |
| archived | Boolean | Definition: Archived or not. |
| ssh_url_to_repo | String | Definition: Repository SSH address. |
| http_url_to_repo | String | Definition: HTTP address of the repository. |
| project_id | String | Definition: Repository project ID. |
| project_name | String | Definition: Repository project name. |
| develop_mode | String | Definition: Repository development mode. Value range: Enumeration values: |
| moderation_result | Boolean | Definition: Review status. |
| default_branch | String | Definition: Default branch of the repository. Constraints: N/A. |
| avatar_url | String | Definition: Repository icon URL. 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 enabling issues. Constraints: N/A. Value range: 1~2147483647 |
| open_merge_requests_count | Integer | Definition: Number of enabled CRs and MRs. Constraints: N/A. Value range: 1~2147483647 |
| last_activity_at | String | Definition: Time when the last action was performed. Constraints: N/A. |
| namespace | NamespaceBasicDto object | Definition: Namespace. Constraints: N/A. |
| empty_repo | Boolean | Definition: Empty repository. Constraints: N/A. |
| starred | Boolean | Definition: Favorite or not. Constraints: N/A. |
| visibility | String | Definition: Repository visibility level. Constraints: N/A. |
| security_tag | String | Definition: Repository confidentiality level. Constraints: N/A. |
| security | String | Definition: Repository confidentiality level. Constraints: N/A. |
| network_type | String | Definition: Network type. Constraints: N/A. |
| owner | RepositoryUserBasicDto object | Definition: Repository owner. Constraints: N/A. |
| creator | RepositoryUserBasicDto object | Definition: Repository creator. Constraints: N/A. |
| creator_id | Integer | Definition: Creator ID. Constraints: N/A. Value range: 1~2147483647 |
| forked_from_repository | RepositorySimpleDto object | Definition: Source repository of the fork repository. Constraints: N/A. |
| encryption_status | String | Definition Repository encryption status. Range Default Value N/A Enumeration values: |
| repo_encryption_enabled | Boolean | Definition Whether to enable repository encryption. Range |
| uuid | String | Definition: Unique repository identifier. Constraints: N/A. |
| ancestor_ids | Array of integers | Definition: Ancestor repository ID list. Constraints: N/A. Value range: 1~2147483647 |
| ancestor_names | Array of strings | Definition: Ancestor repository name list. Constraints: N/A. |
| import_status | String | Definition: Import status. Constraints: N/A. |
| import_url | String | Definition: Import source address. Constraints: N/A. |
| import_error | String | Definition: Information that indicates the import is error. Constraints: N/A. |
| repo_type | String | Definition: Repository type. Constraints: N/A. |
| only_allow_merge_if_pipeline_succeeds | Boolean | Definition: Whether to merge only after the pipeline is successful. Constraints: N/A. |
| request_access_enabled | Boolean | Definition: Whether to enable access requests. Constraints: N/A. |
| only_allow_merge_if_all_discussions_are_resolved | Boolean | Definition: Whether to merge only after all review comments are confirmed. Constraints: N/A. |
| merge_method | String | Definition: Merging method. Constraints: N/A. |
| fork_network_repositories | Array of RepositoryIdentityDto objects | Definition: List of associated fork repositories. Constraints: N/A. |
| permissions | PermissionsDto object | Permission. |
| repository_type | String | Definition: Repository type. Constraints: N/A. |
| statistics | RepositoryStatisticsDto object | Definition: Project statistics. Constraints: N/A. |
| branch_count | Integer | Definition: Number of branches. Constraints: N/A. Value range: 1~2147483647 |
| tag_count | Integer | Definition: Number of tags. Constraints: N/A. Value range: 1~2147483647 |
| label_count | Integer | Definition: Number of tags. Constraints: N/A. Value range: 1~2147483647 |
| member_count | Integer | Definition: Number of members. Constraints: N/A. Value range: 1~2147483647 |
| Parameter | Type | Description |
|---|---|---|
| id | Integer | Definition: Namespace ID. Constraints: N/A. Value range: 1~2147483647 |
| name | String | Definition: Namespace name. Constraints: N/A. |
| path | String | Definition: Path. Constraints: N/A. |
| develop_mode | String | Definition: Development mode. Constraints: N/A. |
| kind | String | Definition: Type. Constraints: N/A. |
| full_path | String | Definition: Complete path. Constraints: N/A. |
| full_name | String | Definition: Full name. Constraints: N/A. |
| parent_id | Integer | Definition: Parent ID. Constraints: N/A. Value range: 1~2147483647 |
| visibility_level | Integer | Definition: Visibility level. Constraints: N/A. Value range: 1~2147483647 |
| enable_file_control | Boolean | Definition: This API is used to enable file permission control. Constraints: N/A. |
| owner_id | Integer | Definition: Owner ID Constraints: N/A. Value range: 1~2147483647 |
| Parameter | Type | Description |
|---|---|---|
| id | Integer | Definition: User ID. Constraints: N/A. Value range: 1~2147483647 |
| name | String | Definition: Username. Constraints: N/A. |
| username | String | Definition: Username. Constraints: N/A. |
| state | String | Definition: User status Value range: Enumeration values: |
| service_license_status | Integer | Definition: Service-level permission status. 0: Disabled; 1: Enabled. Constraints: N/A. Value range: 1~2147483647 |
| name_cn | String | Definition: Username in Chinese. Constraints: N/A. |
| nick_name | String | Definition: User alias. Constraints: N/A. |
| tenant_name | String | Definition: Tenant name. Constraints: N/A. |
| Parameter | Type | Description |
|---|---|---|
| id | Integer | Definition: Repository ID. Value range: 1~2147483647 |
| description | String | Definition: Repository description. |
| name | String | Definition: Repository name. |
| name_with_namespace | String | Definition: Repository full name. |
| path | String | Definition: Repository path. |
| path_with_namespace | String | Definition: Complete repository path. |
| created_at | String | Definition: Creation time. |
| updated_at | String | Definition: Update time. |
| archived | Boolean | Definition: Archived or not. |
| ssh_url_to_repo | String | Definition: Repository SSH address. |
| http_url_to_repo | String | Definition: HTTP address of the repository. |
| project_id | String | Definition: Repository project ID. |
| project_name | String | Definition: Repository project name. |
| develop_mode | String | Definition: Repository development mode. Value range: Enumeration values: |
| moderation_result | Boolean | Definition: Review status. |
| Parameter | Type | Description |
|---|---|---|
| id | Integer | Definition: Project ID. Constraints: N/A. Value range: 1~2147483647 |
| path_with_namespace | String | Definition: Project path. Constraints: N/A. |
| Parameter | Type | Description |
|---|---|---|
| repository_access | MemberAccess object | Definition: Repository permission. Constraints: N/A. |
| group_access | MemberAccess object | Definition: Repository group permission. Constraints: N/A. |
| Parameter | Type | Description |
|---|---|---|
| access_level | Integer | Definition: Access level. Constraints: N/A. Value range: 1~2147483647 |
| notification_level | Integer | Definition: Notification level. Constraints: N/A. Value range: 1~2147483647 |
| Parameter | Type | Description |
|---|---|---|
| commit_count | Integer | Definition: Commits. Constraints: N/A. Value range: 1~2147483647 |
| storage_size | Double | Definition: Storage size. Constraints: N/A. Value range: 1.0~1024000.0 |
| repository_size | Double | Definition: Repository size. Constraints: N/A. Value range: 1.0~1024000.0 |
| lfs_objects_size | Double | Definition: Size of the LFS object. Constraints: N/A. Value range: 1.0~1024000.0 |
| tenant_repo_size_limit | Long | Definition: Limit of the tenant repository size. Constraints: N/A. Value range: 1~2147483647 |
Status code: 401
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Definition Error code. |
| error_msg | String | Definition Error message. |
Status code: 403
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Definition Error code. |
| error_msg | String | Definition Error message. |
Example Requests
/v4/repositories/2112082075/transfer
{
"namespace" : "85983ce3309e4d06a2c5b48ce938c9b2/gg1"
} Example Responses
Status code: 200
OK
{
"id" : 2112082075,
"description" : "",
"name" : "rr",
"name_with_namespace" : "85983ce3309e4d06a2c5b48ce938c9b2 / gg1 / rr",
"path" : "rr",
"path_with_namespace" : "85983ce3309e4d06a2c5b48ce938c9b2/gg1/rr",
"created_at" : "2025-12-23T11:03:25.000+08:00",
"updated_at" : "2025-12-23T03:28:13.000+08:00",
"archived" : false,
"ssh_url_to_repo" : "git@test.com:85983ce3309e4d06a2c5b48ce938c9b2/gg1/rr.git",
"http_url_to_repo" : "https://test.com/85983ce3309e4d06a2c5b48ce938c9b2/gg1/rr.git",
"project_id" : "85983ce3309e4d06a2c5b48ce938c9b2",
"project_name" : "encrypt_testsecurity_tag_code",
"develop_mode" : "normal",
"moderation_result" : true,
"default_branch" : "master",
"star_count" : 0,
"forks_count" : 0,
"open_merge_requests_count" : null,
"last_activity_at" : "2025-12-23T11:03:25.000+08:00",
"namespace" : {
"id" : 2111955247,
"name" : "gg1",
"path" : "gg1",
"develop_mode" : "normal",
"kind" : "group",
"full_path" : "85983ce3309e4d06a2c5b48ce938c9b2/gg1",
"full_name" : null,
"parent_id" : 2111945387,
"visibility_level" : 0,
"enable_file_control" : null,
"owner_id" : null
},
"empty_repo" : null,
"starred" : null,
"visibility" : "private",
"security" : "internal",
"owner" : {
"id" : 7574,
"name" : "user",
"username" : "a618e34bd5704be3ae3395dfede06041",
"state" : "active",
"service_license_status" : null,
"name_cn" : "user",
"nick_name" : "user",
"tenant_name" : "user"
},
"creator_id" : 7574,
"only_allow_merge_if_pipeline_succeeds" : false,
"only_allow_merge_if_all_discussions_are_resolved" : false,
"merge_method" : "merge"
} Status code: 401
Unauthorized
{
"error_code" : "DEV.00000003",
"error_msg" : "Authentication information expired."
} Status code: 403
Bad Request
{
"error_code" : "CH.004403",
"error_msg" : "Insufficient permissions. Apply for the required permissions and try again."
} Status Codes
| Status Code | Description |
|---|---|
| 200 | OK |
| 401 | Unauthorized |
| 403 | Bad Request |
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.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot