Add image layer
add_image_layerAdd an image layer. The asset must already be uploaded (the editor's drag-drop, upload_image, create_upload_link, or POST /api/upload-asset/ with the raw bytes and an X-Upload-Name header). Every upload returns { filename, name }: pass filename (the stored file's id) here, and name as the layer's label. To duplicate an existing layer, reuse its filename — the editor auto-assigns a fresh id.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| x | Yes | Centre x in 1080-wide base coords. | |
| y | Yes | Centre y in 1920-tall base coords. | |
| name | No | Optional label people see in the Inspector and Timeline: pass the upload's returned `name`. Without it the layer is labelled by an older project's own filename, or by kind; never by a stored id. | |
| block | No | OPTIONAL timeline window — {start, duration} in composition frames. OMIT IT (the default) and the layer is ALWAYS PRESENT: a persistent overlay that holds for the whole composition, which is what an agent-placed watermark / lower-third almost always wants. Pass it to place a bounded CLIP instead (what the editor's own add does: 5 s at the playhead). Keyframes on a blocked layer are sampled RELATIVE to `start`. | |
| width | Yes | Width in px (must be > 0). | |
| height | Yes | Height in px (must be > 0). | |
| filename | Yes | The stored filename an upload returned (an id such as 3f2a9c1e-….png, or an older project's own name). | |
| projectId | Yes | Opaque project id (a v4 UUID, from list_projects/create_project). Selects which existing project this call mutates. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | Whether the call succeeded. | |
| data | No | The payload, shaped by the tool. | |
| note | No | What to do next when not ready. | |
| error | No | Why it failed. | |
| status | No | For cache-backed readers: whether the answer was ready. | |
| editorUrl | No | Opens this project in the editor. |