Skip to main content
DELETE
/
devices
/
{id}
/
commands
/
{commandId}
curl -X DELETE https://api.bota.dev/v1/devices/dev_abc123/commands/cmd_xyz789 \
  -H "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"
}
Cancel a pending command. Only commands with pending status can be cancelled.

Authentication

Requires an API key with devices:write scope.
curl -X DELETE https://api.bota.dev/v1/devices/dev_abc123/commands/cmd_xyz789 \
  -H "Authorization: Bearer sk_live_..."

Path Parameters

id
string
required
The device’s unique identifier (e.g., dev_abc123).
commandId
string
required
The command’s unique identifier (e.g., cmd_xyz789).

Response

Returns the command object with status 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"
}

Response Fields

FieldTypeDescription
idstringCommand identifier
device_idstringTarget device (dev_*)
typestringstart_recording or stop_recording
statusstringcancelled
paramsobjectCommand parameters
resultobject | nullAlways null for cancelled commands
errorobject | nullAlways null for cancelled commands
expires_atstring | nullOriginal expiration timestamp
delivered_atstring | nullAlways null for cancelled commands
executed_atstring | nullAlways null for cancelled commands
created_atstringCreation timestamp (ISO 8601)

Notes

  • Only commands in pending status can be cancelled
  • Commands that have been delivered, executed, failed, or expired cannot be cancelled
  • Cancellation is immediate and the command will not be delivered to the device