Skip to main content
PATCH
/
v1
/
devices
/
{id}
Update Device
curl --request PATCH \
  --url https://api.example.com/v1/devices/{id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "firmware_version": "<string>",
  "metadata": {},
  "settings": {
    "upload": {
      "mode": "<string>",
      "streaming_enabled": true,
      "upload_delay_minutes": 123,
      "daily_data_limit_mb": 123,
      "allow_roaming": true,
      "pause_on_low_battery": true
    },
    "audio": {
      "codec": "<string>",
      "sample_rate_khz": 123,
      "bitrate_kbps": 123
    },
    "power": {
      "auto_sleep_minutes": 123,
      "low_battery_threshold_percent": 123
    }
  }
}
'
{
  "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": {
    "upload": {
      "mode": "wifi_only",
      "streaming_enabled": true,
      "upload_delay_minutes": 5,
      "daily_data_limit_mb": 500,
      "allow_roaming": false,
      "pause_on_low_battery": true
    },
    "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": {
      "upload": {
        "mode": "wifi_only"
      }
    }
  }'

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": {
    "upload": {
      "mode": "wifi_only",
      "streaming_enabled": true,
      "upload_delay_minutes": 5,
      "daily_data_limit_mb": 500,
      "allow_roaming": false,
      "pause_on_low_battery": true
    },
    "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"
}

Examples

Update Upload Mode 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": {"upload": {"mode": "4g_preferred"}}}'

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": {
      "upload": {
        "mode": "wifi_only",
        "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.