API: analytics
POST /api/v1/analytics/collect
Section titled “POST /api/v1/analytics/collect”Collect
Trigger a collection run (idempotent; safe to re-run).
collect=false runs the cheap SYNCHRONOUS mode: external collectors are not called,
only the ingest of already-fetched files and topic scoring run, and the caller gets the
RESULT instead of an “accepted” — so a scheduled caller can tell whether the loop
actually computed.
Auth: Authorization: Bearer <token> required
| Parameter | In | Required | Type | Description |
|---|---|---|---|---|
Idempotency-Key | header | no | string | Optional. |
Request body: application/json — schema CollectTrigger
| Field | Type | Required | Description |
|---|---|---|---|
collect | boolean | no | |
date | string | null | no | |
with_psi | boolean | no |
Responses:
| Code | Meaning | Body |
|---|---|---|
200 | Successful Response | object |
401 | Missing or invalid authentication credentials | ErrorResponse |
422 | Validation Error | HTTPValidationError |
GET /api/v1/analytics/instances/{instance_id}
Section titled “GET /api/v1/analytics/instances/{instance_id}”Instance Dashboard
Everything one per-instance analytics panel needs (snapshot + trends + queries + pages + index).
Auth: Authorization: Bearer <token> required
| Parameter | In | Required | Type | Description |
|---|---|---|---|---|
instance_id | path | yes | string |
Responses:
| Code | Meaning | Body |
|---|---|---|
200 | Successful Response | InstanceDashboard |
401 | Missing or invalid authentication credentials | ErrorResponse |
422 | Validation Error | HTTPValidationError |
GET /api/v1/analytics/overview
Section titled “GET /api/v1/analytics/overview”Overview
Cross-instance grid: latest snapshot KPIs + health per instance.
Auth: Authorization: Bearer <token> required
Responses:
| Code | Meaning | Body |
|---|---|---|
200 | Successful Response | OverviewResponse |
401 | Missing or invalid authentication credentials | ErrorResponse |
GET /api/v1/analytics/runs
Section titled “GET /api/v1/analytics/runs”Runs
Recent collection-run manifests.
Auth: Authorization: Bearer <token> required
Responses:
| Code | Meaning | Body |
|---|---|---|
200 | Successful Response | array of CollectionRunRead |
401 | Missing or invalid authentication credentials | ErrorResponse |