Skip to main content

API Overview

The backend is a FastAPI application defined in backend/main.py. It exposes 14 routers under a /api/ base path.

Base URL

/api/

Health Check

GET /api/health-check

Returns {"status": "ok", "service": "byoc-health-agent"}. No authentication required.

Authentication

All other endpoints require a valid JWT in the Authorization: Bearer <token> header. Tokens are issued by POST /api/auth/login.

CORS

CORS is enabled for all origins in development (*). In production, set CORS_ORIGINS in the environment to a comma-separated allowlist.

SPA Catch-All

Non-API GET requests fall through to frontend/dist/index.html for React Router client-side routing. Requests to /api/* that don't match a route return 404.

Routers

#PrefixTagDescription
1/api/authauthLogin, logout, activation, current user
2/api/healthhealthHealth scores, KPIs, enrichment, refresh
3/api/issuesissuesAlert-based issue tracking (list, detail, update)
4/api/riskriskCluster risk snapshots and rules
5/api/analysisanalysisBreaking-point analysis, usage patterns, upgrades
6/api/investigationsinvestigationsAutonomous agent investigation results
7/api/chatchatAI assistant chat (Claude-powered)
8/api/patrolpatrolFleet-wide AI patrol scan reports
9/api/fleetfleetUnified fleet health scores and rules
10/api/critical-clusterscritical-clustersTop problematic clusters ranked by severity
11/api/ai-issuesai-issuesAI-grouped issues (backed by alerts.ai_issues)
12/api/llm-usagellm-usageLLM token/cost monitoring (superadmin only)
13/api/lookerlookerLooker embed session management
14/api/settingssettingsRules YAML, user management, audit log