Report device health status including battery level, storage usage, and signal strength. Health data is stored on the device record and returned in Get Device and List Devices responses.
Authentication
This endpoint accepts two authentication methods depending on the device connectivity:
Path Auth Use case 4G/WiFi direct Device token Device reports its own status directly BLE relay API key Developer’s backend relays status read from device over BLE
BLE relay (API key)
4G direct (device token)
Node.js (BLE relay)
curl -X POST https://api.bota.dev/v1/devices/dev_abc123/heartbeat \
-H "Authorization: Bearer sk_live_..." \
-H "Content-Type: application/json" \
-d '{
"battery_percent": 85,
"storage_used_mb": 512,
"storage_total_mb": 32768,
"device_state": "idle",
"pending_recordings": 3,
"connection_type": ["ble"]
}'
Path Parameters
The device’s unique identifier (e.g., dev_abc123), or me when using a device token. The me alias resolves to the device ID associated with the token, so the device doesn’t need to know its own Bota ID. When using an explicit device ID with a device token, it must match the token’s device.
Request Body
All fields are optional — send only the metrics your device can report.
Current battery level (0-100).
Storage used in megabytes.
Total storage capacity in megabytes.
Cellular signal strength in dBm (typically -50 to -120, where higher/less negative is better).
Current firmware version string (max 32 characters).
Device name (max 64 characters). Updated in the device record when provided.
Current device operational state (max 32 characters). One of: idle, recording, syncing, uploading, charging, lowBattery, storageFull, error.
Number of recordings on the device pending sync/upload.
Device status flags as a 1-byte bitmask (0-255). Bit 0: charging, Bit 1: low battery, Bit 2: storage full, Bit 3: WiFi connected, Bit 4: LTE connected, Bit 5: sync active.
Active device connections. Array of: wifi, 4g, ble.
Response
Returns { "status": "ok" } on success.
Response Fields
Field Type Description statusstring ok on success
Recommended Heartbeat Interval
Scenario Interval Normal operation Every 15-30 minutes Low battery (< 20%) Every 5 minutes Charging Every 30-60 minutes Poor signal (< -100 dBm) Every 5-10 minutes
Field Constraints
Field Type Range battery_percentinteger 0-100 storage_used_mbinteger >= 0 storage_total_mbinteger >= 0 signal_strength_dbminteger <= 0 (typically -50 to -120) firmware_versionstring max 32 characters device_namestring max 64 characters device_statestring max 32 characters pending_recordingsinteger >= 0 flagsinteger 0-255 connection_typestring[] Array of wifi, 4g, ble