This is the canonical list of TomeTrove's REST API endpoints. For the routing architecture and response conventions, see ADR 0008. For the frontend delivery model (multi-page app consuming these endpoints), see ADR 0007.
Plural route prefixes for collections: /api/books, /api/wishes. GET /api/books lists; GET /api/books/:id returns one.
Singular route prefixes for singletons: /api/user/preferences — scoped to the authenticated user, no :id.
Search is a query param on the list endpoint: GET /api/books?q=hamlet. Same endpoint for listing and searching.
Non-CRUD actions are POST to a sub-resource: POST /api/editions/:id/prices (on-demand fetch), POST /api/wishes/import (CSV import).
Child resources nested under their parent: editions under books, price quotes under editions.
Cursor-based pagination on all list endpoints, with HATEOAS _links (self, first, prev, next, last). No total count.
Auth: all /api/ endpoints require JWT authentication (ADR 0006) except GET /api/lists/:token (public share). User-scoped resources are filtered to the authenticated user — no :userId in the path.
Acceptable editions (alternatives) for a wish, tracked via the wish_edition junction table. See the add-a-wish journey for the flows that create and replace these rows.
Route
Method
Purpose
Auth
Source
/api/wishes/:id/editions
GET
List acceptable editions for a wish
Yes
—
/api/wishes/:id/editions
POST
Add an edition alternative to a wish
Yes
—
/api/wishes/:id/editions/:editionId
PUT
Replace an edition (ISBN search finds a different edition for a book already in the list)
Shared lists are materialized public subsets of the user's wishes — see ADR 0017. Filters seed the list at creation; afterwards the owner adds or removes individual wishes. Removing a wish from the wish list automatically removes it from every shared list (cascade).
Historic prices endpoint shape: GET /api/editions/:editionId/prices/historic could return monthly aggregates only, or merge recent raw quotes with historic data. The wish-detail page needs both for its price history graph.