library-rest
[Admin/demo-only] Report current record counts.
GET
/_admin/stateReturns 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
| Field | Type | Required | Description |
|---|---|---|---|
| data | object | yes | [Admin/demo-only] Current record counts, not one of the library's 13 business actions. |
| authors | integer | yes | Number of authors currently on record. |
| books | integer | yes | Number of books currently in the catalog. |
| loans | integer | yes | Number of loans (open and closed) on record. |
| users | integer | yes | Number of registered users. |
| meta | object | yes | Response metadata attached to every successful response. |
| requestId | string | yes | Correlation id for this request, echoed from the X-Request-Id request header or generated if absent. Useful for tracing a request across logs. |
| total | integer | Total number of matches before pagination was applied. Present only on paginated list responses (currently GET /books). |
Errors
| Code | Message | Description |
|---|---|---|
| 401 | The request is missing a valid Authorization: Bearer <token> header. | |
| 500 | An 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
}
}