v1

latestOpenAPI 3.0.32026-07-22115106141.4 KB
Repository Manipulation

Transfer ownership

Transfer repository ownership or attach to an organization.

Two modes of operation:

  • Transfer ownership within an organization: Provide new_owner_user_id to change the repository owner to another user in the same organization
  • Transfer personal repo to organization: Provide target_organization_id to attach a personal repository to an organization

Exactly one of new_owner_user_id or target_organization_id must be provided.

post/repos/{repo_id}/transfer

Request body

target_idstring required

ID of the transfer target (user or organization).

source_organization_idstring nullable

ID of the source organization (optional, for future org-to-org transfers)

Response

Repository transferred successfully

repo_namestring required
descriptionstring
organization_idstring

The ID of the organization to associate the repo with. If not provided, the system will use the user's organization if they belong to exactly one.

repo_idstring required
default_branch_idstring
default_branch_namestring
size_bytesnumber float required
owner_user_idstring required
created_timestampinteger required

Seconds since epoch UTC

sync_git_repo_urlstring

Optional URL of the git repository being synced with the repo

sync_git_level1 | 2 | 3 | 4

One of: 1 - latest commit of default branch, 2 - default branch with history, 3 - full repo with history, 4 - full repo with history and sync [default]

digest_method'sha1' | 'md5'

The method used to calculate the digest of BLOBs in the repo.

def_auto_forwarding_enabledboolean

Example response

{
  "repo_name": "repo-name",
  "repo_id": "example_id"
}