ablo.layers namespace manages the individual content elements — text, charts, tables, images, shapes, and icons — that live on a slide. Layers are addressed by id; capture the id returned by create and pass it directly to update, applyOp, or delete without an intermediate lookup. For read-modify-write edits to chart, table, or text content, use applyOp rather than update — it applies a typed operation against the current stored content so only the targeted fields change.
ablo.layers.create(slideId, layer, options?)
Adds a single layer to a slide. The layer argument is a flat, discriminated-union object; the SDK validates and compiles it before committing.
Parameters
string
required
The id of the slide to add the layer to.
LayerInput
required
A flat object describing the layer to create. The
type field discriminates the union. Common fields shared by all layer types:RequestOptions
Returns
string
Client-minted UUID for the new layer.
string
The parent slide id.
string
The layer type, e.g.
"text", "bar", "table".Example
ablo.layers.createRaw(params, options?)
Advanced escape hatch for creating a layer from raw CreateLayerParams. Use this when you need to supply a fully-constructed data or contentJson payload that the higher-level LayerInput builders do not expose.
Parameters
CreateLayerParams
required
RequestOptions
Returns
string
Client-minted UUID for the new layer.
string
The parent slide id.
string
The layer type.
Example
ablo.layers.retrieve(id)
Fetches the full stored record for a layer by id. Requires a readable client.
Parameters
string
required
The layer id.
Returns
string
The layer UUID.
string
The parent slide id.
string
The layer type.
LayerPosition
Geometry:
{ x, y, width, height, rotation? } in the 1920×1080 coordinate space.unknown
Type-specific payload (chart document, table data, shape descriptor).
unknown
Rich text content for text-bearing layers.
null for non-text types.Record<string, unknown> | null
Layer-level style overrides.
number
Stacking order.
boolean
Whether the layer is visible.
LayerImageFill | null
Picture fill, or
null.string | null
The layout layer this slide layer is bound to, or
null for free layers.Example
ablo.layers.list({ slideId })
Returns all layers on a slide. Requires a readable client.
Parameters
string
required
The slide whose layers you want to list.
Returns
An array ofLayerRecord objects. Each entry has the same shape as the return value of retrieve.
Example
ablo.layers.update(params, options?)
Applies a field-level patch to an existing layer. Each field you include overwrites the entire stored value for that field; fields you omit are left unchanged. Use applyOp instead when you want to surgically modify chart series, table cells, or text styles.
Parameters
UpdateLayerParams
required
RequestOptions
Returns
string
The commit UUID.
'queued' | 'confirmed'
The acknowledgement level reached.
number
Monotonic sync cursor for real-time clients.
Example
ablo.layers.applyOp(id, op, options?)
Applies a typed operation to a chart, table, or text layer using a read-modify-write cycle. The SDK reads the layer’s current document from the server, applies the op through the same reducers used by the editor and the AI, and writes only the changed fields back — so unrelated parts of the document are never overwritten.
This method requires a readable client. If your client is commit-only, it throws with a clear error.
Parameters
string
required
The layer id to modify.
LayerOp
required
A typed operation. The op type must match the layer type:
RequestOptions
Returns
string
The commit UUID.
'queued' | 'confirmed'
The acknowledgement level reached.
number
Monotonic sync cursor for real-time clients.
Example
ablo.layers.delete(id, options?)
Permanently deletes a layer from its slide.
Parameters
string
required
The layer id to delete.
RequestOptions
Returns
string
The commit UUID.
'queued' | 'confirmed'
The acknowledgement level reached.
number
Monotonic sync cursor.