Skip to main content
POST
/
repos
/
{repo_id}
/
rename
Rename repository
curl --request POST \
  --url https://api.diversion.dev/v0/repos/{repo_id}/rename \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "new_name": "<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
new_name
string
required

The new name for the repository

Required string length: 1 - 128

Response

Repository renamed 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