API Reference

Complete AutoDoctor API endpoint reference with paths, methods, purpose, and request/response examples for health, system, alerts, and module telemetry.

Base URL

Default local URL:

http://127.0.0.1:8000

Authentication

By default, API key auth is disabled.

If AUTO_DOCTOR_API_KEY is set, include header:

X-AutoDoctor-Key: <secret>

Endpoints

GET /health

Purpose:

  • API liveness check

Example response:

{"status":"ok","service":"AutoDoctor API","version":"1.1.0"}

GET /api/system/latest

Purpose:

  • Latest row from system_info

GET /api/system/history

Purpose:

  • Up to 500 historical system_info rows ordered ascending by timestamp

GET /api/alerts

Purpose:

  • Alert counts grouped by severity

GET /api/health

Purpose:

  • Health score trend from diagnostics

GET /api/modules

Purpose:

  • Success/failure counts per module from telemetry_modules

GET /api/dashboard/meta

Purpose:

  • Dashboard metadata (run_id, host, generation time) from latest_run.json

Quick Test Commands

Invoke-RestMethod http://127.0.0.1:8000/health
Invoke-RestMethod http://127.0.0.1:8000/api/system/latest
Invoke-RestMethod http://127.0.0.1:8000/api/system/history
Invoke-RestMethod http://127.0.0.1:8000/api/alerts
Invoke-RestMethod http://127.0.0.1:8000/api/health
Invoke-RestMethod http://127.0.0.1:8000/api/modules
Invoke-RestMethod http://127.0.0.1:8000/api/dashboard/meta

Error Patterns

  • 401 Unauthorized: API key required/mismatch
  • 500: DB unavailable or query/runtime exception