Devices
Retrieves all devices in the specified project sorted by last_seen (most recent first). Supports filtering by custom metadata fields to query specific device subsets.
Metadata Filtering: Filter devices by custom metadata fields using the format key:value,key2:value2
Example: metadata=location:warehouse,floor:2 returns devices where metadata.location="warehouse" AND metadata.floor="2"
Response Fields:
Device credentials (MQTT username/password or HTTP token) are excluded in list view
Use GET /devices/{device_id} to retrieve credentials for a specific device
Enter your API key with the Bearer prefix, e.g. "Bearer QB_your_api_key_here"
Project ID (UUID format)
3e5c0246-c759-48e8-8345-27db13f11ff7Filter by metadata (format: key:value,key2:value2)
location:warehouse,floor:2Devices retrieved successfully - Sorted by last_seen descending
Unauthorized - Invalid or missing API key
Project not found or access denied
GET /v2/projects/{project_id}/devices HTTP/1.1
Host: api.qubitro.com
Authorization: YOUR_API_KEY
Accept: */*
[
{
"avatar": "https://cdn.qubitro.com/avatars/temperature-sensor.png",
"brand": "Custom",
"description": "Temperature sensor in warehouse zone A",
"device_credentials": {
"ANY_ADDITIONAL_PROPERTY": "anything"
},
"id": "5f8d0d55b54764ca6f3a1234",
"last_seen": "2024-01-15T14:30:00Z",
"metadata": {
"ANY_ADDITIONAL_PROPERTY": "anything"
},
"model": "Custom",
"name": "Temperature Sensor 01",
"source": "mqtt",
"tags": [
"warehouse",
"zone_a",
"temperature"
]
}
]Creates a new device in the specified project and generates connection credentials automatically. The response includes MQTT credentials or HTTP token based on the selected protocol.
Required Fields:
name: Device name (max 100 characters)
description: Device description (max 500 characters)
source: Connection protocol - "mqtt", "http", or "intemo-wifi"
Optional Fields:
brand: Device brand (defaults to "Custom")
model: Device model (defaults to "Custom")
tags: Array of alphanumeric tags (e.g., ["sensor", "warehouse", "zone_a"])
metadata: Custom key-value pairs for filtering (e.g., {"location": "warehouse", "floor": "2"})
Generated Credentials:
MQTT: Returns username and password for broker connection
HTTP: Returns token for API authentication
Save credentials immediately - they cannot be retrieved again
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 avatar/icon URL
https://cdn.qubitro.com/avatars/temperature-sensor.pngDevice brand (defaults to "Custom")
CustomDevice description (required, max 500 characters)
Temperature sensor in warehouse zone AUnique device identifier
5f8d0d55b54764ca6f3a1234Last time device sent data (ISO 8601 format, UTC)
2024-01-15T14:30:00ZDevice model (defaults to "Custom")
CustomDevice name (required, max 100 characters)
Temperature Sensor 01Connection protocol: "mqtt", "http", or "intemo-wifi" (required for creation)
mqttOptional tags for categorization (alphanumeric and underscore only)
["warehouse","zone_a","temperature"]Device created successfully - Includes generated connection credentials
Invalid request body - Check required fields and format
Unauthorized - Invalid or missing API key
Project not found
POST /v2/projects/{project_id}/devices HTTP/1.1
Host: api.qubitro.com
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 424
{
"avatar": "https://cdn.qubitro.com/avatars/temperature-sensor.png",
"brand": "Custom",
"description": "Temperature sensor in warehouse zone A",
"device_credentials": {
"ANY_ADDITIONAL_PROPERTY": "anything"
},
"id": "5f8d0d55b54764ca6f3a1234",
"last_seen": "2024-01-15T14:30:00Z",
"metadata": {
"ANY_ADDITIONAL_PROPERTY": "anything"
},
"model": "Custom",
"name": "Temperature Sensor 01",
"source": "mqtt",
"tags": [
"warehouse",
"zone_a",
"temperature"
]
}{
"avatar": "https://cdn.qubitro.com/avatars/temperature-sensor.png",
"brand": "Custom",
"description": "Temperature sensor in warehouse zone A",
"device_credentials": {
"ANY_ADDITIONAL_PROPERTY": "anything"
},
"id": "5f8d0d55b54764ca6f3a1234",
"last_seen": "2024-01-15T14:30:00Z",
"metadata": {
"ANY_ADDITIONAL_PROPERTY": "anything"
},
"model": "Custom",
"name": "Temperature Sensor 01",
"source": "mqtt",
"tags": [
"warehouse",
"zone_a",
"temperature"
]
}Retrieves detailed information about a specific device including connection credentials. Use this endpoint to get MQTT credentials or HTTP tokens required for device communication.
Returned Credentials:
MQTT devices: Returns
device_credentialswithusernameandpasswordHTTP devices: Returns
device_credentialswithtoken
Security Note: Device credentials are sensitive. Store them securely on your device and never expose them publicly.
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 retrieved successfully - Includes connection credentials
Unauthorized - Invalid or missing API key
Device not found or access denied
GET /v2/projects/{project_id}/devices/{device_id} HTTP/1.1
Host: api.qubitro.com
Authorization: YOUR_API_KEY
Accept: */*
{
"avatar": "https://cdn.qubitro.com/avatars/temperature-sensor.png",
"brand": "Custom",
"description": "Temperature sensor in warehouse zone A",
"device_credentials": {
"ANY_ADDITIONAL_PROPERTY": "anything"
},
"id": "5f8d0d55b54764ca6f3a1234",
"last_seen": "2024-01-15T14:30:00Z",
"metadata": {
"ANY_ADDITIONAL_PROPERTY": "anything"
},
"model": "Custom",
"name": "Temperature Sensor 01",
"source": "mqtt",
"tags": [
"warehouse",
"zone_a",
"temperature"
]
}⚠️ WARNING: Permanently deletes a device and ALL associated resources. This action CANNOT be undone.
What Gets Deleted:
Device configuration and metadata
Device credentials (MQTT username/password or HTTP token)
All time-series data from TimescaleDB
All functions: decoder, transform, rules, storage functions, schedules
Storage views associated with the device
Widget references in dashboards
Dashboard associations
What Happens:
Device stops receiving/sending data immediately
All historical data is permanently deleted
Functions stop executing
Dashboards using this device will show "device not found"
Cannot Be Undone: There is no way to recover a deleted device or its data.
Alternative: Use Data PURGE endpoint to delete only data while keeping device configuration
Success Response:
{
"success": true,
"message": "Device deleted successfully",
"action": "delete device"
}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 deleted successfully - All associated resources removed
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} HTTP/1.1
Host: api.qubitro.com
Authorization: YOUR_API_KEY
Accept: */*
{
"action": "delete device",
"message": "Operation completed successfully",
"success": true
}Last updated