Reference

Shelves API

Updated 1 Oct 2026

On this page

For agents

Load this page when: you need to manage shelves or the books on them over HTTP

  • Address a shelf by id or slug in the path.
  • Add books in batches. Books you cannot access come back in notFound.
  • Remove books with a comma-separated itemIds query, not a body.

A shelf groups books and tells the librarian what to prefer. See Shelves.

List shelves

GET https://heytrove.ai/api/v1/shelves

Lists your shelves in display order. It takes no parameters.

Request

bash
curl https://heytrove.ai/api/v1/shelves \
  -H "Authorization: Bearer trove_your_key"

Response

json
{
  "shelves": [
    { "id": "cmshelf1", "name": "Backend", "slug": "backend", "color": "#5B7CFA", "position": 0, "itemCount": 4 }
  ]
}

CLI equivalent: trove shelf list.

Get a shelf

GET https://heytrove.ai/api/v1/shelves/{id}

Returns one shelf and its books, with the same item fields as List items.

Parameters

NameInTypeRequiredConstraintsMeaning
idpathstringyesshelf id or slugShelf to show.

Request

bash
curl https://heytrove.ai/api/v1/shelves/backend \
  -H "Authorization: Bearer trove_your_key"

Response

json
{
  "shelf": { "id": "cmshelf1", "name": "Backend", "slug": "backend", "color": "#5B7CFA", "position": 0, "itemCount": 4 },
  "items": [],
  "enrichmentQueue": null,
  "pickUrl": null
}

items holds the books. pickUrl is set only when a book on the shelf is locked.

Errors

StatusMessageCodeFix
404Shelf not foundSHELF_NOT_FOUNDCheck the id or slug.

CLI equivalent: trove shelf show.

Create a shelf

POST https://heytrove.ai/api/v1/shelves

Creates a shelf. The slug comes from the name. Names are unique per user.

Parameters

NameInTypeRequiredConstraintsMeaning
namebodystringyes1 to 50 charactersDisplay name.
colorbodystringno#RRGGBBSix-digit hex color. A value in any other shape is ignored.

Request

bash
curl https://heytrove.ai/api/v1/shelves \
  -H "Authorization: Bearer trove_your_key" \
  -H "Content-Type: application/json" \
  -d '{"name":"Backend","color":"#5B7CFA"}'

Response

Status 201.

json
{ "id": "cmshelf1", "name": "Backend", "slug": "backend", "color": "#5B7CFA", "position": 0, "itemCount": 0 }

Errors

StatusMessageCodeFix
400Name is required and must be 50 characters or lessINVALID_INPUTSend a shorter name.
400Invalid shelf nameSHELF_NAME_INVALIDUse letters or digits.
409A shelf with this name already existsSHELF_NAME_TAKENPick another name.
403Shelf limit reached ({n}). Delete an unused shelf to make room.SHELF_LIMIT_EXCEEDEDDelete a shelf you no longer use.

CLI equivalent: trove shelf create.

Update a shelf

PATCH https://heytrove.ai/api/v1/shelves/{id}

Renames a shelf, changes its color or moves its position. Send only the fields you want to change.

Parameters

NameInTypeRequiredConstraintsMeaning
idpathstringyesshelf id or slugShelf to change.
namebodystringno1 to 50 charactersNew name. The slug changes with it.
colorbodystring or nullno#RRGGBBNew color. null clears it.
positionbodyintegerno0 or moreNew position in the list.

Request

bash
curl -X PATCH https://heytrove.ai/api/v1/shelves/backend \
  -H "Authorization: Bearer trove_your_key" \
  -H "Content-Type: application/json" \
  -d '{"name":"Backend services"}'

Response

The updated shelf, in the same shape as Create a shelf.

Errors

StatusMessageCodeFix
400Name must be 1-50 charactersINVALID_INPUTFix the name.
400Position must be a non-negative integerINVALID_INPUTUse 0 or more.
404Shelf not foundSHELF_NOT_FOUNDCheck the id or slug.
409A shelf with this name already existsSHELF_NAME_TAKENPick another name.

CLI equivalent: trove shelf rename.

Delete a shelf

DELETE https://heytrove.ai/api/v1/shelves/{id}

Deletes a shelf. The books stay in your library.

Request

bash
curl -X DELETE https://heytrove.ai/api/v1/shelves/backend \
  -H "Authorization: Bearer trove_your_key"

Response

json
{ "success": true }

Errors

StatusMessageCodeFix
404Shelf not foundSHELF_NOT_FOUNDCheck the id or slug.

CLI equivalent: trove shelf delete.

Add books to a shelf

POST https://heytrove.ai/api/v1/shelves/{id}/items

Adds books to a shelf. Adding a book that is already there changes nothing.

Parameters

NameInTypeRequiredConstraintsMeaning
idpathstringyesshelf id or slugTarget shelf.
itemIdsbodystring arrayyes1 to 200 idsBooks to add.

Request

bash
curl https://heytrove.ai/api/v1/shelves/backend/items \
  -H "Authorization: Bearer trove_your_key" \
  -H "Content-Type: application/json" \
  -d '{"itemIds":["cmabc123","cmdef456"]}'

Response

Status 201 when every book was added, and 207 when some were not.

json
{ "added": ["cmabc123"], "notFound": ["cmdef456"] }

Errors

StatusMessageCodeFix
400itemIds must be a non-empty array of stringsINVALID_INPUTSend ids.
413Too many items in one request (max 200). Split the batch.BATCH_TOO_LARGESplit the batch.
404Shelf not foundSHELF_NOT_FOUNDCheck the id or slug.

CLI equivalent: trove shelf add.

Remove books from a shelf

DELETE https://heytrove.ai/api/v1/shelves/{id}/items?itemIds=ID1,ID2

Removes books from a shelf. The books stay in your library.

Parameters

NameInTypeRequiredConstraintsMeaning
idpathstringyesshelf id or slugShelf to change.
itemIdsquerystringyescomma-separated, up to 200 ids, up to 8,192 charactersBooks to remove.

Request

bash
curl -X DELETE "https://heytrove.ai/api/v1/shelves/backend/items?itemIds=cmabc123,cmdef456" \
  -H "Authorization: Bearer trove_your_key"

Response

json
{ "removed": 2 }

Errors

StatusMessageCodeFix
400itemIds query param is required (comma-separated)noneSend itemIds.
414itemIds query string is too longBATCH_TOO_LARGESplit the batch.
413Too many items in one request (max 200). Split the batch.BATCH_TOO_LARGESplit the batch.

CLI equivalent: trove shelf remove.

    Shelves API | Trove