---
title: "CreateShelf"
method: POST
path: "/v1/shelves"
tags: ["LibraryService"]
---

# CreateShelf

`POST /v1/shelves`

Creates a shelf, and returns the new Shelf.

## Request body

- 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.

## 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

## Changes

- **2022-04-11** (v1) `ac9d37cae0e0` — 2 breaking
  - the request's body type changed from no type to `object`
  - the response's body type changed from no type to `object` for status `200`
- **2022-02-23** (v1) `639a4ec995ca` — 1 breaking, 1 info
  - the request property `name` became required
  - the response property `name` became required for the status `200`
- **2022-01-12** (v1) `00e696b6b84a` — 1 breaking, 1 info
  - added the pattern `^shelves/[a-z2-7]{26}$` to the request property `name`
  - the `name` response's property pattern `^shelves/[a-z2-7]{26}$` was added for the status `200`
- **2022-01-11** (v1) `2a0f5e3b8734` — 1 info
  - api operation id `CreateShelf` removed and replaced with `LibraryService_CreateShelf`
- **2022-01-11** (v1) `0dea6034d969` — 1 info
  - api operation id `LibraryService_CreateShelf` removed and replaced with `CreateShelf`

[Full history](https://skmtc.dev/kollalabs/apis/libraryservice-api/changes/v1/shelves/post.md)

---

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