{"openapi":"3.1.0","info":{"title":"Agentic PDF Editor","version":"1.0.0","description":"Agents upload brand materials, save reusable brand kits, author decks as structured JSON (with a raw-HTML escape hatch) or generate them from a brief, edit them by natural-language chat, then render beautiful PDF presentations, per-slide PNGs, and a plain HTML view. Auth: shared password via Authorization: Bearer or X-Access-Password header (browsers use POST /api/login for a session cookie)."},"servers":[{"url":"https://5581577a-ac59-45cb-ba81-18636e949179.hosted-with.matagi.ai"}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer"}},"schemas":{"Slide":{"type":"object","properties":{"id":{"type":"string"},"layout":{"type":"string","enum":["title","title-bullets","two-column","image-full","image-right","quote","section","blank"]},"blocks":{"type":"object","properties":{"title":{"type":"string"},"subtitle":{"type":"string"},"bullets":{"type":"array","items":{"type":"string"}},"body":{"type":"string"},"columnLeft":{"type":"string"},"columnRight":{"type":"string"},"quote":{"type":"string"},"attribution":{"type":"string"},"imageAssetId":{"type":"string","description":"id from POST /assets"},"imageUrl":{"type":"string"},"notes":{"type":"string"}}},"rawHtml":{"type":"string","description":"Full HTML override for this slide body."},"themeOverrides":{"type":"object","additionalProperties":{"type":"string"}}}}}},"security":[{"bearerAuth":[]}],"paths":{"/":{"get":{"summary":"Dashboard UI (gallery + chat editor)","security":[],"responses":{"200":{"description":"text/html"}}}},"/docs":{"get":{"summary":"Human-readable agent guide (rendered markdown)","security":[],"responses":{"200":{"description":"text/html"}}}},"/docs.md":{"get":{"summary":"Agent guide as raw markdown (ingest this to self-learn the API)","security":[],"responses":{"200":{"description":"text/markdown"}}}},"/api/login":{"post":{"summary":"Browser login: sets an HttpOnly session cookie so the password never appears in URLs","security":[],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"password":{"type":"string"}},"required":["password"]}}}},"responses":{"200":{"description":"ok; Set-Cookie"}}}},"/api/logout":{"post":{"summary":"Clear the session cookie","security":[],"responses":{"200":{"description":"ok"}}}},"/api/models":{"get":{"summary":"Available LLM models (for the chat model picker); default claude-sonnet-5","responses":{"200":{"description":"{ models, default }"}}}},"/api/decks":{"get":{"summary":"List all decks (powers the dashboard)","responses":{"200":{"description":"{ decks: DeckIndexEntry[] }"}}}},"/brand-kits":{"get":{"summary":"List brand kits","responses":{"200":{"description":"{ brandKits }"}}},"post":{"summary":"Create a reusable brand kit (palette, fonts, logo, named images, layout defaults, style notes).","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"slug":{"type":"string"},"colors":{"type":"object"},"fonts":{"type":"object"},"logoAssetId":{"type":"string"},"images":{"type":"object","additionalProperties":{"type":"string"}},"layoutDefaults":{"type":"object"},"styleNotes":{"type":"string"}}}}}},"responses":{"201":{"description":"BrandKit"}}}},"/brand-kits/derive":{"post":{"summary":"Create a brand kit by deriving palette+fonts from uploaded materials (LLM vision).","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"assetIds":{"type":"array","items":{"type":"string"}},"brief":{"type":"string"},"name":{"type":"string"},"logoAssetId":{"type":"string"},"images":{"type":"object"},"styleNotes":{"type":"string"}}}}}},"responses":{"201":{"description":"BrandKit"}}}},"/brand-kits/{idOrSlug}":{"get":{"summary":"Get a brand kit by id or slug","parameters":[{"name":"idOrSlug","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"BrandKit"}}}},"/decks/generate":{"post":{"summary":"Generatively author a deck from a brief (+ optional brandKitId/brandKitSlug), then render it.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"brief":{"type":"string"},"brandKitId":{"type":"string"},"brandKitSlug":{"type":"string"},"slideCount":{"type":"integer"},"model":{"type":"string"},"title":{"type":"string"},"render":{"type":"boolean"}},"required":["brief"]}}}},"responses":{"201":{"description":"{ deck, pdf, view, slideImages }"}}}},"/decks/{id}/chat":{"post":{"summary":"Edit a deck by natural language (agent loop over deck-editing tools); auto re-renders.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"},"model":{"type":"string"},"history":{"type":"array"},"render":{"type":"boolean"}},"required":["message"]}}}},"responses":{"200":{"description":"{ summary, changed, slideCount, deck, pdf?, slideImages? }"}}}},"/healthz":{"get":{"summary":"Liveness (no auth)","security":[],"responses":{"200":{"description":"ok"}}}},"/assets":{"post":{"summary":"Upload a brand asset (logo, image, example). multipart/form-data.","requestBody":{"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","format":"binary"},"role":{"type":"string","enum":["logo","background","image","example","other"]}},"required":["file"]}}}},"responses":{"201":{"description":"AssetMeta"}}}},"/assets/{id}":{"get":{"summary":"Fetch asset bytes","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"bytes"}}}},"/themes":{"post":{"summary":"Create a theme from explicit tokens (no LLM).","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"colors":{"type":"object"},"fonts":{"type":"object"},"logoAssetId":{"type":"string"}}}}}},"responses":{"201":{"description":"Theme"}}}},"/themes/derive":{"post":{"summary":"Derive a cohesive theme from uploaded materials via LLM vision.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"assetIds":{"type":"array","items":{"type":"string"}},"brief":{"type":"string"},"logoAssetId":{"type":"string"}}}}}},"responses":{"201":{"description":"Theme"}}}},"/themes/{id}":{"get":{"summary":"Get theme","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Theme"}}},"patch":{"summary":"Update theme","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Theme"}}}},"/decks":{"post":{"summary":"Create a deck.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string"},"themeId":{"type":"string"},"slides":{"type":"array","items":{"$ref":"#/components/schemas/Slide"}}}}}}},"responses":{"201":{"description":"Deck"}}}},"/decks/{id}":{"get":{"summary":"Get deck","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Deck"}}},"put":{"summary":"Replace deck","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Deck"}}}},"/decks/{id}/slides/{sid}":{"patch":{"summary":"Edit one slide","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"sid","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Slide"}}}},"/decks/{id}/render":{"post":{"summary":"Render PDF + per-slide PNGs + HTML view. Returns links.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"render result with links"}}}},"/decks/{id}/view":{"get":{"summary":"Plain non-SPA HTML view of the whole deck.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"text/html"}}}},"/decks/{id}/slides/{n}.png":{"get":{"summary":"Per-slide PNG (1-indexed). Render the deck first.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"n","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"image/png"}}}},"/decks/{id}/pdf":{"get":{"summary":"Download the rendered PDF.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"application/pdf"}}}}}}