02 / エンドポイント
Captions
字幕の保存 (commit)
API キーが必要PUT/api/enterprise/v1/generated-videos/{videoId}/captions
確認・編集を終えた字幕を動画に保存します。
- Body の各
clips[].indexは、動画のVideoClip.indexと 1 対 1 で一致する必要があります。 - 一致しない場合や形式が誤っている場合は
INVALID_CAPTION_PAYLOAD(400)。 - 1 つのトランザクション内で、各 clip の
captionWords/captionWordGroupsを更新します。
パスパラメータ
| フィールド | 型 | 必須 | 説明 |
|---|---|---|---|
| videoId | string | 必須 | 生成ショート動画 ID例: gsv_001 |
リクエストボディCaptionsSaveRequest
| フィールド | 型 | 必須 | 説明 |
|---|---|---|---|
| clips[] | CaptionClipPreview[] | 必須 | 保存する clip 配列。各 index は動画の VideoClip.index と 1 対 1 で一致する必要があり、index の重複は許可されません。 |
| index | number | 必須 | VideoClip.index と一致 |
| segmentId | string | 必須 | |
| captionWords[] | CaptionWord[] | 必須 | |
| index | integer | 必須 | そのタイムライン内の単語 index例: 0 |
| text | string | 必須 | 字幕の単語例: hello |
| start | number | 必須 | タイムライン基準の開始時刻 (ms)。source では元の Longform 基準、generatedVideos では生成ショート基準です。例: 1200 |
| end | number | 必須 | タイムライン基準の終了時刻 (ms)。source では元の Longform 基準、generatedVideos では生成ショート基準です。例: 1450 |
| metadata | object | 任意 | 内部の字幕メタデータ |
| captionWordGroups[] | CaptionWordGroup[] | 必須 | |
| index | integer | 必須 | word group index例: 0 |
| indexes[] | integer[] | 必須 | グループに含まれる単語の indexes例: [0,1,2] |
リクエスト例
{
"clips": [
{
"index": 0,
"segmentId": "string",
"captionWords": [
{
"index": 0,
"text": "hello",
"start": 1200,
"end": 1450
}
],
"captionWordGroups": [
{
"index": 0,
"indexes": [
0,
1,
2
]
}
]
}
]
}レスポンス
| ステータス | 意味 |
|---|---|
| 200 | 字幕の保存に成功CaptionsSaveResponse |
| 400 | 本文が不正 / clip index の不一致ErrorResponse |
| 401 | 認証に失敗ErrorResponse |
| 404 | 動画が見つかりませんErrorResponse |
レスポンス 200CaptionsSaveResponse
| フィールド | 型 | 必須 | 説明 |
|---|---|---|---|
| requestId | string | 必須 | |
| video | object | 必須 | |
| id | string | 必須 | |
| updatedClipCount | number | 必須 | 保存された clip 数 |
| updatedAt | string | 必須 | 保存日時 (ISO 8601) |
レスポンス例
{
"requestId": "string",
"video": {
"id": "string"
},
"updatedClipCount": 0,
"updatedAt": "string"
}


