Skip to main content

Run a device command

POST 

/api/v1/devices/{deviceId}/commands:invoke

Run a command declared by the target device. Read its command definitions first with GET capabilities/schema?type=commands. Use the Command's name with each underscore replaced by a dot (for example, set_di becomes set.di) as deviceCommand, and build parameters from the Command's request schema. A command the device does not declare is rejected with 422. Keep the returned reqSeqId and match it in the device's command history (GET commands/results) to follow the outcome. The set.di command in the request example is only an example. It works only on devices that declare it.

Request​

Responses​

Accepted. Returns the initial command-result envelope (reqSeqId, phase, status, message). Track it via GET commands/results until it reaches result, or fails / times out (data.status = 1, data.error.code timedOut).