Skip to main content

API

The backend serves interactive API docs (Swagger UI) at /swagger/index.html. Run the backend locally to use it. In Kubernetes it is only routed when ingress.exposeSwagger=true.

All routes live under /api. Sign in with POST /api/auth/login (or register); the session is the token cookie. Routes under /api/ingest/<token>/ are public and authenticated by the token in the URL.

Regenerate the spec after changing handler annotations:

cd backend && swag init --parseInternal -g main.go

GET /api/alerts returns {alerts, total} and takes the filters status, q, priority (e.g. P1,P2), source, assignee (me, none or a user id), label (key=value, repeatable), and limit (default 50, max 200) with offset for paging. The MCP tool list_alerts takes the same filters.

GET /api/alert-groups returns {groups, total} with the same filters; each group has the key, counts per status, the worst priority and the refresh total (plus the alert itself when the group has one). GET /api/alerts?group=<key> lists the alerts of one group.