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 Recording Command
Cancel a pending recording 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 a pending command. Only commands with
pending status can be cancelled.
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
The device’s unique identifier (e.g.,
dev_abc123).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 or stop_recording |
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
- Only commands in
pendingstatus can be cancelled - Commands that have been
delivered,executed,failed, orexpiredcannot be cancelled - Cancellation is immediate and the command will not be delivered to the device
Was this page helpful?
⌘I

