Base URL
The dashboard is hosted on Vercel. All API endpoints are available at:GET-only and return application/json. All responses include Cache-Control: no-store — data is always fresh from the database.
GET /api/stats
Combined overview data — runs four parallel database queries and returns a single response object. Used by the Overview tab. Parameters: None Response:GET /api/telemetry/latest
Most recent telemetry reading. Used by the Compliance tab and Trend Analysis date initialisation. Parameters: None Response: SingleTelemetryReading object with all 65+ fields. See Telemetry Fields Reference.
GET /api/telemetry/history
Historical telemetry over a time window. Parameters:| Parameter | Type | Default | Description |
|---|---|---|---|
hours | integer | 24 | Number of hours back from the latest record |
TelemetryReading objects ordered by timestamp ascending.
GET /api/telemetry/aggregated
Time-bucketed telemetry. Used as Stage 1 data for Trend Analysis, Comparative Analysis, and Data Export. Parameters:| Parameter | Type | Default | Description |
|---|---|---|---|
interval | day | hour | day | Aggregation bucket size |
startDate | ISO string | — | Start of date range (takes precedence over hours) |
endDate | ISO string | — | End of date range |
hours | integer | 720 | Fallback window if startDate/endDate not provided |
timestamp— bucket startUVR_INTENSITY,UVR_POWER_OUTPUT,UVR_WATER_TEMP,SYS_FLOW_RATE,SYS_PRESSURE,AVG_LAMP_EFFICIENCY,FAILED_LAMP_COUNT- Per-lamp data for all 16 lamps:
LAMP_XX_EFFICIENCY,LAMP_XX_POWER,LAMP_XX_RUNTIME recordCount— number of raw records aggregated into this bucket
GET /api/telemetry/chunked
Paginated raw telemetry records. Used as Stage 2 streaming data. Parameters:| Parameter | Type | Default | Description |
|---|---|---|---|
startDate | ISO string | required | Start of date range |
endDate | ISO string | required | End of date range |
offset | integer | 0 | Record offset for pagination |
limit | integer | 500 | Records per page |
GET /api/telemetry/runtime-analysis
Telemetry records organised for runtime-based lamp degradation analysis. Used by the Trend Analysis runtime charts. Parameters:| Parameter | Type | Default | Description |
|---|---|---|---|
startDate | ISO string | — | Optional start filter |
endDate | ISO string | — | Optional end filter |
timestamp, UVR_INTENSITY, UVR_POWER_OUTPUT, and LAMP_XX_RUNTIME/EFFICIENCY/POWER for all 16 lamps.
GET /api/health
Latest health score records. Parameters:| Parameter | Type | Default | Description |
|---|---|---|---|
limit | integer | 100 | Maximum number of records to return |
/api/health/aggregated for nested component structure.
GET /api/health/aggregated
Time-bucketed health scores. Used by the Trend Analysis health evolution chart. Parameters:| Parameter | Type | Default | Description |
|---|---|---|---|
interval | day | hour | day | Aggregation bucket size |
startDate | ISO string | — | Start of date range |
endDate | ISO string | — | End of date range |
limit | integer | — | Fallback if dates not provided |
GET /api/events
Process lifecycle and alarm events. Parameters:| Parameter | Type | Default | Description |
|---|---|---|---|
limit | integer | 100 | Maximum number of records |
type | string | — | Filter by event type: PROCESS_START, PROCESS_STOP, or ALARM_TRIGGERED |
GET /api/predictions
ML predictions for all UV lamp components. Parameters:| Parameter | Type | Default | Description |
|---|---|---|---|
limit | integer | 100 | Maximum number of prediction records |