---
title: "MergeShelves"
method: POST
path: "/v1/shelves/{shelf}:merge"
tags: ["LibraryService"]
---

# MergeShelves

`POST /v1/shelves/{shelf}:merge`

Merges two shelves by adding all books from the shelf named
 `other_shelf_name` to shelf `name`, and deletes
 `other_shelf_name`. Returns the updated shelf.
 The book ids of the moved books may not be the same as the original books.

 Returns NOT_FOUND if either shelf does not exist.
 This call is a no-op if the specified shelves are the same.

## Path parameters

- `shelf` string, required

## Request body

- MergeShelvesRequest — Describes the shelf being removed (other_shelf_name) and updated (name) in this merge.
  - `name` string, required — The name of the shelf we're adding books to.
  - `other_shelf_name` string, required — The name of the shelf we're removing books from and deleting.

## Response `200`

OK

- Shelf — A Shelf contains a collection of books with a theme.
  - `name` string, required — The resource name of the shelf. Shelf names have the form `shelves/{shelf_id}`. The name is ignored when creating a shelf.
  - `theme` string — The theme of the shelf
  - `next_sort_at` string, date — The next sorting date.
  - `created_at` string, date-time — The creation date and time.
  - `updated_at` string, date-time — The last update date and time.

## Other responses

- `default` — Default error response

---

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