Aggregated Data
Retrieves all continuous aggregation views configured for a device. Aggregation views provide pre-computed time-series summaries (min/max/avg) at regular intervals for fast long-term trend analysis.
What are Aggregated Views? Pre-computed time-series aggregations that automatically generate summary statistics at regular intervals. Think of them as scheduled SQL GROUP BY queries that run continuously.
Benefits:
Fast queries: Retrieve months of data instantly (vs slow raw data queries)
Long-term trends: View hourly/daily summaries for historical analysis
Reduced storage: Downsample old data while keeping insights
Dashboard performance: Charts load faster with aggregated data
Supported Intervals: 1h (hourly), 3h, 6h, 12h, 1d (daily), 1w (weekly)
Supported Aggregations: MIN, MAX, AVG, SUM, COUNT
Use Cases:
Long-term trend analysis (months/years)
Compliance reporting (daily min/max/avg)
Performance optimization for dashboards
Historical data analysis without querying raw data
Enter your API key with the Bearer prefix, e.g. "Bearer QB_your_api_key_here"
Project ID (UUID format)
3e5c0246-c759-48e8-8345-27db13f11ff7Device ID (UUID format)
dev-abc123List of aggregation views - Each view contains interval, tags, and creation date
Unauthorized - Invalid or missing API key
Device not found - Check project_id and device_id
GET /v2/projects/{project_id}/devices/{device_id}/aggregated-view HTTP/1.1
Host: api.qubitro.com
Authorization: YOUR_API_KEY
Accept: */*
[
{
"created": "2024-01-15T10:30:00Z",
"id": "ca-uuid-123",
"interval": "1h",
"name": "Hourly Temperature Stats",
"tags": [
"temperature",
"humidity"
]
}
]Retrieves pre-computed time-series statistics (min/max/avg) from a continuous aggregation view. Returns aggregated data points at the configured interval (hourly, daily, etc.).
What You'll Get: Each data point contains the aggregated statistics for the specified time bucket. For example, with a 1-hour interval, each record represents the min/max/avg values for that hour.
Query Range Types:
all
Retrieve all available aggregated data
page, limit
Get last 168 records (7 days of hourly data)
time
Specific time range
page, limit, start, end
Get data between 2024-01-01 and 2024-01-31
Pagination:
page: Page number (1-based indexing)limit: Records per page (recommended: 100-1000 for aggregated data)Results ordered by time (newest first)
Field Filtering: Use the keys query parameter to filter specific aggregated fields. Example: keys=temperature_avg,temperature_max will only return those fields.
When to Use vs Raw Data:
Querying > 24 hours of data
Need real-time, latest values
Need min/max/avg statistics
Need individual data points
Building trend dashboards
Debugging specific events
Performance matters
Precision matters
Example Response:
[
{
"time": "2024-01-15T10:00:00Z",
"temperature_min": 18.5,
"temperature_max": 24.3,
"temperature_avg": 21.4,
"humidity_avg": 65.2
}
]Enter your API key with the Bearer prefix, e.g. "Bearer QB_your_api_key_here"
Project ID (UUID format)
3e5c0246-c759-48e8-8345-27db13f11ff7Device ID (UUID format)
dev-abc123Continuous Aggregation ID (UUID format)
ca-uuid-123Page number for pagination (1-based)
1Number of records per page (max: 10000)
168Range type: 'all' (all data) or 'time' (specific period)
allStart time in ISO 8601 format (UTC) - Required if range=time
2024-01-01T00:00:00ZEnd time in ISO 8601 format (UTC) - Required if range=time
2024-01-31T23:59:59ZComma-separated list of fields to include (filters response fields)
temperature_avg,temperature_maxArray of aggregated data points - Each point contains time and aggregated statistics (e.g., temperature_min, temperature_max, temperature_avg)
Invalid parameters - Check range type, date format (must be ISO 8601), page/limit values
Unauthorized - Invalid or missing API key
Aggregation view not found - Check contaggr_id
GET /v2/projects/{project_id}/devices/{device_id}/aggregated-view/{contaggr_id}?page=1&limit=1&range=text HTTP/1.1
Host: api.qubitro.com
Authorization: YOUR_API_KEY
Accept: */*
[
{
"ANY_ADDITIONAL_PROPERTY": "anything"
}
]⚠️ DATA ONLY: Permanently deletes ALL aggregated time-series data from a continuous aggregation view while keeping the view configuration intact. This action CANNOT be undone.
What Gets Deleted:
All aggregated data points from TimescaleDB continuous aggregation view
All historical statistics (min/max/avg/sum/count)
All time buckets and computed values
What is KEPT:
✅ Aggregation view configuration (interval, keys, aggregation types)
✅ View metadata (name, tags, creation date)
✅ The view definition itself (new data will continue to aggregate)
Impact:
Dashboard widgets using this view will show no data (but won't break)
New device data will continue to aggregate according to the view configuration
Historical trends and reports will be empty until new data accumulates
Cannot Be Undone: There is no way to recover purged aggregated data. However, if raw device data still exists, you can recreate the aggregation view to recompute statistics from scratch.
Difference from Device DELETE:
This endpoint: Deletes aggregated statistics only, keeps view configuration
Device DELETE: Deletes device, all raw data, AND all aggregation views
When to Use:
Reset aggregation statistics after fixing data quality issues
Clear old aggregated data while keeping view configuration
Troubleshoot aggregation issues by starting fresh
Alternative: To delete the entire aggregation view (configuration + data), delete it via the Qubitro web portal instead.
Success Response:
{
"success": true,
"message": "Aggregated data purged successfully",
"action": "purge data"
}Enter your API key with the Bearer prefix, e.g. "Bearer QB_your_api_key_here"
Project ID (UUID format)
3e5c0246-c759-48e8-8345-27db13f11ff7Device ID (UUID format)
dev-abc123Continuous Aggregation ID (UUID format)
ca-uuid-123Aggregated data purged successfully - View configuration preserved
Unauthorized - Invalid or missing API key
Forbidden - Requires 'delete' scope permission
Aggregation view not found - Check contaggr_id
DELETE /v2/projects/{project_id}/devices/{device_id}/aggregated-view/{contaggr_id} HTTP/1.1
Host: api.qubitro.com
Authorization: YOUR_API_KEY
Accept: */*
{
"action": "delete device",
"message": "Operation completed successfully",
"success": true
}Retrieves all available field names (keys) from an aggregation view. Keys represent the computed statistics (min/max/avg/sum/count) for each configured field.
What are Aggregated Keys? Field names in your aggregation view that represent computed statistics. Unlike raw data keys which are simple field names like temperature, aggregated keys include the aggregation type suffix.
Example Aggregated Keys:
temperature_min- Minimum temperature in time buckettemperature_max- Maximum temperature in time buckettemperature_avg- Average temperature in time buckethumidity_avg- Average humidity in time bucketsensor_count- Number of data points in time bucket
Key Naming Pattern: {original_field_name}_{aggregation_type}
Available Aggregation Types:
_min- Minimum value in the interval_max- Maximum value in the interval_avg- Average (mean) value in the interval_sum- Sum of all values in the interval_count- Count of data points in the interval
Use Cases:
Discover available statistics before querying aggregated data
Build dynamic dashboards that adapt to aggregation configuration
Validate chart widgets before creating visualizations
API integration to understand aggregation schema
Note: The time field is always present but not included in the keys list (it's automatically included in all responses).
Enter your API key with the Bearer prefix, e.g. "Bearer QB_your_api_key_here"
Project ID (UUID format)
3e5c0246-c759-48e8-8345-27db13f11ff7Device ID (UUID format)
dev-abc123Continuous Aggregation ID (UUID format)
ca-uuid-123Array of aggregated field names (e.g., ["temperature_min", "temperature_max", "temperature_avg", "humidity_avg"])
Unauthorized - Invalid or missing API key
Aggregation view not found - Check contaggr_id or view may have no data yet
GET /v2/projects/{project_id}/devices/{device_id}/aggregated-view/{contaggr_id}/keys HTTP/1.1
Host: api.qubitro.com
Authorization: YOUR_API_KEY
Accept: */*
[
"text"
]Last updated