publ betaReference (MCP guide)
Open publ console

ott_episode_upload_apply

# ott_episode_upload_apply

Uploads one episode video as a new private episode, as the upload manager does in the OTT app (pApp C00002). The file goes from this computer to storage: measure the video on this computer first (duration, frame rate, width, height), as the console measures before upload, and start with upload local-file (filename, byteLength) plus those facts as video, so the console limits are checked before anything is sent; PUT the parts from the presigned URLs, then complete with the part ETags and the same facts. A Google Drive or other link is downloaded to this computer first. MP4, MOV or MKV up to 100 GB. Each answer includes the console upload screen. The episode joins a title with ott_titles_apply connect, as the console title screen does; encoding progress shows in ott_uploads_get and the console upload manager. Status/resume observe the original task; nothing is re-sent. Called without confirmToken it previews and returns a confirmToken; repeating the same input with it executes once.

## Inputs

| Field | Required here | Contract |
| --- | --- | --- |
| `target` | No |  |
| `upload` | Yes | one of: `local-file`, `more-parts`, `complete`, `cancel` (by `kind`) |
| `upload.filename` | Yes | When `upload.kind` is `local-file`: string; min length 1; max length 240; pattern `^[^/\\:\x00-\x1f\x7f]+$`; The name of the file on this computer, with its extension. |
| `upload.byteLength` | Yes | When `upload.kind` is `local-file`: integer; greater than 0; The exact file size in bytes (for example from `wc -c < FILE` or `stat`). |
| `upload.sha256` | No | When `upload.kind` is `local-file`: string; pattern `^[0-9a-f]{64}$`; The SHA-256 of the file in lowercase hex (shasum -a 256 FILE). Required when the upload answers UPLOAD_CHECKSUM_REQUIRED. |
| `upload.uploadId` | Yes | When `upload.kind` is `more-parts`: string; pattern `^upl_[A-Za-z0-9_-]{22}$` |
| `upload.fromPart` | Yes | When `upload.kind` is `more-parts`: integer; minimum 1; maximum 10000 |
| `upload.uploadId` | Yes | When `upload.kind` is `complete`: string; pattern `^upl_[A-Za-z0-9_-]{22}$` |
| `upload.parts` | Yes | When `upload.kind` is `complete`: array; min items 1; max items 10000 |
| `upload.parts[].partNumber` | Yes | When `upload.kind` is `complete`: integer; minimum 1; maximum 10000 |
| `upload.parts[].etag` | Yes | When `upload.kind` is `complete`: string; min length 1; max length 200 |
| `upload.measured` | No | When `upload.kind` is `complete`: object; What the video measures on this computer, read with measureCommand. |
| `upload.measured.durationSeconds` | Yes | When `upload.kind` is `complete`: number; maximum 1000000; greater than 0; Video duration in seconds (ffprobe format.duration). |
| `upload.measured.frameRate` | Yes | When `upload.kind` is `complete`: number; maximum 1000; greater than 0; Frames per second (ffprobe avg_frame_rate, for example 30000/1001 = 29.97). |
| `upload.measured.width` | Yes | When `upload.kind` is `complete`: integer; maximum 100000; greater than 0 |
| `upload.measured.height` | Yes | When `upload.kind` is `complete`: integer; maximum 100000; greater than 0 |
| `upload.measured.frameRateMode` | No | When `upload.kind` is `complete`: `CFR`, `VFR`; Constant or variable frame rate, when the tool reports it. |
| `upload.measured.minFrameRate` | No | When `upload.kind` is `complete`: number; maximum 1000; greater than 0 |
| `upload.measured.maxFrameRate` | No | When `upload.kind` is `complete`: number; maximum 1000; greater than 0 |
| `upload.uploadId` | Yes | When `upload.kind` is `cancel`: string; pattern `^upl_[A-Za-z0-9_-]{22}$` |
| `video` | No | object |
| `video.durationSeconds` | Yes | number; maximum 1000000; greater than 0; Video duration in seconds (ffprobe format.duration). |
| `video.frameRate` | Yes | number; maximum 1000; greater than 0; Frames per second (ffprobe avg_frame_rate, for example 30000/1001 = 29.97). |
| `video.width` | Yes | integer; maximum 100000; greater than 0 |
| `video.height` | Yes | integer; maximum 100000; greater than 0 |
| `video.frameRateMode` | No | `CFR`, `VFR`; Constant or variable frame rate, when the tool reports it. |
| `video.minFrameRate` | No | number; maximum 1000; greater than 0 |
| `video.maxFrameRate` | No | number; maximum 1000; greater than 0 |
| `video.videoCodec` | No | string; min length 1; max length 40; OTT title trailer only: the video codec_name from ffprobe (h264). |
| `video.audioCodec` | No | string; min length 1; max length 40 or null; OTT title trailer only: the audio codec_name from ffprobe (aac), or null without audio. |
| `thumbnailImageTaskId` | No | string; pattern `^[A-Za-z0-9_-]{8,80}$`; Course only: a completed course-video-thumbnail task used as the video thumbnail. |
| `confirmToken` | No | string; pattern `^ct[a-f\d]{32}$`; The confirmToken from this tool's preview result. Omit it to preview; repeat the same input with it to execute. |