Skip to main content
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.

ablo.slides.create(input, options?)

Creates a slide and, optionally, all of its layers in one atomic commit.

Parameters

input
CreateSlideInput
required
options
RequestOptions

Returns

id
string
Client-minted UUID for the new slide.
deckId
string
The parent deck id.
title
string
The slide title.
order
number
The slide’s integer position in the deck.
layers
LayerResource[]
One entry per layer passed in input.layers, each carrying { id, slideId, type }.

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

id
string
required
The slide id.

Returns

id
string
The slide UUID.
deckId
string
The parent deck id.
title
string
The slide title.
order
number
The slide’s integer position in the deck.
templateId
string | null
The attached layout template id, or null.
notes
string | 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

deckId
string
required
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
options
RequestOptions

Returns

id
string
The commit UUID.
status
'queued' | 'confirmed'
The acknowledgement level reached.
lastSyncId
number
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

id
string
required
The slide id to delete.
options
RequestOptions

Returns

id
string
The commit UUID.
status
'queued' | 'confirmed'
The acknowledgement level reached.
lastSyncId
number
Monotonic sync cursor.

Example

const receipt = await ablo.slides.delete('slide_xyz789');
console.log(receipt.status); // 'confirmed'