Skip to main content
POST
/
repos
/
{repo_id}
/
transfer
Transfer ownership
curl --request POST \
  --url https://api.diversion.dev/v0/repos/{repo_id}/transfer \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "target_id": "<string>",
  "source_organization_id": "<string>"
}
'
{
  "repo_name": "repo-name",
  "repo_id": "example_id",
  "size_bytes": 123,
  "owner_user_id": "<string>",
  "created_timestamp": 123,
  "description": "<string>",
  "organization_id": "<string>",
  "default_branch_id": "<string>",
  "default_branch_name": "<string>",
  "sync_git_repo_url": "<string>",
  "sync_git_level": 4,
  "digest_method": "sha1",
  "def_auto_forwarding_enabled": true
}

Authorizations

Authorization
string
header
required

This API uses OAuth 2 with the implicit grant flow

Path Parameters

repo_id
string
required

The repo ID of the repository. Repo name can be used instead of the ID, but usage of ID for permanent linking and API requests is preferred.

Required string length: 3 - 128
Example:

"example_id"

Body

application/json

Transfer repository ownership or attach to organization:

  • User ID: Transfer ownership within an organization to another user
  • Organization ID: Attach a personal repository to an organization
target_id
string
required

ID of the transfer target (user or organization).

source_organization_id
string | null

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

Response

Repository transferred successfully

repo_name
string
required
Required string length: 1 - 128
Example:

"repo-name"

repo_id
string
required
Example:

"example_id"

size_bytes
number<float>
required
owner_user_id
string
required
created_timestamp
integer<int64>
required

Seconds since epoch UTC

description
string
organization_id
string

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.

default_branch_id
string
default_branch_name
string
sync_git_repo_url
string

Optional URL of the git repository being synced with the repo

sync_git_level
enum<integer>
default: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]

Available options:
1,
2,
3,
4
digest_method
enum<string>

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

Available options:
sha1,
md5
def_auto_forwarding_enabled
boolean