PricingBlogEnterpriseAPI
Log inStart free
Log inStart free

02 / Endpoints

Captions

Save captions (commit)

API key required
PUT/api/enterprise/v1/generated-videos/{videoId}/captions

Saves reviewed or edited captions to the video.

  • Each clips[].index in the body must match the video's VideoClip.index one to one.
  • A mismatch or a malformed body returns INVALID_CAPTION_PAYLOAD(400).
  • Each clip's captionWords / captionWordGroups are updated inside a single transaction.

Path parameters

FieldTypeRequiredDescription
videoIdstringRequiredGenerated short video IDExample: gsv_001

Request bodyCaptionsSaveRequest

FieldTypeRequiredDescription
clips[]CaptionClipPreview[]RequiredClips to save. Each index must match the video's VideoClip.index one to one, and duplicate indexes are not allowed.
indexnumberRequiredMatches VideoClip.index
segmentIdstringRequired
captionWords[]CaptionWord[]Required
indexintegerRequiredWord index within that timelineExample: 0
textstringRequiredCaption wordExample: hello
startnumberRequiredStart time on the timeline (ms). In source this is the source longform timeline; in generatedVideos it is the generated short's timeline.Example: 1200
endnumberRequiredEnd time on the timeline (ms). In source this is the source longform timeline; in generatedVideos it is the generated short's timeline.Example: 1450
metadataobjectOptionalInternal caption metadata
captionWordGroups[]CaptionWordGroup[]Required
indexintegerRequiredword group indexExample: 0
indexes[]integer[]RequiredIndexes 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

StatusMeaning
200Captions savedCaptionsSaveResponse
400Malformed body / clip index mismatchErrorResponse
401Authentication failedErrorResponse
404Video not foundErrorResponse

Responses 200CaptionsSaveResponse

FieldTypeRequiredDescription
requestIdstringRequired
videoobjectRequired
idstringRequired
updatedClipCountnumberRequiredNumber of clips saved
updatedAtstringRequiredSaved at (ISO 8601)
Response example
{
  "requestId": "string",
  "video": {
    "id": "string"
  },
  "updatedClipCount": 0,
  "updatedAt": "string"
}