The ablo.slides namespace manages individual slides within a deck. Like the decks API, create is atomic — you can pass the entire layer tree in one call and the commit either succeeds in full or is rolled back. Slide ids are client-minted, so you can capture them immediately and reference layers by id in subsequent update calls without additional read round-trips.
Creates a slide and, optionally, all of its layers in one atomic commit.
Parameters
The id of the parent deck.
Integer position of the slide within the deck. For a deck that already has n slides, pass n to append.
Human-readable slide title. Defaults to "Untitled" when omitted.
SlideLayout id. Attaches a layout template so the slide inherits the layout’s chrome and placeholder slots.
Flat layer descriptors to create atomically with the slide. Each object is a discriminated union on type. See the Layers API for the full type reference. Slide background — solid color, gradient, image, or raw CSS value. Use the background builder helpers for a typed authoring experience.
size
'16:9' | '16:10' | 'a4-portrait'
Size preset that expands to a width/height/aspectRatio triplet:
'16:9' → 1920×1080
'16:10' → 1920×1200
'a4-portrait' → 2480×3508
Explicit slide width in pixels. Takes precedence over size.
Explicit slide height in pixels. Takes precedence over size.
aspectRatio
'16:9' | '16:10' | '4:3' | 'custom'
Aspect ratio constraint applied independently of the size preset.
Show or hide the snap grid overlay in the editor.
Grid cell size in pixels (used when showGrid is true).
When false, this slide opts out of master compositing from the parent layout’s master template.
wait
'queued' | 'confirmed'
default: "confirmed"
'confirmed' (default) waits for the durable acknowledgement before resolving. 'queued' returns as soon as the server accepts the write.
Idempotency key for safe retries.
Returns
Client-minted UUID for the new slide.
The slide’s integer position in the deck.
One entry per layer passed in input.layers, each carrying { id, slideId, type }. Show LayerResource fields
Client-minted UUID for the layer.
The layer type, e.g. "text", "bar", "table", "image".
Example
import { Decks } from '@abloatai/decks' ;
const ablo = new Decks ( process . env . ABLO_API_KEY ! );
const slide = await ablo . slides . create ({
deckId: 'deck_abc123' ,
order: 0 ,
title: 'Financial Overview' ,
size: '16:9' ,
layers: [
{
type: 'text' ,
text: 'Financial Overview' ,
style: 'title' ,
at: { x: 160 , y: 120 , w: 1600 , h: 200 },
},
{
type: 'table' ,
columns: [ 'Quarter' , 'Revenue' , 'Growth' ],
rows: [
[ 'Q1' , '$1.2M' , '+12%' ],
[ 'Q2' , '$1.5M' , '+25%' ],
[ 'Q3' , '$1.9M' , '+27%' ],
],
at: { x: 160 , y: 380 , w: 1600 , h: 500 },
},
],
});
console . log ( slide . id ); // slide UUID
console . log ( slide . layers [ 1 ]. id ); // table layer UUID
ablo.slides.retrieve(id)
Fetches the full stored record for a slide by id. Requires a readable client.
Parameters
Returns
The slide’s integer position in the deck.
The attached layout template id, or null.
Speaker notes, or null if none have been set.
settings
SlideCompositionSettings | null
The full compiled settings object (size, background, grid, etc.), or null.
Example
const slide = await ablo . slides . retrieve ( 'slide_xyz789' );
console . log ( slide . order , slide . settings ?. width );
ablo.slides.list({ deckId })
Returns all slides in a deck, ordered by their order field ascending. Requires a readable client.
Parameters
The deck whose slides you want to list.
Returns
An array of SlideRecord objects, sorted by order ascending. Each entry has the same shape as the return value of retrieve.
Example
const slides = await ablo . slides . list ({ deckId: 'deck_abc123' });
for ( const slide of slides ) {
console . log ( slide . order , slide . title );
}
ablo.slides.update(params, options?)
Applies a field-level patch to an existing slide. When you include any settings field (background, size, width, height, etc.), the SDK performs a read-modify-write so only the fields you specify are changed and the rest of the settings object is preserved.
Parameters
params
UpdateSlideParams
required
Speaker notes to store on the slide.
Attach or switch the layout template.
size
'16:9' | '16:10' | 'a4-portrait'
Updated size preset.
aspectRatio
'16:9' | '16:10' | '4:3' | 'custom'
Updated aspect ratio.
Toggle master compositing for this slide.
wait
'queued' | 'confirmed'
default: "confirmed"
Acknowledgement level to wait for.
Idempotency key for safe retries.
Returns
The acknowledgement level reached.
Monotonic sync cursor for real-time clients.
Example
const receipt = await ablo . slides . update ({
id: 'slide_xyz789' ,
title: 'Financial Overview — Revised' ,
notes: 'Emphasise the Q3 growth figure.' ,
showGrid: false ,
});
console . log ( receipt . status ); // 'confirmed'
ablo.slides.delete(id, options?)
Permanently deletes a slide and all of its layers.
Parameters
wait
'queued' | 'confirmed'
default: "confirmed"
Acknowledgement level to wait for.
Idempotency key for safe retries.
Returns
The acknowledgement level reached.
Example
const receipt = await ablo . slides . delete ( 'slide_xyz789' );
console . log ( receipt . status ); // 'confirmed'