Documentation / API
Dashboards
Create and save dashboards with their widgets, declare the $device variable, read the data a dashboard displays, and share it through a public read-only link.
All paths are relative to https://apiv1.opensensorcloud.com/api/v1. Reading requires membership; writing and sharing require editor.
Endpoints
| Method and path | Role | Result |
|---|---|---|
GET /orgs/{orgId}/dashboards |
member | [{ id, name, shared, variables, updatedAt }] |
POST /orgs/{orgId}/dashboards |
editor | 201, the dashboard |
GET /orgs/{orgId}/dashboards/{dashboardId} |
member | the dashboard |
PUT /orgs/{orgId}/dashboards/{dashboardId} |
editor | the dashboard (full replacement) |
DELETE /orgs/{orgId}/dashboards/{dashboardId} |
editor | 204 |
GET /orgs/{orgId}/dashboards/{dashboardId}/data |
member | latest values of the displayed devices |
POST /orgs/{orgId}/dashboards/{dashboardId}/share |
editor | { shareUrl } |
DELETE /orgs/{orgId}/dashboards/{dashboardId}/share |
editor | 204 |
The dashboard object
POST and PUT take { name, widgets, variables }; responses add id, shareUrl, shareDeviceId and updatedAt.
{
"name": "Greenhouses",
"variables": [],
"widgets": [
{ "id": "c1", "type": "line", "title": "Temperature", "x": 0, "y": 0, "w": 8, "h": 5, "period": "24h",
"series": [ { "deviceId": "8dec3c85-…", "key": "temperature" }, { "deviceId": "2b0e…", "key": "temperature" } ] },
{ "id": "v1", "type": "value", "title": "Greenhouse A", "x": 8, "y": 0, "w": 2, "h": 2,
"source": { "deviceId": "8dec3c85-…", "key": "temperature" } }
]
}
name: 1 to 100 characters; up to 50 widgets.- Layout on a 12-column grid:
x0–11,y≥ 0,w1–12 (withx + w ≤ 12),h1–40 rows.id: any string up to 40 characters, unique in the dashboard. title: optional, up to 100 characters.
Widget types
type |
Specific fields |
|---|---|
line |
series: 1 to 8 { deviceId, key }; period: 1h, 24h (default), 7d, 30d |
value |
source: { deviceId, key } |
gauge |
source, min, max (max > min) |
state |
source (a boolean channel) |
text |
text (up to 5,000 characters) |
level |
source, min, max, decimals (0–3, default 1), zones |
list |
devices (selector), columns: up to 3 channel keys, onClick |
grid |
devices, key, min, max, decimals, zones, onClick |
map |
devices, color, label (optional channel key shown in the tooltip), onClick, showZones (default false: draws the organization's zones) |
bars |
series: 1 to 8 { deviceId, key }; range: 24h, 7d (default), 30d, 90d, 365d; bucket: auto (default), 1h, 1d, 1w, 1M (at most 1,000 bars over the range); fn: avg (default), min, max, count, integral, delta; stacked (default false); resultUnit (up to 20 characters, empty = computed) |
stat |
source; fn: as bars plus last (default); period: day (default), week, month, range (then range, default 7d); trend: upGood, upBad, neutral (default); resultUnit |
heatmap |
source; range (default 30d; up to 30 days hour × day, beyond weekday × week); fn: avg (default), min, max |
counter |
source; fn: integral (default) or delta; period and range as stat (default month); price: number ≥ 0 or null (default); currency (up to 8 characters); secondary: none (default), day, month; resultUnit |
Zones (level, grid, map colors): 1 to 6 { upTo, color, emoji } with ascending upTo, color as #RRGGBB, optional emoji. A value takes the first zone whose upTo it does not exceed; above the last one, the last one.
"zones": [
{ "upTo": 18, "color": "#4C8DD6", "emoji": "🥶" },
{ "upTo": 28, "color": "#3FA66B", "emoji": "😀" },
{ "upTo": 40, "color": "#D9534F", "emoji": "🥵" }
]
Device selector (devices), resolved by the server within the organization, sorted by name, at most 200 devices:
{ "kind": "all" }
{ "kind": "list", "deviceIds": ["8dec3c85-…", "2b0e…"] }
{ "kind": "profile", "profileId": "9f10a175-…" }
{ "kind": "attribute", "key": "site", "value": "north" }
Click action (onClick, default { "kind": "device" }): { "kind": "device" } opens the device page; { "kind": "dashboard", "dashboardId": "…" } opens that dashboard with ?device= (it must declare the device variable).
Map color (color, default { "kind": "status" }): { "kind": "status" } (online / offline) or { "kind": "zones", "key": "temperature", "min": 0, "max": 40, "zones": [ … ] }.
Saving a dashboard that references a device, profile or dashboard of another organization is refused: 400 unknown_device, unknown_profile or unknown_dashboard.
The $device variable
A dashboard may declare one variable, the displayed device, optionally restricted to a profile:
"variables": [ { "name": "device", "kind": "device", "profileId": "9f10a175-…" } ]
Single-device sources (series, source) can then use the literal "$device" instead of a device id:
{ "id": "v1", "type": "value", "x": 0, "y": 0, "w": 3, "h": 3, "source": { "deviceId": "$device", "key": "temperature" } }
Using $device without declaring the variable: 400 device_variable_missing.
Dashboard data
GET /orgs/{orgId}/dashboards/{dashboardId}/data?device={deviceId}
device binds $device (it must belong to the organization and match the variable's profile, otherwise 400 invalid_device_param). Without it, $device widgets have no data.
{
"devices": {
"8dec3c85-…": {
"name": "Greenhouse A", "lastSeenAt": "2026-11-13T09:24:57.059Z", "profileId": "9f10a175-…",
"attributes": { "site": "north" }, "openAlerts": 0,
"location": { "latitude": 45.764, "longitude": 4.8357, "source": "manual", "radiusM": null, "updatedAt": null },
"channels": {
"temperature": { "key": "temperature", "type": "number", "unit": "°C", "label": "Temperature",
"min": -10, "max": 50, "declared": true, "lastTs": "2026-11-13T09:24:56.936Z", "lastValue": 25.5 }
}
}
},
"selections": { "gr": ["8dec3c85-…", "2b0e…"] },
"device": "8dec3c85-…"
}
devices: latest values of every device the dashboard shows; selections: device ids resolved for each multi-device widget; device: the device bound to $device, or null. Line charts load their series from Telemetry.
Sharing
POST /orgs/{orgId}/dashboards/{dashboardId}/share
{ "deviceId": "8dec3c85-…" }
The body is optional. deviceId freezes the $device variable in the link: visitors always see that device and cannot choose another. Returns:
{ "shareUrl": "https://www.opensensorcloud.com/public/dashboards/Xk2…" }
Calling it again generates a new link and invalidates the previous one. DELETE …/share disables sharing.
Public endpoints (no account)
| Method and path | Result |
|---|---|
GET /public/dashboards/{token} |
{ name, widgets } |
GET /public/dashboards/{token}/data |
as the member data endpoint; query parameters ignored ($device is the frozen device), device attributes always empty |
GET /public/dashboards/{token}/telemetry?deviceId=…&key=…&from=…&to=… |
a series, as Telemetry; only for channels the dashboard displays |
GET /public/dashboards/{token}/buckets?deviceId=…&key=…&from=…&to=…&bucket=…&fn=…&tz=… |
per-period values, as Telemetry; same restriction |
GET /public/dashboards/{token}/zones |
the organization's zones, only when a map widget has showZones |
An invalid or disabled token returns 404.