Slides
Slide presentations store an array of slides, each rendered on a 960 x 540px canvas using free-form HTML.
List Slides
GET /v1/slidesSame 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
GET /v1/slides/:idReturns the presentation including the data array with all slides.
Create Slide Presentation
POST /v1/slidesBody:
{
"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
}| Field | Type | Required | Description |
|---|---|---|---|
title | string | Yes | Presentation title |
data | array | No | Array of slide objects |
theme | string | No | Theme name (default: "default") |
aspectRatio | string | No | Aspect ratio (default: "16:9") |
server_id | string or null | No | Server to create in (null = personal files) |
Each slide in the data array has:
| Field | Type | Description |
|---|---|---|
html | string | HTML content rendered on a 960x540px canvas |
background | string | CSS background value (color, gradient, or image) |
notes | string | Speaker 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:
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
PUT /v1/slides/:idBody (all fields optional):
{
"title": "Updated Title",
"data": [ ... ],
"theme": "dark",
"aspectRatio": "16:9"
}Note: Updating
datareplaces 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
POST /v1/slides/:id/slidesAdd one or more slides to an existing presentation without replacing the entire slide array.
Body -- single slide:
{
"slide": {
"html": "<div style=\"padding:60px\"><h2>New Slide</h2></div>",
"background": "#ffffff",
"notes": "Added via API"
}
}Body -- multiple slides:
{
"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": ""
}
]
}| Field | Type | Required | Description |
|---|---|---|---|
slide | object | One of slide or slides | A single slide object to append |
slides | array | One of slide or slides | An array of slide objects to append |
position | number | No | Insert 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:
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):
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
DELETE /v1/slides/:id