Apply commands
POST
https://api.vidmoat.com/v1/projects/{id}/commandsApply an ordered list of edit commands. This is the only way to change a timeline, and it is the same reducer the editor calls: anything you can do by hand you can do here.
Path parameters#
idstringrequiredThe project id.
Body#
commandsarray of objectsrequiredOne to 200 commands, applied in order. Each is an object with a stringopand that op's parameters, exactly as listed byGET /v1/schema/commands.dryRunbooleandefaultfalseRun the batch without saving and return what would happen.
Response#
Returns 200.
Response fields#
projectIdstringThe project.okbooleantrueonly when every command succeeded.dryRunbooleanWhether anything was saved.resultsarrayOne entry per command:{ op, ok, error?, data? }. A failed command is reported here, not as an HTTP error.verificationobjectWhat happened:accepted(count),failed([{ op, error }]),blocked,layoutwarnings, andoutcome(executed,needs-repairorblocked).blockedarray of stringsPlan-gated features that were dropped.lintarrayLayout warnings:{ severity: "warn" | "note", time, message }.suggestedPreviewTimesarray of numbersTimestamps worth looking at with the preview endpoint before you render.timelineobject{ clipCount, durationSec }after the batch.hintstringWhat to check next.
Errors#
Besides the errors any request can get (authentication, rate limits):
| Status | Code | When |
|---|---|---|
| 404 | not_found | No such project, or it is not yours. The two are indistinguishable on purpose. |
| 400 | invalid_request | commands is missing, empty, longer than 200, or an entry has no string op. |
| 409 | invalid_request | The project changed while the batch ran (conflictCode: "stale_rev", with rev) or is locked by an expert handoff (help_handoff_locked). Re-read the project and retry. |