Update Text Tracks
Update texttracks object
Updating texttracks is done by sending a PATCH request to the /videos/:videoId/texttracks/:texttrackId endpoint with either an attached VTT file or by passing the VTT content as a string.
language, type, and content are all optional. A metadata-only body, for example { "type": "subtitles" }, is valid. language must be a supported locale that includes a region, such as en-US or de-DE. A language-only tag such as en is rejected with 400 { "error": "unsupported_language" }.
A missing text track returns 400.
Option 1: Provide VTT content as string
CURL
curl -X PATCH https://app.ignitevideo.cloud/api/videos/[VIDEO_ID]/texttracks/[TEXTTRACK_ID] \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"language": "en-US", "type": "captions", "content": "[VTT_CONTENT]"}'Option 2: Provide VTT file
Content-Type has to be multipart/form-data and not application/json. Send the file, and any language or type change, as part of the form data.
CURL
curl -X PATCH https://app.ignitevideo.cloud/api/videos/[VIDEO_ID]/texttracks/[TEXTTRACK_ID] \
-H "Authorization: Bearer YOUR_TOKEN" \
-F "language=en-US" \
-F "type=captions" \
-F "file=@[PATH_TO_VTT_FILE]"Response
The updated text track object. content in this response is a URL-encoded deprecated placeholder. Get the text track to read the WebVTT.
{
"id": string,
"language": "en-US" | "de-DE" | "fr-FR" | "es-ES" | "it-IT" | "...",
"type": "subtitles" | "captions",
"filename": string,
"url": string,
"content": string // URL-encoded placeholder, not the WebVTT
}