MilaMila.gg

Get Started

Core

REST API

Agents

Pricing

Back to Mila
REST API

Slides

Slide presentations store an array of slides, each rendered on a 960 x 540px canvas using free-form HTML.


List Slides

Endpoint
GET /v1/slides

Same query parameters as documents (limit, offset, sort, order, server_id). The list response does not include the data field -- use the get endpoint for full slide content.


Get Slide Presentation

Endpoint
GET /v1/slides/:id

Returns the presentation including the data array with all slides.


Create Slide Presentation

Endpoint
POST /v1/slides

Body:

JSON
{
  "title": "My Presentation",
  "data": [
    {
      "html": "<div style=\"display:flex;align-items:center;justify-content:center;height:100%\"><h1 style=\"font-size:48px;color:#1a1a1a\">Welcome</h1></div>",
      "background": "#ffffff",
      "notes": "Opening slide"
    },
    {
      "html": "<div style=\"padding:60px\"><h2 style=\"font-size:36px;margin-bottom:24px\">Key Points</h2><ul style=\"font-size:24px;line-height:1.8\"><li>First point</li><li>Second point</li><li>Third point</li></ul></div>",
      "background": "#f8fafc",
      "notes": ""
    }
  ],
  "theme": "default",
  "aspectRatio": "16:9",
  "server_id": null
}
FieldTypeRequiredDescription
titlestringYesPresentation title
dataarrayNoArray of slide objects
themestringNoTheme name (default: "default")
aspectRatiostringNoAspect ratio (default: "16:9")
server_idstring or nullNoServer to create in (null = personal files)

Each slide in the data array has:

FieldTypeDescription
htmlstringHTML content rendered on a 960x540px canvas
backgroundstringCSS background value (color, gradient, or image)
notesstringSpeaker notes (not displayed in presentation)

Note: <script> tags are automatically stripped from slide HTML for security.

The canvas is 960px wide and 540px tall. Design your HTML to fit within these dimensions. Use absolute positioning or flexbox to place elements precisely.

Example -- create a presentation with styled slides:

bash
curl -X POST https://api.mila.gg/v1/slides \
  -H "Authorization: Bearer mila_sk_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Product Launch",
    "data": [
      {
        "html": "<div style=\"display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;background:linear-gradient(135deg,#667eea 0%,#764ba2 100%);color:#fff\"><h1 style=\"font-size:52px;font-weight:700;margin:0\">Product Launch</h1><p style=\"font-size:24px;opacity:0.9;margin-top:16px\">Q3 2026</p></div>",
        "background": "#667eea",
        "notes": "Welcome everyone to the product launch presentation"
      },
      {
        "html": "<div style=\"padding:60px 80px\"><h2 style=\"font-size:36px;color:#1a1a1a;margin:0 0 32px 0\">What We Built</h2><div style=\"display:flex;gap:32px\"><div style=\"flex:1;padding:24px;background:#f0f4ff;border-radius:12px\"><h3 style=\"font-size:20px;color:#4f46e5;margin:0 0 8px 0\">Feature A</h3><p style=\"font-size:16px;color:#64748b;margin:0\">Description of feature A and its benefits.</p></div><div style=\"flex:1;padding:24px;background:#f0fdf4;border-radius:12px\"><h3 style=\"font-size:20px;color:#16a34a;margin:0 0 8px 0\">Feature B</h3><p style=\"font-size:16px;color:#64748b;margin:0\">Description of feature B and its benefits.</p></div></div></div>",
        "background": "#ffffff",
        "notes": "Cover the two main features"
      }
    ],
    "theme": "default",
    "aspectRatio": "16:9"
  }'

Update Slide Presentation

Endpoint
PUT /v1/slides/:id

Body (all fields optional):

JSON
{
  "title": "Updated Title",
  "data": [ ... ],
  "theme": "dark",
  "aspectRatio": "16:9"
}

Note: Updating data replaces the entire slide array. To modify a single slide, first GET the presentation, update the specific slide in the array, then PUT the full array back. To add slides without replacing the array, use the Append Slides endpoint below.


Append Slides

Endpoint
POST /v1/slides/:id/slides

Add one or more slides to an existing presentation without replacing the entire slide array.

Body -- single slide:

JSON
{
  "slide": {
    "html": "<div style=\"padding:60px\"><h2>New Slide</h2></div>",
    "background": "#ffffff",
    "notes": "Added via API"
  }
}

Body -- multiple slides:

JSON
{
  "slides": [
    {
      "html": "<div style=\"padding:60px\"><h2>Slide A</h2></div>",
      "background": "#ffffff",
      "notes": ""
    },
    {
      "html": "<div style=\"padding:60px\"><h2>Slide B</h2></div>",
      "background": "#f8fafc",
      "notes": ""
    }
  ]
}
FieldTypeRequiredDescription
slideobjectOne of slide or slidesA single slide object to append
slidesarrayOne of slide or slidesAn array of slide objects to append
positionnumberNoInsert at this index (0-based). Omit to append at the end.

Each slide object must have an html field. background defaults to "#ffffff" and notes defaults to "" if omitted.

Note: <script> tags are automatically stripped from slide HTML.

Example -- append a slide to the end:

bash
curl -X POST https://api.mila.gg/v1/slides/pR7nW4kL2x/slides \
  -H "Authorization: Bearer mila_sk_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "slide": {
      "html": "<div style=\"display:flex;align-items:center;justify-content:center;height:100%\"><h1 style=\"font-size:48px\">Thank You</h1></div>",
      "background": "#1a1a2e",
      "notes": "Closing slide"
    }
  }'

Example -- insert a slide at position 1 (after the first slide):

bash
curl -X POST https://api.mila.gg/v1/slides/pR7nW4kL2x/slides \
  -H "Authorization: Bearer mila_sk_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "slide": {
      "html": "<div style=\"padding:60px\"><h2 style=\"font-size:36px\">Agenda</h2><ol style=\"font-size:24px\"><li>Introduction</li><li>Demo</li><li>Q&A</li></ol></div>",
      "background": "#ffffff",
      "notes": ""
    },
    "position": 1
  }'

The response returns the full updated presentation including all slides.


Delete Slide Presentation

Endpoint
DELETE /v1/slides/:id