---
title: "BlobDB endpoint"
canonical_url: https://developer.repebble.com/pebbleos/docs/reference/blob-db/
last_updated: 2026-11-22
sdk_version: 4.44
---
# BlobDB endpoint

Source: https://developer.repebble.com/pebbleos/docs/reference/blob-db/

BlobDB is the key-value store the phone uses to push data to the watch (notifications, timeline pins, app metadata, weather, settings, …). Two Pebble Protocol endpoints speak it: `0xb1db` for phone-initiated writes (`pebble/services/blob_db/endpoint.c`) and `0xb2db` for watch-initiated sync (`pebble/services/blob_db/endpoint2.c`). Command opcodes and response codes are in `include/pbl/services/blob_db/endpoint_private.h`, database ids in `include/pbl/services/blob_db/api.h`. All multi-byte fields are little-endian.

## Commands (endpoint `0xb1db`)

Every message starts with a `uint8_t` command and a `uint16_t` token the watch echoes in its response. Keys and values are length-prefixed: `uint8_t key_size` + key bytes, `uint16_t value_size` + value bytes.

| 

Command

 | 

Opcode

 | 

Body after token

 |
| --- | --- | --- |
| 

INSERT

 | 

`0x01`

 | 

database id (`uint8_t`), key, value

 |
| 

DELETE

 | 

`0x04`

 | 

database id, key

 |
| 

CLEAR

 | 

`0x05`

 | 

database id — drops all entries

 |
| 

INSERT\_WITH\_TIMESTAMP

 | 

`0x0D`

 | 

database id, `uint32_t` timestamp, key, value

 |

`0x02` (READ) and `0x03` (UPDATE) are defined but not implemented. INSERT\_WITH\_TIMESTAMP is for conflict resolution: if the watch’s copy is newer, it answers DATA\_STALE and the phone should re-sync. The timestamp is currently only honored for the Settings database; other databases treat it as a plain INSERT.

The watch responds to every command with `uint16_t token` + `uint8_t response code`:

| 

Code

 | 

Meaning

 |
| --- | --- |
| 

`0x01`

 | 

SUCCESS

 |
| 

`0x02`

 | 

GENERAL\_FAILURE

 |
| 

`0x03`

 | 

INVALID\_OPERATION

 |
| 

`0x04`

 | 

INVALID\_DATABASE\_ID

 |
| 

`0x05`

 | 

INVALID\_DATA

 |
| 

`0x06`

 | 

KEY\_DOES\_NOT\_EXIST

 |
| 

`0x07`

 | 

DATABASE\_FULL

 |
| 

`0x08`

 | 

DATA\_STALE

 |
| 

`0x09`

 | 

DB\_NOT\_SUPPORTED

 |
| 

`0x0A`

 | 

DB\_LOCKED

 |
| 

`0x0B`

 | 

TRY\_LATER (endpoint not accepting writes yet)

 |

## Sync commands (endpoint `0xb2db`)

Opcodes `0x06`–`0x0C` (DIRTY\_DBS, START\_SYNC, WRITE, WRITEBACK, SYNC\_DONE, VERSION, DIRTY\_ALL) implement watch→phone writeback of dirty records; responses to these set bit 7 of the opcode. VERSION reports the protocol version (currently 1). Message layouts are the packed structs in `endpoint2.c`.

## Database ids

| 

Id

 | 

Database

 | 

Id

 | 

Database

 |
| --- | --- | --- | --- |
| 

`0x00`

 | 

Test

 | 

`0x07`

 | 

Prefs

 |
| 

`0x01`

 | 

Pins

 | 

`0x08`

 | 

Contacts

 |
| 

`0x02`

 | 

Apps

 | 

`0x09`

 | 

WatchAppPrefs

 |
| 

`0x03`

 | 

Reminders

 | 

`0x0A`

 | 

Health

 |
| 

`0x04`

 | 

Notifs

 | 

`0x0B`

 | 

AppGlance

 |
| 

`0x05`

 | 

Weather

 | 

`0x0C`

 | 

Settings

 |
| 

`0x06`

 | 

iOSNotifPref

 | 

 | 

 |

New databases register a `BlobDBId` and an entry in `s_blob_dbs` in `pebble/services/blob_db/api.c`.

## App permissions

Firmware with capability bit 27 (`app_permissions_support`) accepts an optional little-endian `uint32_t` permissions field appended to existing AppDB metadata. The watch keeps it in a separate record keyed by the app UUID. Only the extended form sets or clears it; legacy-size metadata leaves it unchanged. The watch trusts the companion to set it only from its own consent UI, see the Trust section of [Local microphone capture](https://developer.repebble.com/pebbleos/docs/reference/local-microphone.md).

| 

Bit

 | 

Permission

 |
| --- | --- |
| 

0

 | 

Microphone, see [Local microphone capture](https://developer.repebble.com/pebbleos/docs/reference/local-microphone.md)

 |

Generated from PebbleOS [5285d4236](https://github.com/coredevices/pebbleos/commit/5285d423600370a73ae94b619748a69933107797). This page is maintained in the pebbleos repository: [docs/reference/blob-db.md](https://github.com/coredevices/pebbleos/blob/5285d423600370a73ae94b619748a69933107797/docs/reference/blob-db.md).
