nexalwarenexalwaredocs
API ReferenceDevice control

Send a command to a device

POST
/api/v1/devices/{deviceId}/command

The general-purpose command endpoint - validates the command and its params against the device's catalog, checks the caller's DeviceGrant, then either publishes it over MQTT immediately or (for a command marked requiresApproval) creates a pending approval instead of executing it. An API key needs a DeviceGrant covering this device and this command name - see the Authentication & Access guide.

Authorization

X-Api-Key<token>

A secret API key created on the dashboard (Settings → API Keys). By itself it grants nothing - it must also have a DeviceGrant scoping it to the specific device(s) and command(s) it may call.

In: header

Path Parameters

deviceId*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/api/v1/devices/string/command" \  -H "Content-Type: application/json" \  -d '{    "cmd": "string"  }'
{  "ok": true}