library-rest

[Admin/demo-only] Reset the demo stand to its seed data.

POST/_admin/reset

Wipes every runtime mutation (all creates/updates/deletes/borrows/ returns since the server started or was last reset) and reloads the deterministic seed dataset, restoring the exact snapshot the demo started with. Not one of the library's 13 business actions — this exists so a demo or CI run can return to a known state.

Responses

200 The store was reset; counts reflect the freshly reloaded seed data.

application/json

FieldTypeRequiredDescription
dataobjectyes[Admin/demo-only] Current record counts, not one of the library's 13 business actions.
authorsintegeryesNumber of authors currently on record.
booksintegeryesNumber of books currently in the catalog.
loansintegeryesNumber of loans (open and closed) on record.
usersintegeryesNumber of registered users.
metaobjectyesResponse metadata attached to every successful response.
requestIdstringyesCorrelation id for this request, echoed from the X-Request-Id request header or generated if absent. Useful for tracing a request across logs.
totalintegerTotal number of matches before pagination was applied. Present only on paginated list responses (currently GET /books).

Errors

CodeMessageDescription
401The request is missing a valid Authorization: Bearer <token> header.
500An unexpected error occurred. The response never leaks internal error details.

Response example

{
  "data": {
    "authors": 945,
    "books": 319,
    "loans": 769,
    "users": 628
  },
  "meta": {
    "requestId": "requestId_93",
    "total": 891
  }
}