---
title: "Rename a shelf"
method: PATCH
path: "/repos/{repo_id}/shelves/{shelf_id}"
tags: ["Repository Shelves Manipulation"]
---

# Rename a shelf

`PATCH /repos/{repo_id}/shelves/{shelf_id}`

## Request

- Base URL: `https://api.diversion.dev/v0`
- URL: `https://api.diversion.dev/v0/repos/{repo_id}/shelves/{shelf_id}`
- Auth: OAuth 2
  - Implicit: `https://auth.diversion.dev/oauth2/authorize`
  - Scopes: `coreapi/write`
- TypeScript: <https://skmtc.dev/diversion/apis/diversion-core-api/docs/repos/:repo_id/shelves/:shelf_id/patch.ts> (a function with typed inputs; its response is checked against the schema)

Renames an existing shelf by updating its name.

**Parameters:**
- `shelf_name` (required) - will be stripped of whitespace

**Requirements:**
Requires WRITE access to the repository.

**Returns:**
- `400 Bad Request` if the name is empty after stripping
- `409 Conflict` if a shelf with the new name already exists
- `204 No Content` on success

## Request body

- object
  - `shelf_name` string, required

## Response `204`

Request completed successfully

## Other responses

- `400`: The request does not meet the required conditions
- `404`: The specified resource was not found
- `409`: Shelf with the same name already exists
- `default`: An error occurred

---

[API](https://skmtc.dev/diversion/apis/diversion-core-api.md) - [All operations](https://skmtc.dev/diversion/apis/diversion-core-api/llms.txt) - [OpenAPI document](https://skmtc.dev/diversion/apis/diversion-core-api/revisions/38a18aba804b?raw)
