curl -X DELETE https://api.bota.dev/v1/devices/dev_abc123/commands/cmd_xyz789 \
-H "Authorization: Bearer sk_live_..."
const response = await fetch(
'https://api.bota.dev/v1/devices/dev_abc123/commands/cmd_xyz789',
{
method: 'DELETE',
headers: {
'Authorization': 'Bearer sk_live_...',
},
}
);
import requests
response = requests.delete(
'https://api.bota.dev/v1/devices/dev_abc123/commands/cmd_xyz789',
headers={'Authorization': 'Bearer sk_live_...'},
)
{
"id": "cmd_xyz789",
"device_id": "dev_abc123",
"type": "start_recording",
"status": "cancelled",
"params": {
"max_duration_sec": 3600,
"upload_immediately": true
},
"grant_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"result": null,
"error": null,
"expires_at": "2025-01-20T11:00:00Z",
"delivered_at": null,
"executed_at": null,
"created_at": "2025-01-20T10:55:00Z"
}
{
"error": {
"code": "command_not_cancellable",
"message": "Command has already been executed and cannot be cancelled"
}
}
{
"error": {
"code": "command_not_cancellable",
"message": "Command has been delivered to device and cannot be cancelled"
}
}
{
"error": {
"code": "not_found",
"message": "Command not found"
}
}
Devices
Cancel Device Command
Cancel an in-flight device command
DELETE
/
devices
/
{id}
/
commands
/
{commandId}
curl -X DELETE https://api.bota.dev/v1/devices/dev_abc123/commands/cmd_xyz789 \
-H "Authorization: Bearer sk_live_..."
const response = await fetch(
'https://api.bota.dev/v1/devices/dev_abc123/commands/cmd_xyz789',
{
method: 'DELETE',
headers: {
'Authorization': 'Bearer sk_live_...',
},
}
);
import requests
response = requests.delete(
'https://api.bota.dev/v1/devices/dev_abc123/commands/cmd_xyz789',
headers={'Authorization': 'Bearer sk_live_...'},
)
{
"id": "cmd_xyz789",
"device_id": "dev_abc123",
"type": "start_recording",
"status": "cancelled",
"params": {
"max_duration_sec": 3600,
"upload_immediately": true
},
"grant_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"result": null,
"error": null,
"expires_at": "2025-01-20T11:00:00Z",
"delivered_at": null,
"executed_at": null,
"created_at": "2025-01-20T10:55:00Z"
}
{
"error": {
"code": "command_not_cancellable",
"message": "Command has already been executed and cannot be cancelled"
}
}
{
"error": {
"code": "command_not_cancellable",
"message": "Command has been delivered to device and cannot be cancelled"
}
}
{
"error": {
"code": "not_found",
"message": "Command not found"
}
}
Cancel an in-flight command.
An authenticated
factory_reset may be cancelled only while it is still
pending. Once delivered, the physical device may already be wiping local
data, so cancellation is rejected and the reset must finish its acknowledgement
close-loop.
Authentication
Requires an API key withdevices:write scope.
curl -X DELETE https://api.bota.dev/v1/devices/dev_abc123/commands/cmd_xyz789 \
-H "Authorization: Bearer sk_live_..."
const response = await fetch(
'https://api.bota.dev/v1/devices/dev_abc123/commands/cmd_xyz789',
{
method: 'DELETE',
headers: {
'Authorization': 'Bearer sk_live_...',
},
}
);
import requests
response = requests.delete(
'https://api.bota.dev/v1/devices/dev_abc123/commands/cmd_xyz789',
headers={'Authorization': 'Bearer sk_live_...'},
)
Path Parameters
string
required
The device’s unique identifier (e.g.,
dev_abc123).string
required
The command’s unique identifier (e.g.,
cmd_xyz789).Response
Returns the command object withstatus set to cancelled.
{
"id": "cmd_xyz789",
"device_id": "dev_abc123",
"type": "start_recording",
"status": "cancelled",
"params": {
"max_duration_sec": 3600,
"upload_immediately": true
},
"grant_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"result": null,
"error": null,
"expires_at": "2025-01-20T11:00:00Z",
"delivered_at": null,
"executed_at": null,
"created_at": "2025-01-20T10:55:00Z"
}
{
"error": {
"code": "command_not_cancellable",
"message": "Command has already been executed and cannot be cancelled"
}
}
{
"error": {
"code": "command_not_cancellable",
"message": "Command has been delivered to device and cannot be cancelled"
}
}
{
"error": {
"code": "not_found",
"message": "Command not found"
}
}
Response Fields
| Field | Type | Description |
|---|---|---|
id | string | Command identifier |
device_id | string | Target device (dev_*) |
type | string | start_recording, stop_recording, trigger_upload, or factory_reset |
status | string | cancelled |
params | object | Command parameters |
result | object | null | Always null for cancelled commands |
error | object | null | Always null for cancelled commands |
expires_at | string | null | Original expiration timestamp |
delivered_at | string | null | Always null for cancelled commands |
executed_at | string | null | Always null for cancelled commands |
created_at | string | Creation timestamp (ISO 8601) |
Notes
- A
factory_resetcan be cancelled only whilepending; delivery makes it non-cancellable - Other command types retain the existing pending/delivered cancellation behavior
- Commands in
executed,failed,expired, orcancelledstatus cannot be cancelled - Cancellation is immediate and the command will not be delivered to the device
Was this page helpful?

