> ## Documentation Index
> Fetch the complete documentation index at: https://bluebubbles.anmho.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Backups API reference — BlueBubbles SDK

> Save, retrieve, and delete settings and theme backups stored on your BlueBubbles Server. Sync client configuration across devices.

The backups service lets you store and retrieve arbitrary configuration data on the BlueBubbles Server. It exposes two independent backup categories: **settings** and **themes**. You define the shape of the data — the server stores it by name and returns it on demand. This is useful for syncing client app configuration across multiple devices without needing your own storage backend.

Access the service through `client.backups`.

***

## Settings backups

### `getSettings()`

Returns all settings backups saved to the BlueBubbles Server.

**Signature**

```typescript theme={null}
client.backups.getSettings(): CancelablePromise<any>
```

**Example**

```typescript theme={null}
const settings = await client.backups.getSettings();

for (const backup of settings.data) {
  console.log(backup.name, backup.data);
}
```

***

### `saveSettings()`

Saves a settings configuration to the server under a given name. The `name` and `data` fields are required. The structure of `data` is up to your client — the server stores it as-is.

**Signature**

```typescript theme={null}
client.backups.saveSettings({
  requestBody,
}: {
  requestBody?: Record<string, any>;
}): CancelablePromise<any>
```

**Request body parameters**

<ParamField body="name" type="string" required>
  A unique display name for this settings backup. Recommended format:
  `"SettingsBackup - YYYY/MM/DD"`.
</ParamField>

<ParamField body="data" type="object" required>
  Your client's configuration data as a plain object. The server does not
  validate the shape — any JSON-serializable object is accepted.
</ParamField>

**Example**

```typescript theme={null}
await client.backups.saveSettings({
  requestBody: {
    name: "SettingsBackup - 2024/03/15",
    data: {
      theme: "dark",
      notifications: true,
      messagePreview: false,
    },
  },
});
```

<Note>
  If you save a backup with a name that already exists, the server will
  overwrite the previous entry. Use distinct names (e.g., date-stamped) to
  retain multiple snapshots.
</Note>

***

### `deleteSettings()`

Deletes a settings backup by name.

**Signature**

```typescript theme={null}
client.backups.deleteSettings(): CancelablePromise<any>
```

**Example**

```typescript theme={null}
await client.backups.deleteSettings();
```

<Warning>
  Deletion is permanent. Retrieve the backup with `getSettings()` and confirm
  the name before calling this method.
</Warning>

***

## Theme backups

### `getThemes()`

Returns all theme backups saved to the BlueBubbles Server.

**Signature**

```typescript theme={null}
client.backups.getThemes(): CancelablePromise<any>
```

**Example**

```typescript theme={null}
const themes = await client.backups.getThemes();

for (const theme of themes.data) {
  console.log(theme.name);
}
```

***

### `saveTheme()`

Saves a theme configuration to the server under a given name. Like settings backups, the `name` and `data` fields are required and the shape of `data` is defined by your client.

**Signature**

```typescript theme={null}
client.backups.saveTheme({
  requestBody,
}: {
  requestBody?: Record<string, any>;
}): CancelablePromise<any>
```

**Request body parameters**

<ParamField body="name" type="string" required>
  A unique display name for this theme. Example: `"OLED Dark"`.
</ParamField>

<ParamField body="data" type="object" required>
  Your theme's configuration as a plain object. Include whatever color, font,
  and layout values your client understands.
</ParamField>

**Example**

```typescript theme={null}
await client.backups.saveTheme({
  requestBody: {
    name: "OLED Dark",
    data: {
      background: "#000000",
      surface: "#0a0a0a",
      primary: "#1a73e8",
      text: "#ffffff",
      bubbleOutgoing: "#1a73e8",
      bubbleIncoming: "#1c1c1e",
    },
  },
});
```

***

### `deleteTheme()`

Deletes a theme backup by name.

**Signature**

```typescript theme={null}
client.backups.deleteTheme(): CancelablePromise<any>
```

**Example**

```typescript theme={null}
await client.backups.deleteTheme();
```

<Tip>
  Use `getThemes()` to list available theme names before deciding which one to
  delete.
</Tip>
