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

# Save media with Vault+

> Load Vault media faster and find saved files and thumbnails by ID.

Vault+ is an optional feature that makes the OnlyFans Vault easier to use in your app. Use it to load media faster and find saved files by their OnlyFans media ID.

* **Faster loading:** Load saved files and thumbnails for galleries, inboxes, and content planners.
* **Lookup by ID:** Find saved media even when it is not attached to a post, message, or story. OnlyFans does not offer a general lookup by media ID for these unattached files.
* **Less URL handling:** Show saved media without keeping track of expiring OnlyFans URLs or finding the post, message, or story that contains it.

For example, save media from a Vault list, keep the media IDs in your app, and use those IDs to show thumbnails in your content picker. The media does not need to be published or sent first.

Vault+ works with media you have added or synced. Check that the files are stored before using them. You can also [display media](https://docs.ofauth.com/v3/guides/display-media.md) from URLs returned by Access without using Vault+.

For protected video, follow [Retain DRM video in Vault+](https://docs.ofauth.com/v3/guides/vault-plus-drm.md). Playback uses a DRM player and a current license.

## Before you start

Enable Vault+ for the environment in your integration's dashboard settings. Select a linked account the user shared with your app. Request `vault:write` to save or delete copies and `vault:read` to read them. These scopes are the permissions your app needs.

Install the [TypeScript SDK](https://docs.ofauth.com/v3/sdk/typescript.md) version 4. Create a client and enable Vault+ for the account through its [settings](https://docs.ofauth.com/v3/api-reference/account/linked-accounts.md#linked-account-settings):

```typescript theme={null}
import { OFAuthClient } from "@ofauth/onlyfans-sdk"

const client = new OFAuthClient({
	accessToken: process.env.ACCESS_TOKEN!,
	linkedAccountId: process.env.LINKED_ACCOUNT_ID!
})

await client.linkedAccounts.settings.update({
	id: process.env.LINKED_ACCOUNT_ID!,
	body: { vault_plus: { enabled: true } }
})
```

Sandbox accounts already have Vault+ enabled. Their settings cannot be changed. If the environment setting is off, requests return `vault_plus_disabled`. If the account setting is off, add and sync return `linked_account_vault_plus_disabled`.

## Choose add or sync

Use **add** to save missing files and keep all existing copies. Use **sync** to make your saved copies match later changes to a Vault list.

![Add missing media to retain copies without removing older ones. Sync a list when later list changes should update retained media. The first sync makes no removals.](https://mintcdn.com/ofauth/VVqOdSxbrh7mDF0M/images/v3/retain-or-sync.svg?fit=max\&auto=format\&n=VVqOdSxbrh7mDF0M\&q=85\&s=d6366b0b58fa936c99e106bb90ff622a)

Later syncs keep media that another list for the same account still needs. Neither operation deletes the original OnlyFans content.

## Save files from a Vault list

Use a list ID from the account’s [Vault lists](https://docs.ofauth.com/v3/guides/media.md). Replace `101` with your list ID:

```typescript theme={null}
await client.vaultPlus.lists.add({ listId: 101 })
```

OFAuth starts saving missing media and keeps the copies you already have. The add request does not change which files a later sync can remove. Check [Vault+ status](https://docs.ofauth.com/v3/api-reference/vault+/read-vault+-status.md) to see when the files are stored.

## Keep a list in sync

To update saved copies when a list changes, call:

```typescript theme={null}
const result = await client.vaultPlus.lists.sync({ listId: 101 })
```

The first sync removes nothing. Later syncs remove files that were in the list during the last sync but have since left it. A file stays if another list for the account still needs it. Changed files are updated automatically.

A successful response includes counts such as these:

```json theme={null}
{
  "synced": true,
  "listId": "123",
  "seen": 42,
  "addedItems": 2,
  "updatedItems": 1,
  "removedItems": 4,
  "unchangedItems": 35,
  "adoptedItems": 0
}
```

`adoptedItems` counts files you already saved that this list’s sync now tracks for the first time. Use [the sync reference](https://docs.ofauth.com/v3/api-reference/vault+/sync-vault+-list-media.md) for the full response.

## Read saved media

```typescript theme={null}
const media = await client.vaultPlus.media.list({
	status: "stored",
	type: "image",
	limit: 50
})
```

Once a file is stored, read it with `client.vaultPlus.media.get({ mediaId: 789 })`. You do not need a post, message, or story ID. Each item can have several versions, such as `full`, `thumb`, and `720`. Use `thumb` to show a thumbnail in your platform. To read several items, call `client.vaultPlus.media.batch({ body: { mediaIds: [789, 790] } })`. The response leaves out IDs it cannot find.

The [query reference](https://docs.ofauth.com/v3/api-reference/vault+/query-vault+-media.md) lists the filters for status, type, date, duration, sort order, and result pages. Vault+ type filters use `image`, `video`, and `audio`.

`/status` reports status for the selected account. `/stats` reports all accounts shared with your integration in the selected environment. Keep these totals separate in reports.

## Delete retained media

Call `client.vaultPlus.media.delete({ mediaId: 789 })` to delete one saved item. To delete all saved media for the selected account, call `client.vaultPlus.media.deleteAll()`. Both calls require `vault:write`.

Deleting retained media does not delete the original OnlyFans post or message. To delete the original content, use the Access request for that post or message.

Next, [display media](https://docs.ofauth.com/v3/guides/display-media.md) or read the [Vault+ query reference](https://docs.ofauth.com/v3/api-reference/vault+/query-vault+-media.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.