Metrics API
Analytics endpoints for dashboard visualizations and monitoring.
All metrics endpoints require JWT Bearer Token authentication.
Run statistics
GET /v1/metrics/runs
Get aggregate run statistics for a date range.
| Parameter | Type | Description |
|---|---|---|
from | ISO date | Start date |
to | ISO date | End date |
curl "http://localhost:3000/v1/metrics/runs?from=2026-03-01&to=2026-03-19" \
-H "Authorization: Bearer $TOKEN"
Risk distribution
GET /v1/metrics/risk
Get risk severity breakdown.
| Parameter | Type | Description |
|---|---|---|
from | ISO date | Start date |
to | ISO date | End date |
Approval statistics
GET /v1/metrics/approvals
Get approval metrics (pending, approved, rejected counts and response times).
Top tools
GET /v1/metrics/tools
Get the most-used tools ranked by call count.
| Parameter | Type | Description |
|---|---|---|
from | ISO date | Start date |
to | ISO date | End date |
limit | number | Max results |
Runs timeseries
GET /v1/metrics/timeseries
Get completed vs failed runs over time.
| Parameter | Type | Description |
|---|---|---|
days | number | Number of days to look back (default: 30) |
Action metrics
GET /v1/metrics/actions
Get action control metrics with recent actions.
| Parameter | Type | Description |
|---|---|---|
days | number | Lookback period |
Action timeline
GET /v1/metrics/actions/timeline
Actions over time.
Action coverage
GET /v1/metrics/actions/coverage
Policy coverage analysis — which action types have policies and which don't.
Agent metrics
GET /v1/metrics/agents
Metrics grouped by agent (runs, tool calls, risk events per agent).
Agent detail
GET /v1/metrics/agents/:agentId
Detailed metrics for a specific agent.
Dashboard insights
GET /v1/metrics/insights
Contextual insights for the dashboard (e.g., "18 db_migrate actions have no policy").