02 / Endpoints
Captions
Save captions (commit)
API key requiredPUT/api/enterprise/v1/generated-videos/{videoId}/captions
Saves reviewed or edited captions to the video.
- Each
clips[].indexin the body must match the video'sVideoClip.indexone to one. - A mismatch or a malformed body returns
INVALID_CAPTION_PAYLOAD(400). - Each clip's
captionWords/captionWordGroupsare updated inside a single transaction.
Path parameters
| Field | Type | Required | Description |
|---|---|---|---|
| videoId | string | Required | Generated short video IDExample: gsv_001 |
Request bodyCaptionsSaveRequest
| Field | Type | Required | Description |
|---|---|---|---|
| clips[] | CaptionClipPreview[] | Required | Clips to save. Each index must match the video's VideoClip.index one to one, and duplicate indexes are not allowed. |
| index | number | Required | Matches VideoClip.index |
| segmentId | string | Required | |
| captionWords[] | CaptionWord[] | Required | |
| index | integer | Required | Word index within that timelineExample: 0 |
| text | string | Required | Caption wordExample: hello |
| start | number | Required | Start time on the timeline (ms). In source this is the source longform timeline; in generatedVideos it is the generated short's timeline.Example: 1200 |
| end | number | Required | End time on the timeline (ms). In source this is the source longform timeline; in generatedVideos it is the generated short's timeline.Example: 1450 |
| metadata | object | Optional | Internal caption metadata |
| captionWordGroups[] | CaptionWordGroup[] | Required | |
| index | integer | Required | word group indexExample: 0 |
| indexes[] | integer[] | Required | Indexes of the words in this groupExample: [0,1,2] |
Request example
{
"clips": [
{
"index": 0,
"segmentId": "string",
"captionWords": [
{
"index": 0,
"text": "hello",
"start": 1200,
"end": 1450
}
],
"captionWordGroups": [
{
"index": 0,
"indexes": [
0,
1,
2
]
}
]
}
]
}Responses
| Status | Meaning |
|---|---|
| 200 | Captions savedCaptionsSaveResponse |
| 400 | Malformed body / clip index mismatchErrorResponse |
| 401 | Authentication failedErrorResponse |
| 404 | Video not foundErrorResponse |
Responses 200CaptionsSaveResponse
| Field | Type | Required | Description |
|---|---|---|---|
| requestId | string | Required | |
| video | object | Required | |
| id | string | Required | |
| updatedClipCount | number | Required | Number of clips saved |
| updatedAt | string | Required | Saved at (ISO 8601) |
Response example
{
"requestId": "string",
"video": {
"id": "string"
},
"updatedClipCount": 0,
"updatedAt": "string"
}


