Skip to main content
POST
edit canvas

Authorizations

Authorization
string
header
required

An API key (es_live_…) from Settings, under API keys, or an OAuth access token.

Headers

Idempotency-Key
string

Retry a paid dispatch safely: the same key returns the job already dispatched instead of charging again.

x-workspace-id
string

The workspace this one call acts in, when it is not the key's own.

Body

application/json
canvas_id
string
required

The canvas id.

operations
object[]
required

Operations, discriminated on type, applied in order as one transaction; a bad one is named by its position and nothing lands. Coordinates are slide pixels; a box is {x, y, w, h, rotation?} with x and y its top-left; layer order in a slide is draw order, bottom first. addLayer {layer, slideId?, index?, parentId?} where layer is {type: "image", ref}, {type: "text", text, preset?, size?, font?, weight?, color?, align?}, {type: "shape", shape, fill?, stroke?, radius?}, {type: "icon", icon}, {type: "chart", chart, rows, colors?} or {type: "adjustment", grade}, plus any field the layer holds (name, opacity, blend, mask, effects, grade, box); slideId defaults to the first slide. addLayer {copyOf, index?} copies a layer. removeLayer {layerId}; moveLayer {layerId, index, parentId?}; patchLayer {layerId, patch} (any of the layer's own fields; null clears; text replaces the words, runs keeps styled spans); replaceImage {layerId, ref}; group {layerIds, name?}; ungroup {layerId}. setCanvas {patch: {width?, height?, background?, dpi?, destination?}}; addSlide {slide: {name?, background?, layers?}} or {copyOf, index?}; setSlide {slideId, patch}; removeSlide {slideId}; moveSlide {slideId, index}. Limits: 200 layers a slide, 50 slides, 8192px a side. The full reference (every layer kind's fields, presets, shapes, charts, masks including subject and background, grades, backgrounds) is the skill skill-canvas-operations, read with manage_skills get.

Required array length: 1 - 200 elements
if_revision

The revision get_canvas returned. A stale one fails with revision_conflict instead of applying; so does no revision once a user edited the canvas in the app since this connection last read it.

context
string

Optional: one sentence shown to the user beside this action.

Maximum string length: 600

Response

Done, or a job started for work that runs longer (follow it with get_jobs).

ok
any
required
data
object
required
meta
object
required
media
object[]