Server API
The server listens on port 8080. Every response that names something (an alert kind, a refusal, a skip reason) uses a
stable code, translated by the screens; see
docs/i18n-codes.md.
Live updates: /ws
Section titled “Live updates: /ws”Connect to ws://<server>:8080/ws for a station, or /ws?role=nurse / /ws?role=charge_nurse for a phone. The first
message is a snapshot of everything; every later message carries a whole entity (an alert, a device, the ward
layout, the database health, the phone counts). Phones also get notify messages when they are paged. Full protocol:
docs/live-updates.md.
| Endpoint | Purpose |
|---|---|
GET /api/alerts |
Unresolved alerts, then the most recently resolved |
POST /api/alerts/{id}/acknowledge |
Take ownership |
POST /api/alerts/{id}/resolve |
Close, with {"feedback": "real" | "false_alarm"} |
GET /api/devices |
Every device with approval and presence |
POST /api/devices/{id}/approve |
Approve, optionally with an assignment (room, bed or resident) |
POST /api/devices/approve-pending |
Approve everything that can be decided safely |
POST /api/devices/{id}/reassign · /unassign · /reject · /identify |
Later changes |
GET /api/residents, GET /api/rooms |
The ward |
POST /api/residents/{id}/admit · /move · /rename · /discharge |
Residents and beds |
POST /api/rooms/{roomId}/beds |
Add a bed |
GET /api/rules · GET /api/settings |
Rules and the server’s values |
POST /api/rules/{id}/edit |
Change one value and window of a rule (journaled) |
GET /api/audit |
The journal, newest first, in pages |
GET /health |
200, or 503 while the database is down |