library-rest

[Admin/demo-only] Report current record counts.

GET/_admin/state

Returns how many books, authors, users and loans currently exist — useful for sanity-checking the demo stand's state without dumping all of its data. Not one of the library's 13 business actions.

Responses

200 Current record counts.

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": 435,
    "books": 595,
    "loans": 922,
    "users": 552
  },
  "meta": {
    "requestId": "requestId_170",
    "total": 973
  }
}