> ## 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.

# Vault+

> Persistent media cache on V3 with bearer tokens and linked account ids

Vault+ stores OnlyFans vault media so it stays available after a session expires. On V3 it lives under `/v3/vault-plus` and uses the same authentication as Access.

## Headers and scopes

| Header | Value |
| - | - |
| `Authorization` | `Bearer <access_token>` |
| `x-linked-account-id` | A linked account id of this authorization. Required on every route. |

| Scope | Routes |
| - | - |
| `vault:read` | `GET` routes and `POST /v3/vault-plus/media/batch`. |
| `vault:write` | `POST /lists/:listId/add`, `PUT /lists/:listId/sync`, and `DELETE` routes. |

Request these scopes in the [authorization request](/v3/authorize).

## Turning Vault+ on

Vault+ is on or off at two levels:

| Level | How | Error when off |
| - | - | - |
| Environment | Your organization's Vault+ setting for the environment. | `403` `vault_plus_disabled` on every route. |
| Linked account | [`PATCH /v3/linked-accounts/{id}/settings`](/v3/linked-accounts#linked-account-settings) with `{ "vault_plus": { "enabled": true } }`. Needs `vault:write` on the account. | `403` `linked_account_vault_plus_disabled` on `add` and `sync`, which retain new media. |

Sandbox accounts always have Vault+ on.

## Media ids

Routes use the raw OnlyFans media id, for example `4492994399`, not a variant id such as `4492994399_720`. Media objects group cached variants by label (`full`, `thumb`, `720`).

## Routes

| Method | Route | Purpose |
| - | - | - |
| `GET` | `/v3/vault-plus/lists` | Cached vault-list summaries for the linked account. |
| `GET` | `/v3/vault-plus/lists/:listId/media` | Cached media membership for one list. |
| `POST` | `/v3/vault-plus/lists/:listId/add` | Cache new media from the current OnlyFans list. Never deletes. |
| `PUT` | `/v3/vault-plus/lists/:listId/sync` | Make the cache match the current OnlyFans list. Removes media that left the list since the last sync baseline. |
| `GET` | `/v3/vault-plus/media` | Query cached media. |
| `GET` | `/v3/vault-plus/media/:mediaId` | One cached media item with all variants. |
| `POST` | `/v3/vault-plus/media/batch` | Several cached media items. Body: `{ "mediaIds": [] }`. Unknown ids are omitted. |
| `DELETE` | `/v3/vault-plus/media/:mediaId` | Delete one cached item. |
| `DELETE` | `/v3/vault-plus/media` | Delete all cached media for the linked account. |
| `GET` | `/v3/vault-plus/status` | Cache status for the linked account. |
| `GET` | `/v3/vault-plus/stats` | Aggregate stats for your integration in this environment, across every linked account shared with it. |

Request and response shapes match the V2 Vault+ API. Only the base path and authentication change.

## Examples

<CodeGroup>
  ```bash curl theme={null}
  # Sync a list
  curl -X PUT https://api.ofauth.com/v3/vault-plus/lists/123/sync \
    -H "Authorization: Bearer $ACCESS_TOKEN" \
    -H "x-linked-account-id: conn_example123"

  # Query stored videos
  curl "https://api.ofauth.com/v3/vault-plus/media?status=stored&type=video&limit=50" \
    -H "Authorization: Bearer $ACCESS_TOKEN" \
    -H "x-linked-account-id: conn_example123"
  ```

  ```javascript Node.js theme={null}
  const result = await fetch("https://api.ofauth.com/v3/vault-plus/lists/123/sync", {
    method: "PUT",
    headers: {
      authorization: `Bearer ${accessToken}`,
      "x-linked-account-id": linkedAccountId
    }
  }).then((r) => r.json())
  // { synced: true, listId: "123", seen: 42, addedItems: 2, updatedItems: 1,
  //   removedItems: 4, unchangedItems: 35, adoptedItems: 0 }
  ```
</CodeGroup>

### Query parameters for `GET /v3/vault-plus/media`

| Parameter | Notes |
| - | - |
| `status` | `edge_only`, `pending`, `storing`, `stored`, or `removed`. |
| `type` | `image`, `video`, or `audio`. |
| `contentType` | Exact cached variant content type. |
| `durationMin`, `durationMax` | Duration bounds. |
| `createdAtFrom`, `createdAtTo` | Creation date bounds. |
| `cachedAtFrom`, `cachedAtTo` | Cache date bounds. |
| `limit` | `1` to `100`. |
| `cursor` | Cursor from the previous response. |
| `sort` | `createdAt_desc`, `createdAt_asc`, `cachedAt_desc`, `cachedAt_asc`, `duration_desc`, or `duration_asc`. |

## Sync semantics

* The first sync creates a baseline and removes nothing.
* Later syncs remove only media that was in the previous baseline and is missing now.
* Media still owned by another cached list for the same linked account is not purged.
* Changed media fingerprints cause purge and re-cache.

Errors use the [V3 error envelope](/v3/errors).


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