Skip to main content

Base URL

The dashboard is hosted on Vercel. All API endpoints are available at:
All endpoints are 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: Single TelemetryReading object with all 65+ fields. See Telemetry Fields Reference.

GET /api/telemetry/history

Historical telemetry over a time window. Parameters:
ParameterTypeDefaultDescription
hoursinteger24Number of hours back from the latest record
Response: Array of 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:
ParameterTypeDefaultDescription
intervalday | hourdayAggregation bucket size
startDateISO stringStart of date range (takes precedence over hours)
endDateISO stringEnd of date range
hoursinteger720Fallback window if startDate/endDate not provided
Response: Array of aggregated rows. Each row contains:
  • timestamp — bucket start
  • UVR_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:
ParameterTypeDefaultDescription
startDateISO stringrequiredStart of date range
endDateISO stringrequiredEnd of date range
offsetinteger0Record offset for pagination
limitinteger500Records per page
Response:

GET /api/telemetry/runtime-analysis

Telemetry records organised for runtime-based lamp degradation analysis. Used by the Trend Analysis runtime charts. Parameters:
ParameterTypeDefaultDescription
startDateISO stringOptional start filter
endDateISO stringOptional end filter
Response: Array of up to 10,000 records containing: timestamp, UVR_INTENSITY, UVR_POWER_OUTPUT, and LAMP_XX_RUNTIME/EFFICIENCY/POWER for all 16 lamps.

GET /api/health

Latest health score records. Parameters:
ParameterTypeDefaultDescription
limitinteger100Maximum number of records to return
Response: Array of health records ordered by timestamp descending:
Note: component fields are flat (not nested) in this endpoint’s response. Use /api/health/aggregated for nested component structure.

GET /api/health/aggregated

Time-bucketed health scores. Used by the Trend Analysis health evolution chart. Parameters:
ParameterTypeDefaultDescription
intervalday | hourdayAggregation bucket size
startDateISO stringStart of date range
endDateISO stringEnd of date range
limitintegerFallback if dates not provided
Response:

GET /api/events

Process lifecycle and alarm events. Parameters:
ParameterTypeDefaultDescription
limitinteger100Maximum number of records
typestringFilter by event type: PROCESS_START, PROCESS_STOP, or ALARM_TRIGGERED
Response:

GET /api/predictions

ML predictions for all UV lamp components. Parameters:
ParameterTypeDefaultDescription
limitinteger100Maximum number of prediction records
Response:
See RUL Algorithm for how the Predictive Maintenance tab deduplicates and ranks these records.