curl -X DELETE https://api.bota.dev/v1/devices/dev_abc123/ota \
-H "Authorization: Bearer sk_live_..."
const response = await fetch('https://api.bota.dev/v1/devices/dev_abc123/ota', {
method: 'DELETE',
headers: { 'Authorization': 'Bearer sk_live_...' },
});
if (response.status === 404) {
// Nothing was in flight.
} else {
const cancelled = await response.json();
if (cancelled.delivered_at) {
// The device already had it; it may still install.
}
}
import requests
response = requests.delete(
'https://api.bota.dev/v1/devices/dev_abc123/ota',
headers={'Authorization': 'Bearer sk_live_...'},
)
if response.status_code == 404:
... # Nothing was in flight.
else:
cancelled = response.json()
if cancelled['delivered_at']:
... # The device already had it; it may still install.
{
"id": "ota_7Rp2XvB4nT6yL8cW1kQ9mZa3",
"device_id": "dev_abc123",
"firmware_release_id": "fw_3kQ9mZa7Rp2XvB4nT6yL8cW1",
"status": "cancelled",
"assigned_at": "2026-08-14T12:00:00Z",
"delivered_at": null,
"applied_at": null,
"error_message": null
}
{
"id": "ota_7Rp2XvB4nT6yL8cW1kQ9mZa3",
"device_id": "dev_abc123",
"firmware_release_id": "fw_3kQ9mZa7Rp2XvB4nT6yL8cW1",
"status": "cancelled",
"assigned_at": "2026-08-14T12:00:00Z",
"delivered_at": "2026-08-14T12:01:30Z",
"applied_at": null,
"error_message": null
}
{
"error": {
"code": "not_found",
"message": "OTA assignment not found"
}
}
Firmware
Cancel Device OTA Assignment
Call off the assignment in flight so the device can be given another
DELETE
/
devices
/
{id}
/
ota
curl -X DELETE https://api.bota.dev/v1/devices/dev_abc123/ota \
-H "Authorization: Bearer sk_live_..."
const response = await fetch('https://api.bota.dev/v1/devices/dev_abc123/ota', {
method: 'DELETE',
headers: { 'Authorization': 'Bearer sk_live_...' },
});
if (response.status === 404) {
// Nothing was in flight.
} else {
const cancelled = await response.json();
if (cancelled.delivered_at) {
// The device already had it; it may still install.
}
}
import requests
response = requests.delete(
'https://api.bota.dev/v1/devices/dev_abc123/ota',
headers={'Authorization': 'Bearer sk_live_...'},
)
if response.status_code == 404:
... # Nothing was in flight.
else:
cancelled = response.json()
if cancelled['delivered_at']:
... # The device already had it; it may still install.
{
"id": "ota_7Rp2XvB4nT6yL8cW1kQ9mZa3",
"device_id": "dev_abc123",
"firmware_release_id": "fw_3kQ9mZa7Rp2XvB4nT6yL8cW1",
"status": "cancelled",
"assigned_at": "2026-08-14T12:00:00Z",
"delivered_at": null,
"applied_at": null,
"error_message": null
}
{
"id": "ota_7Rp2XvB4nT6yL8cW1kQ9mZa3",
"device_id": "dev_abc123",
"firmware_release_id": "fw_3kQ9mZa7Rp2XvB4nT6yL8cW1",
"status": "cancelled",
"assigned_at": "2026-08-14T12:00:00Z",
"delivered_at": "2026-08-14T12:01:30Z",
"applied_at": null,
"error_message": null
}
{
"error": {
"code": "not_found",
"message": "OTA assignment not found"
}
}
Calls off the device’s in-flight assignment, freeing it to be given another one.
Use this when firmware was assigned by mistake, or when a device has been sitting
on an update it never installed.
Returns the assignment, now
cancelled.
Cancelling cannot recall an update the device already holds. If the returned
assignment has a
delivered_at, the device was handed the update before you
cancelled and may still install it — check
Get Device OTA Status after its next
heartbeat.Authentication
Requires an API key withdevices:write scope.
Path Parameters
string
required
The device’s unique identifier (e.g.,
dev_abc123).curl -X DELETE https://api.bota.dev/v1/devices/dev_abc123/ota \
-H "Authorization: Bearer sk_live_..."
const response = await fetch('https://api.bota.dev/v1/devices/dev_abc123/ota', {
method: 'DELETE',
headers: { 'Authorization': 'Bearer sk_live_...' },
});
if (response.status === 404) {
// Nothing was in flight.
} else {
const cancelled = await response.json();
if (cancelled.delivered_at) {
// The device already had it; it may still install.
}
}
import requests
response = requests.delete(
'https://api.bota.dev/v1/devices/dev_abc123/ota',
headers={'Authorization': 'Bearer sk_live_...'},
)
if response.status_code == 404:
... # Nothing was in flight.
else:
cancelled = response.json()
if cancelled['delivered_at']:
... # The device already had it; it may still install.
{
"id": "ota_7Rp2XvB4nT6yL8cW1kQ9mZa3",
"device_id": "dev_abc123",
"firmware_release_id": "fw_3kQ9mZa7Rp2XvB4nT6yL8cW1",
"status": "cancelled",
"assigned_at": "2026-08-14T12:00:00Z",
"delivered_at": null,
"applied_at": null,
"error_message": null
}
{
"id": "ota_7Rp2XvB4nT6yL8cW1kQ9mZa3",
"device_id": "dev_abc123",
"firmware_release_id": "fw_3kQ9mZa7Rp2XvB4nT6yL8cW1",
"status": "cancelled",
"assigned_at": "2026-08-14T12:00:00Z",
"delivered_at": "2026-08-14T12:01:30Z",
"applied_at": null,
"error_message": null
}
{
"error": {
"code": "not_found",
"message": "OTA assignment not found"
}
}
Notes
- Both in-flight states can be cancelled —
pendinganddelivered. Both block a new assignment, so cancelling onlypendingwould leave a device that never installed its update stuck behind a409with no way out. - An assignment that already reached
applied,failedorcancelledis not in flight, so there is nothing to call off and the request is a404. - The cancelled assignment stays in the device’s history.
Was this page helpful?

