Everything on this site is available as JSON. All responses are { ok, … }; mutating calls accept an x-operator header for the audit trail.
| Method | Path | Description |
|---|---|---|
| GET | /api/places/search?q= | Search any place on Earth (or "lat, lon") |
| GET | /api/places/reverse?lat=&lon= | Coordinates → place name |
| GET | /api/live?lat=&lon=&name=&refresh=1 | Live risk assessment: status, advice, hazards, next hours/days, radar-ready coords |
| GET | /api/live/alerts | Alerts recorded for real locations |
| GET | /api/popular | Most-checked places |
| GET / POST | /api/reports?lat=&lon= | Community reports near a point / submit { lat, lon, kind, severity, note, place } |
| POST | /api/auth/register · /login · /logout | Account (email + password, cookie session) |
| GET / PATCH | /api/auth/me | Current user / update profile & phone |
| GET / POST / PATCH / DELETE | /api/subscriptions | Places to be warned about (threshold, SMS/call, quiet hours) |
| POST | /api/subscriptions/:id/check · /simulate | Re-check now / run a drill |
| GET | /api/notifications | SMS / call history |
| POST | /api/notifications/test | { channel: "sms" | "call" } — send a test to your phone |
| GET | /api/health | Service + D1 health |
| GET | /api/state | Scenario mode, KPIs, observation + fused hazards (training scenario) |
| POST | /api/state/mode | { mode: "severe" | "clear" } |
| GET | /api/sensors · /api/models · /api/villages | Scenario sources, ensemble, village register |
| PATCH | /api/villages/:slug | { risk_override } |
| GET / POST | /api/alerts | Alert feed / manual alert |
| POST | /api/alerts/:id/ack · /resolve | Alert lifecycle |
| GET / POST | /api/dispatch | Dispatch history / send (severe scenario only) |
| GET | /api/nowcast | Scenario -30..+60 min timeline |
| GET | /api/citizen/:slug | Scenario citizen payload |
| GET | /api/audit · /api/export/incident | Audit trail / incident export |
Storage: Cloudflare D1 · Weather: Open-Meteo · Radar: RainViewer · Example: /api/live?lat=19.07&lon=72.88