> ## 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.

# Submit Training edit

> Apply a precise instruction to an existing Training video

> [!NOTE]
>
> These pages describe the Training API on `dev`, where authenticated creation, editing, downloads, revert, and website brand lookup have been tested live.
> Production availability is not confirmed. Your API service and worker must both run the updated code.
> See [Testing and availability](https://docs.knowlify.com/api-reference/testing.md).

`POST {API_BASE}/v1/edits`

Submit a specific instruction, then [poll the edit](https://docs.knowlify.com/api-reference/poll-edit.md). The target video must be accessible in the key's workspace, have a saved planner, and be in an editable state. Initial generation must finish first. Locked preview scenes must be unlocked through the existing completion flow.

```bash theme={null}
curl --fail-with-body "$API_BASE/v1/edits" \
  -H "X-API-Key: $KNOWLIFY_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $EDIT_REQUEST_ID" \
  -d "{\"video_uuid\":\"$VIDEO_UUID\",\"edit_request\":\"Change only the on-screen title to Lock before you leave. Keep narration, colors, and timing unchanged.\"}"
```

Set `EDIT_REQUEST_ID` once per logical edit, for example to a UUID, and retain it for retries.

## Request

| Field | Type | Rules |
| - | - | - |
| `video_uuid` | string, required | Identifier returned by video creation |
| `edit_request` | string, required | 1–5000 characters after trimming; blank instructions are rejected |
| `approval_mode` | string | `automatic` by default, or `manual` to review a proposed plan |
| `reference_image_urls` | string array | Up to five public HTTPS image URLs |
| `aspect_ratio` | string, optional | `16:9` or `9:16`; may only confirm the video's existing ratio |
| `skip_content_safety` | boolean | Reserved, defaults to false. Content safety always runs, even if true is supplied |

Reference images must be direct public HTTPS PNG, JPEG, or WebP files, or imported images owned by the caller’s workspace. Public images are copied into caller-owned storage. Images are limited to 10 MB and 25 megapixels; redirects and unsafe/private hosts are rejected with 422.

Supplying a different `aspect_ratio` returns **422**. A free-text instruction such as “make this portrait” does not switch the video's output format through this endpoint; it can change the scene layout while leaving the existing frame dimensions unchanged. Choose the ratio when creating a Training video, or use the app's reformat flow for an existing one. Marketing has a separate [aspect-ratio operation](https://docs.knowlify.com/api-reference/marketing-videos.md) for supported source videos.

## Response and retries

HTTP **202** returns:

```json theme={null}
{
  "edit_id": "44444444-4444-4444-8444-444444444444",
  "video_uuid": "22222222-2222-4222-8222-222222222222",
  "status": "processing",
  "queue_position": 0
}
```

The initial status can also be `queued` when the video has another edit in flight. Acceptance does not mean the edited video is ready.

The optional `Idempotency-Key` header caches the accepted response for 24 hours, scoped by user and organization. Retry with the same key and the same body. A different body with a cached key returns **409**. Access to the video is checked again on retries. A durable uniqueness check prevents concurrent identical keys from appending duplicate edits. A concurrent request can receive 409 before the accepted response is cached; poll the original edit.

## Applying the edit

With the default `automatic` mode, the worker approves a proposed edit plan and applies the changes. With `manual`, the edit waits at `awaiting_approval`. Poll the edit, review `required_action.plan`, then [approve it](https://docs.knowlify.com/api-reference/edit-actions.md). Frame changes already committed by editing tools are not regenerated a second time.

If the instruction needs more detail, the edit waits at `awaiting_clarification`. Poll the edit, then [answer its question](https://docs.knowlify.com/api-reference/edit-actions.md) or cancel it. Check `result.video_synced` to distinguish an applied render from a planner-only result.

A completed edit confirms that the result was published. Review the returned video to verify the requested visual change; completion is not a guarantee that every creative instruction was fulfilled.

## Credit policy

Edits use the current **free-edit policy**. The previous per-scene edit pricing and worst-case credit preflight do not describe this update. A missing subscription record alone does not reject a credit-exempt edit. API entitlement and locked-preview restrictions still apply; creation remains subject to its own billing rules.

See [Errors](https://docs.knowlify.com/api-reference/errors.md) and [Rate limits](https://docs.knowlify.com/api-reference/rate-limits.md).

Malformed video identifiers return 422 before any edit lookup or submission. Duplicate idempotency keys cannot append another pending edit. If the short-lived response cache has expired but the durable edit record still owns the key, the API returns 409; poll the original edit. Submission-storage failures return a sanitized 503, with an edit ID when a pollable record exists.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.