Skip to main content

Commands API

These endpoints send and track device commands through the HXTP safety gateway and MQTT bridge.

Base URL: https://api.hestialabs.in/v1

Endpoints​

MethodPathSummary
GET/device/{deviceId}/commandsCommand History
POST/device/{deviceId}/commandSend Command
POST/device/{deviceId}/command/confirmConfirm Command
POST/devices/commandBatch Command

Command History​

GET /device/{deviceId}/commands

Get command history for a device

Authentication: Bearer JWT required

Parameters​

NameInTypeRequiredDescription
deviceIdpathstringYes—

Responses​

StatusDescription
200Command history

Example 200 response​

{
"commands": [
"value"
]
}

Send Command​

POST /device/{deviceId}/command

Send a command to a device

Authentication: Bearer JWT required

Parameters​

NameInTypeRequiredDescription
deviceIdpathstringYes—

Request body​

FieldTypeRequiredDescription
actionstringYesAction name (e.g., toggle_led, set_pin)
paramsobjectNoAction parameters
dry_runbooleanNoDry-run mode (safety check only)

Example request​

{
"action": "string",
"params": {},
"dry_run": true
}

Responses​

StatusDescription
200Dry run required
202Command dispatched
403Blocked

Example 200 response​

{
"status": "string",
"reason": "string",
"dry_run_token": "string"
}

Example 202 response​

{
"success": true,
"command_id": "string",
"message_id": "string"
}

Confirm Command​

POST /device/{deviceId}/command/confirm

Confirm dry-run token to execute

Authentication: Bearer JWT required

Parameters​

NameInTypeRequiredDescription
deviceIdpathstringYes—

Request body​

FieldTypeRequiredDescription
tokenstringNo—
dry_run_tokenstringNo—

Example request​

{
"token": "string",
"dry_run_token": "string"
}

Responses​

StatusDescription
200Command executed
403Confirmation failed

Example 200 response​

{}

Batch Command​

POST /devices/command

Send command to multiple devices

Authentication: Bearer JWT required

Parameters​

None.

Request body​

FieldTypeRequiredDescription
device_idsarray<string>Yes—
actionstringYes—
paramsobjectNo—

Example request​

{
"device_ids": [
"string"
],
"action": "string",
"params": {}
}

Responses​

StatusDescription
200Batch results

Example 200 response​

{
"results": [
"value"
]
}