Index YouTube video transcripts into a collection.
Fetches transcripts from YouTube videos using auto-generated or manual captions,
formats them with inline timestamps, and indexes the text for semantic search.
Accepts either a single `url` string or a `urls` array of strings.
Transcripts are always processed as basic text (no OCR needed).
Headers:
- Authorization: Bearer {api_key} - Captain API key for authentication
- X-Organization-ID: Organization UUID
- Idempotency-Key: UUID for request deduplication (optional)
Args:
collection_name: Name of the collection (path parameter)
body: YouTube configuration with url or urls and optional language preferences
Returns:
{ job_id, status: "pending" }
Request
This endpoint expects an object.
custom_metadatamap from strings to strings or integers or doubles or booleans or lists of strings or nullOptional
Custom metadata to attach to all indexed chunks. Keys must be strings. Values: str, int, float, bool, or List[str].
languageslist of strings or nullOptional
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.
urlstring or nullOptional
A single YouTube video URL (youtube.com/watch?v=, youtu.be/, youtube.com/shorts/). Provide either ‘url’ or ‘urls’, not both.
urlslist of strings or nullOptional
A list of YouTube video URLs to index. Provide either 'url' or 'urls', not both.
mask_piibooleanOptionalDefaults to false
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.
Response
Successful Response
statusstringOptionalDefaults to pending