Tenant-scoped forward to the wiki KB usage aggregation report (PLT-393): top queries, top-cited pages, miss rate, never-read pages (prune/merge candidates), and token trend over a rolling window
GET/api/kb/usage
Tenant-scoped forward to the wiki KB usage aggregation report (PLT-393): top queries, top-cited pages, miss rate, never-read pages (prune/merge candidates), and token trend over a rolling window. The report itself is computed by the wiki over wiki.kb_reads; this route forwards the caller’s own auth so the wiki’s RLS + classification gating scope the result to what the caller may see. Backs the (follow-up) kb_usage MCP tool and pt kb-usage CLI.
Request
Responses
- 200
- 400
- 401
- 403
- 404
- 502
- 503
Successful response
Validation failure (malformed spaceId, out-of-range days/limit).
Caller is not authenticated.
The wiki backend rejected the forwarded caller credentials (HTTP 401/403) — WIKI_BACKEND_FORBIDDEN.
The requested spaceId does not exist, was deleted, or is not visible to the caller — a clean upstream 404 from the wiki, not a backend outage.
The wiki backend was unreachable or errored (5xx / timeout / malformed body) — WIKI_BACKEND_UNAVAILABLE.
The wiki backend is not configured on this deployment (WIKI_ZONE_URL unset).