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

# Retain DRM video in Vault+

> Save protected video and play it with a DRM player.

Vault+ retains protected video as encrypted media. Playback uses the same [DRM player integration](https://docs.ofauth.com/v3/guides/drm-playback.md) as Access, with a fresh license from the linked account. Retention does not produce a decrypted MP4 or an offline license.

## 1. Enable retention

Follow [Vault+ setup](https://docs.ofauth.com/v3/guides/media-storage.md#before-you-start) for your integration environment and linked account. Enable video caching and choose qualities included in your plan.

Use `vault:write` for list add, list sync, and deletion. Use `vault:read` to retrieve retained items. Protected playback requires a Live linked account that still has access to the provider media.

## 2. Request retention

Use the existing list workflow to retain DRM and ordinary media together:

```bash theme={null}
	curl -X POST 'https://api.ofauth.com/v3/vault-plus/lists/123/add' \
		-H "Authorization: Bearer $ACCESS_TOKEN" \
		-H "x-linked-account-id: $LINKED_ACCOUNT_ID"
```

Use `PUT /v3/vault-plus/lists/123/sync` for subsequent list synchronization. The existing [sync semantics](https://docs.ofauth.com/v3/guides/media-storage.md#keep-a-list-in-sync) govern removals and shared list ownership.

For one Access media item, use its optional `playback.retainUrl` from your backend:

```javascript theme={null}
	async function retainProtectedMedia(playback) {
		if (!playback.retainUrl) {
			throw new Error("This descriptor has no retention URL");
		}
		const response = await fetch(playback.retainUrl, { method: "POST" });
		if (!response.ok) {
			throw new Error(`Retention HTTP ${response.status}: ${await response.text()}`);
		}
		return response.json();
	}
```

The URL supplies authorization for the request, so no API bearer header is needed. A `202` response acknowledges the request; it does not mean the archive is stored. A successful developer manifest request also asks Vault+ to retain the media under its current storage policy.

## 3. Wait for a stored variant

Retrieve the item using its raw OnlyFans media ID:

```bash theme={null}
	curl 'https://api.ofauth.com/v3/vault-plus/media/42' \
		-H "Authorization: Bearer $ACCESS_TOKEN" \
		-H "x-linked-account-id: $LINKED_ACCOUNT_ID"
```

Inspect each variant in the response's `media` map. Use a variant whose `status` is `stored` and whose `playback` is present. Retry pending retention checks with bounded backoff.

For a protected variant, `contentType` is `application/dash+xml` and `url` is the DASH manifest URL. Pass the variant's complete `playback` descriptor to the player:

```javascript theme={null}
	const variant = Object.values(item.media).find(
		(value) => value.status === "stored" && value.playback
	);
	if (!variant) throw new Error("Protected media is not ready");

	player.configure({ drm: { servers: variant.playback.licenseServers } });
	await player.load(variant.playback.manifestUrl, undefined, variant.playback.mimeType);
```

Keep the full descriptor for [renewal](https://docs.ofauth.com/v3/guides/drm-playback.md#3-renew-without-losing-the-playback-position). Treat the variant's `url` as a manifest, not an ordinary downloadable video. Do not rely on an internal variant ID or a fixed quality label.

Stored protected video counts toward your Vault+ storage usage. Wait for `status: "stored"` before offering playback.

## 4. Handle expiry and deletion

Refresh the Vault+ response to obtain a new descriptor when its renewal URL expires. The stored video bytes do not depend on the original CDN credentials. Licensing still depends on the linked account's current session and access.

Delete by raw media ID to apply the existing purge rules to all of the item's variants:

```bash theme={null}
	curl -X DELETE 'https://api.ofauth.com/v3/vault-plus/media/42' \
		-H "Authorization: Bearer $ACCESS_TOKEN" \
		-H "x-linked-account-id: $LINKED_ACCOUNT_ID"
```

Account retention settings, access expiry, entitlement changes, and list ownership also govern the archive's lifecycle. Do not keep using an old descriptor after deletion or access denial. See [DRM support](https://docs.ofauth.com/v3/guides/drm-support.md) for playback limits and failure handling.


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