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

# Video

> Upload, transcode, caption, and watermark video, then serve it with signed playback tokens.

The `video` group manages the full lifecycle of video: uploading source files, transcoding, captions, watermark profiles, and serving playback with short-lived signed tokens. It fits destination and product marketing video as well as gated content.

```ts theme={null}
import { createVoyantCloudClient } from "@voyant-travel/cloud-sdk";

const client = createVoyantCloudClient({ apiKey: process.env.VOYANT_API_KEY! });
```

## Upload

Create an upload to receive a one-time TUS upload endpoint, then upload the file bytes to that endpoint with a TUS client.

```ts theme={null}
declare const file: File;

const ticket = await client.video.videos.createUpload({
  name: "intro",
  fileSize: file.size,
  maxDurationSeconds: 600,
  tags: ["marketing", "launch"],
});

// ticket.uploadUrl is a one-time TUS endpoint.
// Upload the bytes with a TUS client such as tus-js-client,
// using uploadUrl: ticket.uploadUrl.
```

You can also create a video from a URL with `client.video.videos.createFromUrl(input)`.

## Captions and watermarks

```ts theme={null}
// List and upload captions for a video
const captions = await client.video.videos.captions.list(videoId);

// Manage watermark profiles
const watermarks = await client.video.watermarks.list();
```

## Signed playback

Mint a short-lived signed token to play protected video. The token resolves to playable HLS and DASH URLs.

```ts theme={null}
const signed = await client.video.videos.mintToken({ /* videoId, ... */ });
```

## Scopes

| Methods                                                                                    | Scope                    |
| ------------------------------------------------------------------------------------------ | ------------------------ |
| `videos.list`, `videos.get`, `videos.mintToken`, `videos.captions.list`, `watermarks.list` | `video:read`             |
| `videos.createUpload`, `videos.createFromUrl`, `videos.update`, `videos.enableDownload`    | `video:upload`           |
| `videos.delete`                                                                            | `video:delete`           |
| `videos.captions.upload`, `videos.captions.generate`, `videos.captions.delete`             | `video:captions:write`   |
| `watermarks.create`, `watermarks.delete`                                                   | `video:watermarks:write` |

Key types: `VideoSummary`, `VideoUploadTicket`, `VideoCaptionSummary`, `VideoWatermarkProfileSummary`, `VideoSignedToken`, `CreateVideoUploadInput`, `CreateVideoFromUrlInput`, `MintVideoSignedTokenInput`.
