apply_video_edits
Useapply_video_edits whenever you need two or more timeline edits. It takes up to 200 mixed operations across any clips in one video, validates the whole request, and applies it as a single editor revision — substantially faster than repeated single-edit calls. For one edit, the standalone tool is still the convenient choice.
All times are milliseconds on the clip’s playback timeline — the video as watched, with cuts applied. It is the same timeline as
get_transcript, thumbnails, and previews, so nothing needs converting. A start at or past the end of the clip is rejected with a 400.string
required
Video ID
object[]
required
1–200 operations, run in array order. Each one carries
type, a unique operationId, a clipId, and the same fields as the standalone tool it mirrors.Supported operations
- Updates and removes take the target resource ID and the
clipId; updates also take only the fields being changed (includingtransitionon media and text overlays). - Zoom operations use
zoomTypefor the zoom variant, becausetypeselects the batch operation itself. - Cuts, transcript edits, clip settings, and
generate_auto_layoutsare not batchable.
How a batch runs
- Results match by
operationId. Adds return the created resource ID; updates and removes return the affected one. - Later operations can reference earlier adds. Pass an add’s
operationIdin place of the resource ID — for example, add a zoom and re-time it later in the same batch. - Validation is all-or-nothing. Schema, resource existence, timeline bounds, and cross-references are checked upfront. One invalid operation rejects the whole call with
invalid_argumentnaming that operation, before anything is applied. - Removed resources stay removed. Removing a resource that doesn’t exist (or was already removed) is an error, and later operations in the batch can no longer target it.
Layout operations
Layout operations
Layout operations accept the same B-roll
media field as add_layout and update_layout.- A time-ranged
add_layoutcan providemediaand omitlayoutto use the default full-frame B-roll layout. It trims, splits, or removes overlapping layouts to make room, exactly like the standalone call. update_layoutcan replace either media slot while keeping the other, and can reshape media-bearing layouts.- An add without a range sets the clip’s base layout and returns the ID
base.update_layoutacceptsbase(or theoperationIdof a clip-spanning add), but the base layout acceptslayoutonly.
Retrying a batch
- To resend safely after losing a response, include
_meta.idempotencyKeyand reuse the same key — see Retrying tool calls safely. - Otherwise, retry only when the previous call definitely did not apply, such as after a rate limit or a pre-execution
unavailableerror. - A
revisionin the response is proof the batch landed.