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â
| Method | Path | Summary |
|---|---|---|
GET | /device/{deviceId}/commands | Command History |
POST | /device/{deviceId}/command | Send Command |
POST | /device/{deviceId}/command/confirm | Confirm Command |
POST | /devices/command | Batch Command |
Command Historyâ
GET /device/{deviceId}/commands
Get command history for a device
Authentication: Bearer JWT required
Parametersâ
| Name | In | Type | Required | Description |
|---|---|---|---|---|
deviceId | path | string | Yes | â |
Responsesâ
| Status | Description |
|---|---|
200 | Command history |
Example 200 responseâ
{
"commands": [
"value"
]
}
Send Commandâ
POST /device/{deviceId}/command
Send a command to a device
Authentication: Bearer JWT required
Parametersâ
| Name | In | Type | Required | Description |
|---|---|---|---|---|
deviceId | path | string | Yes | â |
Request bodyâ
| Field | Type | Required | Description |
|---|---|---|---|
action | string | Yes | Action name (e.g., toggle_led, set_pin) |
params | object | No | Action parameters |
dry_run | boolean | No | Dry-run mode (safety check only) |
Example requestâ
{
"action": "string",
"params": {},
"dry_run": true
}
Responsesâ
| Status | Description |
|---|---|
200 | Dry run required |
202 | Command dispatched |
403 | Blocked |
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â
| Name | In | Type | Required | Description |
|---|---|---|---|---|
deviceId | path | string | Yes | â |
Request bodyâ
| Field | Type | Required | Description |
|---|---|---|---|
token | string | No | â |
dry_run_token | string | No | â |
Example requestâ
{
"token": "string",
"dry_run_token": "string"
}
Responsesâ
| Status | Description |
|---|---|
200 | Command executed |
403 | Confirmation failed |
Example 200 responseâ
{}
Batch Commandâ
POST /devices/command
Send command to multiple devices
Authentication: Bearer JWT required
Parametersâ
None.
Request bodyâ
| Field | Type | Required | Description |
|---|---|---|---|
device_ids | array<string> | Yes | â |
action | string | Yes | â |
params | object | No | â |
Example requestâ
{
"device_ids": [
"string"
],
"action": "string",
"params": {}
}
Responsesâ
| Status | Description |
|---|---|
200 | Batch results |
Example 200 responseâ
{
"results": [
"value"
]
}