REST API

Developers

Everything on this site is available as JSON. All responses are { ok, … }; mutating calls accept an x-operator header for the audit trail.

MethodPathDescription
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=1Live risk assessment: status, advice, hazards, next hours/days, radar-ready coords
GET/api/live/alertsAlerts recorded for real locations
GET/api/popularMost-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 · /logoutAccount (email + password, cookie session)
GET / PATCH/api/auth/meCurrent user / update profile & phone
GET / POST / PATCH / DELETE/api/subscriptionsPlaces to be warned about (threshold, SMS/call, quiet hours)
POST/api/subscriptions/:id/check · /simulateRe-check now / run a drill
GET/api/notificationsSMS / call history
POST/api/notifications/test{ channel: "sms" | "call" } — send a test to your phone
GET/api/healthService + D1 health
GET/api/stateScenario mode, KPIs, observation + fused hazards (training scenario)
POST/api/state/mode{ mode: "severe" | "clear" }
GET/api/sensors · /api/models · /api/villagesScenario sources, ensemble, village register
PATCH/api/villages/:slug{ risk_override }
GET / POST/api/alertsAlert feed / manual alert
POST/api/alerts/:id/ack · /resolveAlert lifecycle
GET / POST/api/dispatchDispatch history / send (severe scenario only)
GET/api/nowcastScenario -30..+60 min timeline
GET/api/citizen/:slugScenario citizen payload
GET/api/audit · /api/export/incidentAudit trail / incident export

Storage: Cloudflare D1 · Weather: Open-Meteo · Radar: RainViewer · Example: /api/live?lat=19.07&lon=72.88