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 mutates an existing video with a natural-language instruction. A single call kicks off three internal phases — Claude rewrites the planner, frame images are regenerated for any changed scenes, and the video clips are restitched against the new planner. The endpoint returns immediately with an edit_id you poll with GET /v1/edits/{edit_id}.
This endpoint is asynchronous. The response confirms the edit was accepted (
queued or processing); the full edit pipeline runs in the background
and typically takes 30 seconds to a few minutes depending on how many scenes changed.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. The key must own the target video_uuid — either as the user who created the video, or as an active member of the organization that owns it.
Headers
Your
kn_<64 hex> API key.Opaque caller-chosen string. Replaying the same key within 24 hours returns the original response without creating a second edit. Use a fresh value
per logical operation (e.g., a UUID); reuse it on retries of the same operation.
Request body
UUID of the video to edit. Must be a
corporate_engine_v2 row owned by the API key’s user or organization.Natural-language instruction describing the change. 1–5000 characters. Examples:
"Make scene 2 more dramatic with closer camera angles", "Replace the bird in scene 3 with a hawk", "Add a new closing scene that summarizes the topic".Up to 5 reference image URLs to condition the edit. Each URL must:
- Use the
https://scheme. - Resolve to a public IP (private, loopback, link-local, and reserved ranges are rejected).
- Return
Content-Type: image/*andContent-Length≤ 5 MB on aHEADrequest.
Optional aspect ratio override. One of
"16:9" or "9:16". Defaults to the target video’s existing aspect ratio.Reserved for admin keys. Standard API keys must leave this
false; the content-safety scan always runs for external callers.Response
A successful call returns HTTP202 Accepted once the edit has been recorded and dispatched to the worker.
Stable identifier for this edit. Pass to
GET /v1/edits/{edit_id} to track progress and to POST /v1/edits/{edit_id} /revert to undo.Echo of the
video_uuid you submitted.Initial status.
"processing" when the worker can start immediately, "queued" when another edit on the same video is already in flight.1-indexed position behind any other active or queued edits on the same video.
0 when this edit is the first to run.Error codes
| Code | Cause |
|---|---|
400 | The edit_request was rejected by the content-safety scan. |
401 | X-API-Key header missing or invalid. |
403 | The API key does not own video_uuid. |
404 | video_uuid does not exist. |
409 | The target video is still being built for the first time (e.g., pipeline_status is lowlevel or generating_frames) or has errored. Wait for the initial render to finish. |
415 | A reference_image_urls[] entry returned the wrong Content-Type, missing Content-Length, or exceeded 5 MB. |
422 | Pydantic validation failure (missing field, oversized edit_request, reference_image_urls[] longer than 5) or a reference URL failed the SSRF host check (non-https, private IP, second-hop redirect). |
429 | Per-caller rate limit exceeded. See Rate Limits. |
{ "detail": "<message>" }. See Errors for the full reference.
Code examples
Example success response
How edits work
Internally a singlePOST /v1/edits runs three phases in sequence inside one worker job:
- Edit — Claude reads the current planner and rewrites the affected scenes based on
edit_request. Setspipeline_statustoedit_complete. - Frame regen — first/last frame images are regenerated for any changed or added scenes. Sets
pipeline_statustoedit_pending_apply. - Sync — video clips for changed and added scenes are regenerated and stitched into the existing timeline, producing a new
linkandtimestamps. Setspipeline_statusback tocomplete.
If the target video has never been fully rendered (no
timestamps / link exists), phase 3 is skipped automatically. The edit lives in the
planner and the next render will reflect it. result.video_synced on the poll response will be false in that case."yes, proceed" up to twice. If a third call still returns a question, the edit terminates with status: "error" and error_message: "edit request was ambiguous; rephrase and retry.".
Next step
The response gives you anedit_id. Use it with GET /v1/edits/{edit_id} to track the edit through queued → processing → applying → complete, and POST /v1/edits/{edit_id}/revert to undo a completed edit.
Limits & errors
- 10 requests / 60 seconds per caller. See Rate Limits.
- One video per request; concurrent edits on the same video are queued serially via
pending_edits[]. - Full status code reference: Errors.
