Define a custom command for a device
Dashboard-only
DeviceGrant), and use the Device Control endpoints.Adds one command to this device's catalog (creating the catalog on first use). Once defined, any caller with a DeviceGrant covering this device can send it via POST /devices/{deviceId}/command.
Authorization
sessionAuth A session token for an existing account, obtained from POST /auth/login (see the Authentication endpoints) - not an API key. Endpoints marked with this scheme reject API key callers outright, regardless of what that key is granted. Outside the Authentication endpoints themselves, everything requiring this scheme manages dashboard resources (rules, grants, keys, device configuration, command catalogs) and mirrors what a human does in the Nexalware web app - it is not meant to be automated by a third-party integration the way the Device Control and Schedules endpoints are.
In: header
Path Parameters
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/api/v1/devices/string/commands" \ -H "Content-Type: application/json" \ -d '{ "name": "SET_BRIGHTNESS", "label": "Set brightness", "kind": "ACTION", "paramsSchema": { "type": "object", "properties": { "level": { "type": "number", "minimum": 0, "maximum": 100 } } }, "shape": "NUMBER", "requiresApproval": false }'{ "commandId": "string"}List pending and past command approvals GET
A command marked `requiresApproval` on its CommandDefinition never executes immediately for a non-owner caller (including an API key) it lands here instead, waiting for an Owner/Admin to approve or deny it.
Delete a device DELETE
Also deletes its schedules, rules, grants, telemetry, and approval history.