Upload captions
Add a caption or subtitle track to a video from WebVTT or SRT text.
POST https://cotlet.dev/api/v1/vimeo/videos/{video_id}/captions
write Confirm
Uploads the file as a text track with the language and type you set, then switches it on. WebVTT must start with WEBVTT and SRT with the first cue number; both must be UTF-8. A file in another format is refused with the reason. Viewers see the track at once. By default you confirm each call; you can switch that off for this tool.
Parameters
| Name | Type | Description |
|---|---|---|
| video_id string required | string | Video ID from search_videos, the number in vimeo.com/{id}. |
| language string required | string | Language code, for example 'en' or 'es'. |
| type enum required | enum | caption or subtitle. |
| content string required | string | The full WebVTT or SRT text. |
Request
curl -X POST https://cotlet.dev/api/v1/vimeo/videos/912345601/captions \
-H "Authorization: Bearer $COTLET_API_KEY" \
-H "Content-Type: application/json" \
-d '{"language":"en","type":"caption","content":"WEBVTT\n\n00:00:00.000 --> 00:00:03.500\nWelcome to the onboarding series.\n"}' result = client.call("vimeo", "upload_captions", {"video_id":"912345601","language":"en","type":"caption","content":"WEBVTT\n\n00:00:00.000 --> 00:00:03.500\nWelcome to the onboarding series.\n"}) const result = await cotlet.call('vimeo', 'upload_captions', {"video_id":"912345601","language":"en","type":"caption","content":"WEBVTT\n\n00:00:00.000 --> 00:00:03.500\nWelcome to the onboarding series.\n"}); cotlet call vimeo upload_captions --data '{"video_id":"912345601","language":"en","type":"caption","content":"WEBVTT\n\n00:00:00.000 --> 00:00:03.500\nWelcome to the onboarding series.\n"}' Example response
{
"video_id": "912345601",
"language": "en",
"type": "caption",
"format": "webvtt",
"active": true
}