Skip to main content

Widgets API

Manage widget configurations for project dashboards programmatically.


List widgets in a project

GET /api/v1/widgets?projectId={projectId}
Authorization: Bearer <token>

Response:

{
"success": true,
"data": {
"widgets": [
{
"id": "uuid",
"type": "VALUE_DISPLAY",
"layout": { "x": 0, "y": 0, "w": 2, "h": 2 },
"config": {
"suffix": "°C",
"label": "Temperature"
},
"deviceId": "uuid",
"pin": 0
}
]
}
}

Get a widget

GET /api/v1/widgets/{widgetId}
Authorization: Bearer <token>

Create a widget

POST /api/v1/widgets
Authorization: Bearer <token>
Content-Type: application/json

{
"type": "VALUE_DISPLAY",
"projectId": "uuid",
"deviceId": "uuid",
"pin": 0,
"layout": { "x": 0, "y": 0, "w": 2, "h": 2 },
"config": {
"suffix": "°C",
"label": "Temperature"
}
}

All valid type values: BUTTON, SWITCH, SLIDER, GAUGE, ANALOG_GAUGE, GRAPH, VALUE_DISPLAY, LCD, TERMINAL, LED, JOYSTICK, MAP, PROGRESS_BAR, COLOR_PICKER, STEP_CONTROL, BRIDGE, IMAGE, TABLE, BAR_CHART, ALERT, NUMBER_INPUT, TIMER, SEGMENTED_CONTROL, SIGNAL_STRENGTH, TEXT_INPUT, SPARKLINE, ICON_STATUS, KEYPAD, LOCATION


Update a widget

PATCH /api/v1/widgets/{widgetId}
Authorization: Bearer <token>
Content-Type: application/json

{
"layout": { "x": 2, "y": 0, "w": 3, "h": 2 },
"config": { "suffix": "°F" }
}

Delete a widget

DELETE /api/v1/widgets/{widgetId}
Authorization: Bearer <token>

Returns 204 No Content on success.