Documentation Index
Fetch the complete documentation index at: https://docs.knowlify.com/llms.txt
Use this file to discover all available pages before exploring further.
Overview
POST /v1/edits/{edit_id}/revert restores the planner snapshot saved before this edit was applied, rewinds the video clips and timestamps, and updates the edit’s status to reverted. Strict LIFO — only the most recent completed external edit on a video can be reverted; older edits must wait for any newer ones to be reverted first.
Revert runs three preconditions. All three must pass before the snapshot is restored:
- No active edits. Nothing on the video is
processingorqueued. - Strict LIFO. No newer external edit (non-error, non-reverted) exists for this video.
- Snapshot correlation. The top of the video’s
planner_historywas saved by this edit — guards against a frontend edit landing in between.
409 with a detail that names the violated rule.Endpoint
Your
API_BASE is shown in the Developer tab of your dashboard. The default production base is https://api.knowlify.com.Authentication
Send your key in theX-API-Key header. Only the API key that submitted the edit (or another active key in the same organization) may revert it.
Path parameters
The edit ID returned by
POST /v1/edits. The edit must be in status: "complete".Request body
No body. The path parameter fully specifies the operation.Code examples
Response
A successful revert returns200 with the same shape as GET /v1/edits/{edit_id}, now reflecting the reverted state:
statusis"reverted".is_completeistrue.resultkeeps the originallink/ scene-number arrays from the completed edit, plus a newrevert_diffdescribing what the restore changed.
Failure modes
| Code | detail | Cause |
|---|---|---|
404 | edit not found | No external_edits row matches edit_id. |
403 | API key does not own this edit | The caller is neither the submitter nor an active member of the submitter’s org. |
409 | edit is not in a revertable state (status=…) | The edit is still processing / applying, already reverted, or error. |
409 | cannot revert while another edit is processing or queued | Another edit on the same video is in flight. Wait for it to finish. |
409 | a newer external edit exists on this video; revert the most recent edit first | LIFO violation. Revert the newer edit first. |
409 | snapshot at the top of planner_history was not saved by this edit; cannot safely revert | A frontend-initiated edit landed after this one, pushing a different snapshot on top. The revert cannot proceed without undoing somebody else’s work. |
409 | no snapshot available to revert | The video’s planner_history is empty (rare; suggests the edit ran but the snapshot was never saved). |
{ "detail": "<message>" }. See Errors for the full reference.
Example success response
Limits & errors
- Revert is synchronous from the caller’s perspective — the response returns once the planner has been restored. There is no separate polling step.
- Frame regeneration after a revert is triggered automatically when the restored planner differs from the current one (the internal
/revert-editpipeline handles this). - Full status code reference: Errors.
