Skip to main content
PATCH
/
devices
/
{id}
curl -X PATCH https://api.bota.dev/v1/devices/dev_abc123 \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "firmware_version": "1.3.0",
    "settings": {
      "connection": {
        "enabled_connections": { "wifi": true, "cellular": false },
        "upload_network_preference": ["wifi", "ble"]
      }
    }
  }'
{
  "id": "dev_abc123",
  "serial_number": "SN-2025-001234",
  "model": "bota_pin",
  "firmware_version": "1.3.0",
  "status": "bound",
  "end_user_id": "eu_xyz789",
  "metadata": {},
  "settings": {
    "connection": {
      "enabled_connections": { "wifi": true, "cellular": false },
      "upload_network_preference": ["wifi", "ble"],
      "power_management": {
        "wifi_idle_timeout_seconds": 180,
        "cellular_idle_timeout_seconds": 180
      }
    },
    "upload": {
      "streaming_enabled": true,
      "streaming_chunk_kb": 256,
      "daily_data_limit_mb": 500,
      "allow_roaming": false,
      "pause_on_low_battery": true,
      "off_peak_hours": null
    },
    "audio": {
      "codec": "opus",
      "sample_rate_khz": 16,
      "bitrate_kbps": 32
    },
    "power": {
      "auto_sleep_minutes": 30,
      "low_battery_threshold_percent": 20
    }
  },
  "created_at": "2025-01-15T10:30:00Z",
  "updated_at": "2025-01-15T14:20:00Z"
}

Overview

Updates device metadata (firmware version, custom metadata) and/or device settings (upload configuration, audio quality, power management). This endpoint performs a partial update - only fields included in the request body are modified.

Authentication

Requires a valid API key with devices:write scope.
curl -X PATCH https://api.bota.dev/v1/devices/dev_abc123 \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "firmware_version": "1.3.0",
    "settings": {
      "connection": {
        "enabled_connections": { "wifi": true, "cellular": false },
        "upload_network_preference": ["wifi", "ble"]
      }
    }
  }'

Path Parameters

id
string
required
Device ID (e.g., dev_abc123)

Request Body

All fields are optional. Only include what you want to update.
firmware_version
string
Firmware version string (max 32 chars)
metadata
object
Custom key-value metadata
settings
object
Device configuration (upload, audio, power)

Response

Returns the updated device object with all settings (including defaults).
{
  "id": "dev_abc123",
  "serial_number": "SN-2025-001234",
  "model": "bota_pin",
  "firmware_version": "1.3.0",
  "status": "bound",
  "end_user_id": "eu_xyz789",
  "metadata": {},
  "settings": {
    "connection": {
      "enabled_connections": { "wifi": true, "cellular": false },
      "upload_network_preference": ["wifi", "ble"],
      "power_management": {
        "wifi_idle_timeout_seconds": 180,
        "cellular_idle_timeout_seconds": 180
      }
    },
    "upload": {
      "streaming_enabled": true,
      "streaming_chunk_kb": 256,
      "daily_data_limit_mb": 500,
      "allow_roaming": false,
      "pause_on_low_battery": true,
      "off_peak_hours": null
    },
    "audio": {
      "codec": "opus",
      "sample_rate_khz": 16,
      "bitrate_kbps": 32
    },
    "power": {
      "auto_sleep_minutes": 30,
      "low_battery_threshold_percent": 20
    }
  },
  "created_at": "2025-01-15T10:30:00Z",
  "updated_at": "2025-01-15T14:20:00Z"
}

Response Fields

FieldTypeDescription
idstringDevice identifier (dev_*)
serial_numberstringPhysical serial number
modelstringDevice model (bota_pin or bota_note)
firmware_versionstring | nullCurrent firmware version
statusstringunbound or bound
end_user_idstring | nullBound end user (eu_*)
battery_percentinteger | nullBattery level (0-100)
storage_used_mbinteger | nullStorage used in MB
storage_total_mbinteger | nullTotal storage capacity in MB
signal_strength_dbminteger | nullSignal strength in dBm
last_heartbeat_atstring | nullLast heartbeat timestamp (ISO 8601)
recording_stateobject | nullCurrent recording state
metadataobjectCustom key-value metadata
settingsobjectDevice settings including connection, upload, audio, and power configuration
created_atstringCreation timestamp (ISO 8601)
updated_atstringLast update timestamp (ISO 8601)

Examples

Update Connection Settings Only

cURL
curl -X PATCH https://api.bota.dev/v1/devices/dev_abc123 \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{"settings": {"connection": {"upload_network_preference": ["cellular", "wifi", "ble"]}}}'

Configure Radio Idle Timeouts

cURL
curl -X PATCH https://api.bota.dev/v1/devices/dev_abc123 \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{"settings": {"connection": {"power_management": {"wifi_idle_timeout_seconds": 300, "cellular_idle_timeout_seconds": 60}}}}'

Update Firmware Version

cURL
curl -X PATCH https://api.bota.dev/v1/devices/dev_abc123 \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{"firmware_version": "1.4.0"}'

Update Custom Metadata

cURL
curl -X PATCH https://api.bota.dev/v1/devices/dev_abc123 \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{"metadata": {"department": "Sales", "region": "West"}}'

Travel Mode Preset

cURL
curl -X PATCH https://api.bota.dev/v1/devices/dev_abc123 \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "settings": {
      "connection": {
        "enabled_connections": { "wifi": true, "cellular": false },
        "upload_network_preference": ["wifi", "ble"]
      },
      "upload": {
        "allow_roaming": false
      }
    }
  }'

Notes

Settings Merge: When updating settings, a deep merge is performed. Only the specified nested fields are updated; others remain unchanged.
Defaults Included: The response always includes complete settings with defaults filled in, even if you only updated one field.