---
title: "Rename repository"
method: POST
path: "/repos/{repo_id}/rename"
tags: ["Repository Manipulation"]
---

# Rename repository

`POST /repos/{repo_id}/rename`

Change the name of a repository

## Request body

- RenameRepoRequest
  - `new_name` string, required — The new name for the repository

## Response `200`

Repository renamed successfully

- Repo
  - `repo_name` string, required
  - `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.
  - `repo_id` string, required
  - `default_branch_id` string
  - `default_branch_name` string
  - `size_bytes` number, float, required
  - `owner_user_id` string, required
  - `created_timestamp` integer, required — Seconds since epoch UTC
  - `sync_git_repo_url` string — Optional URL of the git repository being synced with the repo
  - `sync_git_level` 1 | 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_enabled` boolean

## Other responses

- `400` — Invalid repository name
- `403` — Only repository owner can rename
- `404` — Repository not found
- `409` — Repository name already exists
- `default` — An error occurred

---

[API](https://skmtc.net/diversion/apis/diversion-core-api.md) · [All operations](https://skmtc.net/diversion/apis/diversion-core-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/diversion/diversion-core-api/revisions/38a18aba804b/schema)
