Patrol API
Prefix: /api/patrol | Tag: patrol
Fleet-wide AI patrol scan reports. Patrols are AI-driven fleet health assessments that produce narrative reports, flagged clusters, and predictions.
Endpoints
| Method | Path | Description |
|---|---|---|
| GET | /api/patrol | List patrol reports (paginated) |
| GET | /api/patrol/latest | Most recent patrol report with full details |
| GET | /api/patrol/kpis/summary | Patrol KPI summary (30d) |
| GET | /api/patrol/{report_id} | Full details of a specific report |
| POST | /api/patrol/trigger | Trigger a new patrol scan |
GET /api/patrol
Query params:
| Param | Type | Default | Description |
|---|---|---|---|
days | int | 90 | Lookback window (1-365) |
page | int | 1 | Page number |
page_size | int | 20 | Items per page (max 100) |
Response:
{
"reports": [
{
"report_id": "...",
"created_at": "2026-03-25T10:00:00",
"report_type": "scheduled",
"fleet_narrative": "Fleet is mostly healthy...",
"flagged_count": 3,
"model": "claude-sonnet-4-5-20250929",
"cost_usd": 0.15,
"total_tokens": 25000,
"duration_seconds": 65,
"triggered_by": "scheduler"
}
],
"total": 30,
"page": 1,
"page_size": 20,
"source": "live",
"generated_at": "..."
}
GET /api/patrol/latest
Returns the most recent report with parsed JSON fields (fleet_summary_parsed, clusters_flagged_parsed, customer_summaries_parsed).
GET /api/patrol/kpis/summary
Response:
{
"total_reports": 30,
"total_tokens": 750000,
"avg_duration_s": 55.3,
"total_cost_usd": 4.50,
"latest_report_at": "2026-03-25T10:00:00",
"source": "live",
"generated_at": "..."
}
POST /api/patrol/trigger
Triggers a new patrol scan synchronously (can take 30-90s). Only one scan runs at a time.
Request body:
{
"report_type": "on_demand"
}
Response:
{
"status": "completed",
"report_id": "...",
"tool_rounds": 8,
"total_tokens": 25000,
"duration_seconds": 65,
"message": "Patrol scan completed successfully."
}
Returns {"status": "already_running"} if a scan is in progress.