> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mesolab.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Slides

> Build a presentation from a lesson plan or a topic.

## Request

Supply **either** a `lessonPlan` or a `topic`.

**lessonPlan** `object`

A lesson plan to build the deck from.

**topic** `string`

A topic, when there is no lesson plan to work from.

**additionalInstructions** `string`

Free-text steer on tone, depth or emphasis.

**slideTypes** `object`

Override the built-in nine default slide templates. Shape is
`{ "slide_types": [ ] }`. Use it to pass a subset, custom layouts, or a
different theme.

```bash cURL theme={null}
curl -X POST "$BASE_URL/slides" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "topic": "Photosynthesis", "additionalInstructions": "Keep it visual." }'
```

## Response

**success** `boolean`

`true` when the deck generated.

**deck** `object`

`deck_title` plus a `slides` array. Each slide carries `slide_number`,
`slide_type_id` naming the template it fills, and a `content` object whose
**keys are the slot IDs of that template**.

**metadata** `object`

`generatedAt`, `provider`, `flowId` and `slideCount`.

**usage** `object`

`provider`, `engine`, `model` and `traceId`.

```json Response theme={null}
{
  "success": true,
  "deck": {
    "deck_title": "Sensors and Inputs",
    "slides": [
      {
        "slide_number": 1,
        "slide_type_id": "title_slide",
        "content": { "title": "Sensors and Inputs", "subtitle": "Lesson 2 of 4" }
      }
    ]
  },
  "metadata": {
    "generatedAt": "2026-08-21T12:00:00.000Z",
    "provider": "vertex-agent",
    "flowId": "Flows-UnifiedResourceRouter",
    "slideCount": 9
  },
  "usage": {
    "provider": "vertex-agent",
    "engine": "Flows-UnifiedResourceRouter",
    "model": "gemini-2.5-flash",
    "traceId": "9c02..."
  }
}
```

> [!NOTE]
>
> Slides has no flow of its own. It runs the **unified resource router** with
> `resource_type: "PRESENTATION"`, which is why `flowId` and `engine` read
> `Flows-UnifiedResourceRouter` — the same engine that serves
> [`/resource`](https://docs.mesolab.ai/api-reference/content/resource). `model` is reported by the agent
> per call rather than fixed by this endpoint.

> [!WARNING]
>
> `content` is keyed by slot ID, and slot IDs come from the template named in
> `slide_type_id` — they are not a fixed set. Read them from the slide type rather
> than hard-coding key names, or a custom `slideTypes` override will silently
> render blank slots.

> [!NOTE]
>
> Slot constraints such as `max_chars` are advisory input to the model, not
> enforced on output. Validate lengths client-side before rendering into a fixed
> layout.

## Errors

On failure the response is `{ "success": false, "error": ... }`. A `topic` that
matches nothing usable still returns a deck — the capability falls back to a
generic plan for the topic rather than erroring.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.