---
title: "Rename a repository"
method: PATCH
path: "/api/repos/{namespace}/{repo_name}/rename"
tags: ["Repositories"]
---

# Rename a repository

`PATCH /api/repos/{namespace}/{repo_name}/rename`

## Request

- Base URL: `https://hub.oxen.ai`
- URL: `https://hub.oxen.ai/api/repos/{namespace}/{repo_name}/rename`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/oxen/apis/oxen-server/docs/api/repos/:namespace/:repo_name/rename/patch.ts> (a function with typed inputs; its response is checked against the schema)

Record a new name for a repository whose directory does not carry its name. Only a server whose repository UUIDs are assigned by an auth provider accepts it.

## Path parameters

- `namespace` string, required
- `repo_name` string, required

## Request body

- RenameRepoRequest: The name a repository is being renamed to.
  - `repo_name` string, required: What the repository is called from now on, recorded as its name hint. Refused when it is not a valid repository name.

## Response `200`

Repository renamed

- RepositoryResponse
  - `repository` RepositoryView, required
    - `is_empty` boolean, required
    - `min_version` string, nullable
    - `name` string, required
    - `namespace` string, required
    - `repo_uuid` string, uuid, nullable: The immutable UUID this repo's storage is addressed by. `None` for a repository whose identity backfill has not run.
    - `storage_kind` 'local' | 's3', required: Storage backend kind. Serializes as `"local"` / `"s3"` on the wire and on disk.
  - `status` string, required
  - `status_message` string, required

## Other responses

- `400`: Invalid body or name, or a server whose directories carry names
- `404`: Repository not found
- `409`: Another repository in the namespace holds the name

---

[API](https://skmtc.dev/oxen/apis/oxen-server.md) - [All operations](https://skmtc.dev/oxen/apis/oxen-server/llms.txt) - [OpenAPI document](https://skmtc.dev/oxen/apis/oxen-server/revisions/2ae578129949?raw)
