Aggregate telemetry (hourly/daily)
POST/workspaces/:id/telemetry/aggregate
Bucketed telemetry aggregates for charts (Energy week/month bars, hourly averages, etc.). Auth: Bearer JWT or X-API-Key with devices.read. Device scope matches device GET visibility;
unknown or unauthorized device_keys → 403. Mobile end-users use
POST //devices/{device_id}/telemetry/aggregate with JWT (bound device only). Limits: Max 90 days for 1h/1d; max ~400 days (~13 months) for 1mo. Max 50 devices; max 20 metric_slugs (active metric catalog only).
interval: 1h (hourly MV), 1d (UTC day rollup), or 1mo (UTC calendar month rollup from hourly). Energy consumption:
slug total_kwh + functions auto/delta → consumption_kwh. 503 when TELEMETRY_QUERY_URL is unset or the Telemetry Query Gateway is unreachable.
No self-service ClickHouse DDL; no raw SQL.
Request
Responses
- 200
- 400
- 403
- 503
Aggregate series (same shape as timeseries query)
Validation error (missing fields, range, interval, unknown slug)
Forbidden (no workspace access or device_key not visible)
Telemetry query gateway not configured or unreachable