Index YouTube
Path parameters
Headers
Request
Custom metadata to attach to all indexed chunks. Keys must be strings. Values: str, int, float, bool, or List[str].
Preferred transcript languages in priority order (ISO 639-1 codes). Defaults to English. Only specify if you need a non-English transcript (e.g., [‘fr’, ‘de’]). Falls back to auto-generated captions if manual transcript unavailable.
A single YouTube video URL (youtube.com/watch?v=, youtu.be/, youtube.com/shorts/). Provide either ‘url’ or ‘urls’, not both.
When true, detected PII (emails, phone numbers, SSNs, credit cards, names, and locations) is masked in the parsed content before it is embedded and stored — replaced with entity tags like <PERSON> and <EMAIL_ADDRESS>. For images (including images embedded in PDFs), PII text visible in the image is also pixel-redacted. Opt-in; defaults to false, which leaves content unchanged.
Masking engine for this job. kev (default): the Kev classifier model on Captain’s infrastructure; supports pii_fields and pii_instructions; no fallback, so a file kev cannot mask fails to index and the rest of the job continues. jev: TypeSafe’s hosted Jev model, slightly more accurate, best-effort availability; supports custom fields and instructions and may list fallbacks in pii_fallback. presidio: the legacy pattern engine, built-in categories only (rejects pii_fields or pii_instructions with 422), never a fallback. Requires mask_pii: true. The earlier names captain-jev and captain-presidio keep working as before; new requests should use kev, jev or presidio.
Ordered fallback engines for jev, as {"engines": [...], "retry_budget_seconds": n}. Omitted or an empty engines list means no fallback. Only valid with pii_engine: "jev"; with kev or presidio a non-empty list answers 422. On the multipart file upload endpoint, send it as a JSON string form field. With the earlier engine name captain-jev it is true (default, fall back to captain-presidio) or false.
Additional PII categories to mask for this job, on top of the built-in set. Requires mask_pii to be true. Up to 20 fields. Each masked value is replaced with the field’s tag in angle brackets and appears in the masking report under the field’s name.
Plain-language guidance that steers what counts as personal data for this job, for the built-in categories and any pii_fields. For example: ‘Names of hospital staff may stay; patient names, record numbers and bed assignments must be masked.’ Requires mask_pii to be true. Up to 1,000 characters.
How to index each video. ‘transcript’ (default): fetch the caption track and index it as text, billed as basic text pages. ‘audio’: pull the audio track through the multimodal audio pipeline, billed at 5 credits per audio minute. ‘video’: pull the video (frame descriptions plus transcription) through the multimodal video pipeline, billed at 20 credits per video minute. Media modes cost orders of magnitude more than transcript mode for the same video; the default is transcript and will not change.
Only applies when mode=‘transcript’. What to do for a video whose captions are disabled or absent. ‘fail’ (default): that video fails. ‘audio’ / ‘video’: fall back to indexing that video through the corresponding media pipeline instead, billed at media rates. Any fallback is recorded per video in the job’s youtube record (mode_used, fell_back_from) so the billing change is visible. Setting this together with a media mode is rejected with a validation error.
Response
The custom_metadata Captain accepted for this job, echoed back as validated. Null when none was supplied.