TransferRepository - Transfer a repository
Applicable editions | Central edition, Region edition |
Endpoints and authorization information
- Get the endpoint to replace {domain} in the request syntax.
- Get a personal access token.
- Get the organization ID. This parameter is required only for the Central edition. Go to the Basic Information page in the Organization Management console to obtain the organization ID.
Product | Resource | Required permission |
Codeup | Code Repository | Read/Write |
Request syntax
Central edition
POST https://{domain}/oapi/v1/codeup/organizations/{organizationId}/repositories/transfer
Region edition
POST https://{domain}/oapi/v1/codeup/repositories/transfer
Request headers
Parameter | Type | Required | Description | Example value |
x-yunxiao-token | string | Yes | Personal access token. | pt-0fh3****0fbG_35af****0484 |
Request parameters
Parameter | Type | Location | Required | Description | Example value |
organizationId | string | path |
| The organization ID. | 60d54f3daccf2bbd6659f3ad |
| - | object | body | No | ||
| groupId | string | body | Yes | The ID of the target code group (a numeric string) or the full path_with_namespace path. | 60de7a6852743a5162b5f957/target-group |
| repositoryId | string | body | Yes | The repository ID (a numeric string) or the full path_with_namespace path. | 60de7a6852743a5162b5f957/DemoRepo |
Request examples
Central edition
curl -X 'POST' \
'https://{domain}/oapi/v1/codeup/organizations/60d54f3daccf2bbd6659f3ad/repositories/transfer' \
-H 'Content-Type: application/json' \
-H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484' \
--data '
{
"groupId": "60de7a6852743a5162b5f957/target-group",
"repositoryId": "60de7a6852743a5162b5f957/DemoRepo"
}'
Region edition
curl -X 'POST' \
'https://{domain}/oapi/v1/codeup/repositories/transfer' \
-H 'Content-Type: application/json' \
-H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484' \
--data '
{
"groupId": "60de7a6852743a5162b5f957/target-group",
"repositoryId": "60de7a6852743a5162b5f957/DemoRepo"
}'
Response parameters
Parameter | Type | Description | Example value |
| - | object | ||
| accessLevel | integer | The permission type of the current user on this repository. Valid values: [20 30 40]. | 40 |
| archived | boolean | Whether the repository is archived. | false |
| avatarUrl | string | The avatar URL. | https://example/example/w/100/h/100 |
| createdAt | string | The creation time. | 2024-10-05T15:30:45Z |
| creatorId | integer | The repository creator. | 1 |
| creatorUid | string | The repository creator (Yunxiao user ID). | 5f8b3b3b3b3b3b3b3b3b3b3b |
| demoProject | boolean | Whether this is a demo repository. | false |
| description | string | The repository description. | demo repo |
| encrypted | boolean | Whether it is encrypted. | false |
| id | integer | The repository ID. | 2813489 |
| lastActivityAt | string | The last activity time. | 2024-10-05T15:30:45Z |
| name | string | The repository name. | demo-repo |
| nameWithNamespace | string | The full name of the repository (including the full group name). | 60de7a6852743a5162b5f957 / DemoRepo |
| namespaceId | integer | The ID of the parent path. | 2813489 |
| path | string | The repository path. | demo-repo |
| pathWithNamespace | string | The full path of the repository (including the full group path). | 60de7a6852743a5162b5f957/DemoRepo |
| repositorySize | string | The repository size (MB). | 1 |
| repositoryTags | array | The list of repository tags. | |
| - | object | The repository tag. | |
| tagColor | string | The tag color. | #C4C6CF |
| tagName | string | The tag name. | Tag 1 |
| starCount | integer | The number of stars. | 1 |
| starred | boolean | Whether it is starred by the current user. | false |
| updatedAt | string | The last update time. | 2024-10-05T15:30:45Z |
| visibility | string | The visibility: private (private), internal (public within the organization). Valid values: [private internal]. | private |
| webUrl | string | The URL for page access. | http://example.com/org-demo/example-repo |
Response example
{
"accessLevel": 40,
"archived": false,
"avatarUrl": "https://example/example/w/100/h/100",
"createdAt": "2024-10-05T15:30:45Z",
"creatorId": 1,
"creatorUid": "5f8b3b3b3b3b3b3b3b3b3b3b",
"demoProject": false,
"description": "demo repo",
"encrypted": false,
"id": 2813489,
"lastActivityAt": "2024-10-05T15:30:45Z",
"name": "demo-repo",
"nameWithNamespace": "60de7a6852743a5162b5f957 / DemoRepo",
"namespaceId": 2813489,
"path": "demo-repo",
"pathWithNamespace": "60de7a6852743a5162b5f957/DemoRepo",
"repositorySize": "1",
"repositoryTags": [
{
"tagColor": "#C4C6CF",
"tagName": "Tag 1"
}
],
"starCount": 1,
"starred": false,
"updatedAt": "2024-10-05T15:30:45Z",
"visibility": "private",
"webUrl": "http://example.com/org-demo/example-repo"
}
Error codes
For more information about API error codes, see the Error Code Center.