Device Data
Retrieves time-series data from a device with flexible pagination and time range filtering. Data is returned in reverse chronological order (newest first).
Range Types:
all: Returns all data with paginationtime: Returns data within specified start and end timestamps (requires start and end parameters)last: Returns most recent data points (requires limit parameter)
Pagination:
page: Page number starting from 1
limit: Number of records per page (max 1000)
Results are sorted by timestamp descending
Time Format: Use ISO 8601 format in UTC: 2024-01-15T10:30:00Z
Storage Views: If a storage function (data transformation) is applied, use the storage parameter with the function identifier to retrieve transformed data instead of raw data
Example Queries:
Last 100 records:
?page=1&limit=100&range=allSpecific time range:
?page=1&limit=100&range=time&start=2024-01-01T00:00:00Z&end=2024-01-02T00:00:00Z
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
5f8d0d55b54764ca6f3a1234Page number (starts at 1)
1Records per page (max 1000)
100Range type: 'all', 'time', or 'last'
timeStart time in ISO 8601 format (required if range=time)
2024-01-01T00:00:00ZEnd time in ISO 8601 format (required if range=time)
2024-01-02T00:00:00ZStorage view identifier for transformed data
temperature_hourly_avgArray of data points - Each object contains 'time' field plus device-specific sensor fields (e.g., temperature, humidity). Field names vary by device.
Invalid parameters - Check range type, time format, or pagination values
Unauthorized - Invalid or missing API key
Device not found or access denied
GET /v2/projects/{project_id}/devices/{device_id}/data?page=1&limit=1&range=text HTTP/1.1
Host: api.qubitro.com
Authorization: YOUR_API_KEY
Accept: */*
[
{
"battery": 3.7,
"humidity": 65.2,
"temperature": 23.5,
"time": "2024-01-15T10:30:00Z"
}
]⚠️ DATA ONLY: Permanently deletes ALL time-series data for a device while keeping the device configuration, functions, and settings intact. This action CANNOT be undone.
What Gets Deleted:
All time-series measurements from TimescaleDB
All historical data points
All timestamps and values
What is KEPT:
✅ Device configuration and metadata
✅ Device credentials (MQTT/HTTP)
✅ Functions (decoder, transform, rules, storage, schedules)
✅ Storage views
✅ Dashboard widgets (will show no data)
After Purge:
Device can immediately start sending new data
Functions continue to execute on new data
Dashboards show empty state until new data arrives
Use Cases:
Clear test data before production deployment
Start fresh after configuration changes
Remove corrupted data while keeping device setup
Compliance: Delete old data while maintaining device structure
Alternative: Use Device DELETE to remove both device and data
Success Response:
{
"success": true,
"message": "Device data purged successfully",
"action": "delete device 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
5f8d0d55b54764ca6f3a1234Device data purged successfully - Device configuration preserved
Unauthorized - Invalid or missing API key
Forbidden - Insufficient permissions (requires delete scope)
Device not found or access denied
DELETE /v2/projects/{project_id}/devices/{device_id}/data HTTP/1.1
Host: api.qubitro.com
Authorization: YOUR_API_KEY
Accept: */*
{
"action": "delete device",
"message": "Operation completed successfully",
"success": true
}Retrieves all available data keys (field names) from the device's telemetry data. Data keys are the field names in the JSON payload sent by the device.
What are Data Keys? Field names in your device's telemetry data. For example, if your device sends {"temperature": 25, "humidity": 60, "battery": 3.7}, the data keys are ["temperature", "humidity", "battery"].
Use Cases:
Discover available fields before querying data
Build dynamic UIs that adapt to device data structure
Validate widget configurations before creating dashboards
API integration to understand device data schema
Returns: Array of string field names from the most recent data point
Example Response:
["temperature", "humidity", "battery_level", "rssi", "snr", "timestamp"]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
5f8d0d55b54764ca6f3a1234Data keys retrieved successfully - Returns array of field names
Unauthorized - Invalid or missing API key
Device not found or no data available yet
GET /v2/projects/{project_id}/devices/{device_id}/data/keys HTTP/1.1
Host: api.qubitro.com
Authorization: YOUR_API_KEY
Accept: */*
[
"text"
]Last updated