# Outlines (/docs/api/outlines)

Generate stateless, strictly typed outlines as JSON or SSE. Edit the returned outline and pass it to `POST /decks` to render the reviewed structure.

## Generate an outline without creating a deck

`POST https://api.presentations.ai/api/v1/outlines`

Generate a stateless outline from a prompt and/or extracted files.

No deck, session, or generation request is persisted. Referenced files must belong to the
caller's workspace and have completed extraction before this request.

Bills the outline's slides at the Standard rate (10 credits per slide), once, before it is
returned; an empty balance is a 402. Send a `Request-Id` to retry safely: an ID that
already paid is a 409.

**Header parameters**

- `accept-language` (string, optional) — Output language when the body sets none; the first tag is used.
- `Request-Id` (string, optional) — Retry key, the header `POST /decks` takes; a spent one is a 409. `derive` lets the server derive it from the request, for AI agents and tools: the same outline asked for again by the same user within 15 minutes is refused instead of charged twice. The refusal doesn't return the first outline; keep the response.
- `Idempotency-Key` (string, optional) — Older name for `Request-Id`; still accepted.

**Request body** (`application/json`): CreateOutlineRequest

Generate a reviewable outline from a prompt:

```json
{
  "prompt": "Turn the Q3 results into a concise board update.",
  "slide_count": "8",
  "level_of_detail": "standard"
}
```

Generate from an uploaded source file:

```json
{
  "prompt": "Focus on retention changes and decisions required.",
  "sources": [
    {
      "type": "file",
      "file_id": "f1f11b7e-5e9a-4a3e-8e66-08b49a8ea001"
    }
  ]
}
```

**Responses**

- `200`: CreateOutlineResponse — A completed, strictly typed JSON outline.
- `400`: APIErrorResponse — The referenced files contain no extracted text.
- `401`: APIErrorResponse — Missing, malformed, expired, or revoked Bearer API key. `error.code`: `UNAUTHENTICATED`, `INVALID_TOKEN`.
- `402`: APIErrorResponse — The workspace has no credits left (INSUFFICIENT_CREDITS).
- `403`: APIErrorResponse — The API key, workspace role, project scope, or plan lacks permission. `error.code`: `FORBIDDEN`, `FEATURE_NOT_IN_PLAN`, `PLAN_LIMIT_EXCEEDED`.
- `404`: APIErrorResponse — A referenced file does not exist in the caller's workspace.
- `409`: APIErrorResponse — One or more referenced files are still being extracted, or the `Request-Id` already paid for an outline.
- `422`: APIErrorResponse — A request field failed validation, or the prompt, source text and files together exceed the plan's content limit (CONTENT_TOO_LONG).
- `429`: APIErrorResponse — The caller exceeded the API rate limit. `error.code`: `RATE_LIMITED`.
- `500`: APIErrorResponse — Unexpected server failure. Retry only idempotent operations and retain trace_id. `error.code`: `INTERNAL_ERROR`.
- `502`: APIErrorResponse — Outline generation failed before producing a valid outline.

## Stream an outline without creating a deck

`POST https://api.presentations.ai/api/v1/outlines/stream`

Stream the same stateless operation exposed by `POST /outlines`.

Bills exactly like it, before the `completed` event; a spent `Request-Id` is a 409
before the stream opens.

**Header parameters**

- `accept-language` (string, optional) — Output language when the body sets none; the first tag is used.
- `Request-Id` (string, optional) — Retry key, the header `POST /decks` takes; a spent one is a 409. `derive` lets the server derive it from the request, for AI agents and tools: the same outline asked for again by the same user within 15 minutes is refused instead of charged twice. The refusal doesn't return the first outline; keep the response.
- `Idempotency-Key` (string, optional) — Older name for `Request-Id`; still accepted.

**Request body** (`application/json`): CreateOutlineRequest

**Responses**

- `200`: OutlineStreamStarted \| OutlineStreamDelta \| OutlineStreamCompleted \| OutlineStreamFailed — Strict discriminated outline events encoded as SSE data frames.
- `400`: APIErrorResponse — The referenced files contain no extracted text.
- `401`: APIErrorResponse — Missing, malformed, expired, or revoked Bearer API key. `error.code`: `UNAUTHENTICATED`, `INVALID_TOKEN`.
- `402`: APIErrorResponse — The workspace has no credits left (INSUFFICIENT_CREDITS).
- `403`: APIErrorResponse — The API key, workspace role, project scope, or plan lacks permission. `error.code`: `FORBIDDEN`, `FEATURE_NOT_IN_PLAN`, `PLAN_LIMIT_EXCEEDED`.
- `404`: APIErrorResponse — A referenced file does not exist in the caller's workspace.
- `409`: APIErrorResponse — One or more referenced files are still being extracted, or the `Request-Id` already paid for an outline.
- `422`: APIErrorResponse — A header or request-body field failed validation, or the prompt, source text and files together exceed the plan's content limit (CONTENT_TOO_LONG).
- `429`: APIErrorResponse — The caller exceeded the API rate limit. `error.code`: `RATE_LIMITED`.
- `500`: APIErrorResponse — Unexpected server failure. Retry only idempotent operations and retain trace_id. `error.code`: `INTERNAL_ERROR`.

# Schemas

### CreateOutlineRequest

Generate an outline without creating or mutating a deck.

- `prompt` (string, optional, max length 200000) — Topic and instructions for the presentation, or pasted content to build from.
- `sources` (TextSource \| FileSource[], optional, max 100 items) — Inline text and/or references to files uploaded through POST /files.
- `language` (string, optional, max length 100, default `English`) — Output language as an English name (e.g. `French`); `auto` follows the language of the prompt and sources.
- `slide_count` (string, optional, pattern `^(auto|\d{1,2}(-\d{1,2})?|\d{1,2}\+)$`) — Slides including the cover, each number 1-50: `N` exact, `N-M` a range, `N+` at least N, `auto` or omitted lets the writer decide.
- `level_of_detail` (`brief` \| `standard` \| `detailed` \| `very_detailed`, optional) — Text density per content item, case-insensitive. Omitted: adapted to the topic and content.

### CreateOutlineResponse

Completed stateless outline generation.

- `outline` (PresentationOutline, required) — Generated outline; edit it and pass it as `outline` to `POST /decks`.

### FileSource

Reference to a source document previously uploaded through `/files`.

- `type` (`file`, required) — Source kind discriminator.
- `file_id` (string (uuid), required) — `file_id` from `POST /files`; its extraction must have completed (409 `SOURCES_NOT_READY` otherwise).

### OutlineGraphic

One typed body graphic on an outline slide.

`type` may carry a subtype suffix (e.g. ``diagram:process``). Tables use
`rows` (pipe-separated cells, first row = headers) instead of `items`.

- `type` (string, required, max length 100) — Graphic type, e.g. `list_with_description`, `kpi_block`, `table`, `timeline`; only `diagram` and `chart` take a `:subtype` (`diagram:pyramid`).
- `heading` (string, optional, max length 300) — Graphic caption, e.g. what a chart measures; expected on charts and diagrams.
- `items` (OutlineGraphicItem[], optional, max 30 items) — Content items in reading order.
- `rows` (string[], optional, max 50 items) — Table rows as `|`-separated cells; the first row is the header.
- `extra` (OutlineGraphicItem[], optional, max 4 items) — Reserve items, shown only to fill spare slots in the chosen layout.
- `callout` (string, optional, max length 300) — Annotation drawn on the exhibit: the delta or outlier to read.
- `stamp` (string, optional, max length 40) — `ILLUSTRATIVE`, `PRELIMINARY`, `DRAFT` or `INDICATIVE` for modelled or soft figures.
- `footnote` (string, optional, max length 600) — Definition, period basis, or arithmetic behind a figure.
- `ref` (OutlineRef, optional) — Target or benchmark line the chart should show.
- `highlight` (OutlineHighlight, optional) — The one element the slide heading's claim rests on.

### OutlineGraphicItem

One content item inside a structured outline graphic.

Fields: `h` head/label, `b` body/explanation,
`v` value (kpi/chart datum), `s` source/role (quotes), `i` icon hint
(direct-build), `sub` sub-bullets.

- `h` (string, optional, max length 2000) — Item head: label, step name, or chart point label.
- `b` (string, optional, max length 5000) — Item body: one explanatory sentence, or the whole text of a `paragraph`.
- `v` (string, optional, max length 200) — Numeric value, chart datum or date marker; `multi_series_chart` items carry ` / `-separated values in series order.
- `s` (string, optional, max length 500) — Source or speaker role, e.g. for quotes.
- `i` (string, optional, max length 100) — Icon hint: a 1-3 word pictogram noun.
- `sub` (string[], optional, max 20 items) — Sub-bullets under this item.
- `sublabel` (string, optional, max length 40) — Secondary line under the name: a stated ticket · owner, bucket or scope words.
- `tags` (string[], optional, max 6 items) — Short chips such as owner, horizon, workstream, segment or stage.
- `metric` (string, optional, max length 200) — One figure belonging to this item.
- `entity` (string, optional, max length 200) — Company or product this item is about.
- `entityDomain` (string, optional, max length 200) — Domain of `entity`, used to draw its logo.
- `trend` (string, optional, max length 40) — `rising`, `flat` or `falling`.
- `status` (string, optional, max length 60) — One of `on-track`, `at-risk`, `blocked`, `waiting`, `done`, `supported`, `refuted`, `untestable`, `added`, `removed`, `changed`, `moved`.
- `delta` (string, optional, max length 160) — Measured change the figure represents, e.g. `+400 bps vs FY2024`.
- `period` (string, optional, max length 160) — Period or basis the figure belongs to, e.g. `Q3 FY2026`.

### OutlineHighlight

The one element of a graphic the heading rests on (`<highlight kind at>why</highlight>`).

- `kind` (string, optional, max length 20) — `row`, `column`, `cell`, `point` or `node`.
- `at` (string, optional, max length 200) — Which element: 1-based table row below the header, column header, `row,column`, or a chart point's / node's `h` label.
- `text` (string, optional, max length 300) — Why this element matters, in a few words.

### OutlineKnowledgeFact

One figure the writer stated from its OWN knowledge, with the source it names for it.

Not from the research and not from the user's text:
`<knowledge><k source="Publisher, document, year">figure — what it measures</k></knowledge>`.

- `text` (string, required, max length 300)
- `source` (string, optional, max length 300)

### OutlineRef

A benchmark/target line a chart should show (`<ref label v/>`).

- `label` (string, optional, max length 120) — Line label, e.g. `Benchmark`.
- `v` (string, optional, max length 80) — Line value, e.g. `4%`.

### OutlineSource

One slide-level source chip (`<sources><s domain url>Publisher, period</s></sources>`).

- `domain` (string, optional, max length 200) — Publisher domain.
- `text` (string, optional, max length 300) — Publisher and period, e.g. `Presentations.AI, Q3 2025`.
- `url` (string, optional, max length 2000) — Citation URL; absent when there is none.

### OutlineStreamCompleted

Terminal successful outline event.

- `type` (`completed`, optional, default `completed`) — Event discriminator.
- `outline` (PresentationOutline, required) — Final validated outline; accepted as `outline` by `POST /decks`.

### OutlineStreamDelta

Incremental generated outline text.

- `type` (`delta`, optional, default `delta`) — Event discriminator.
- `delta` (string, required) — Next chunk of raw writer output; for progress display only, not parseable JSON.

### OutlineStreamFailed

Terminal failed outline event.

- `type` (`failed`, optional, default `failed`) — Event discriminator.
- `message` (string, required) — Sanitized failure reason.

### OutlineStreamStarted

Outline generation started.

- `type` (`started`, optional, default `started`) — Event discriminator.

### PresentationOutline

Complete validated presentation outline.

- `documentTitle` (string, optional, max length 255) — Presentation title; names the deck when no `name` or `deck_title` is given.
- `hook` (string, optional, max length 5000)
- `researchSummary` (string, optional, max length 20000)
- `contentLanguage` (string, optional, max length 100) — Language the outline is written in, as an English name.
- `footerText` (string, optional, max length 500) — One-line footer for the whole deck.
- `imagePrompt` (string, optional, max length 5000) — Prompt for the generated cover image.
- `contentMode` (string, optional, max length 20) — `retain` or `condense` when the outline mirrors supplied content; layouts then keep its structure instead of reshaping it. `context` when it is written from the user's notes or files (a material deck that is not preserved).
- `companyName` (string, optional, max length 300) — Company the deck is about: the requested `company`, else one detected from the topic.
- `companyDomain` (string, optional, max length 255) — Domain of `companyName`.
- `audienceQuestions` (string[], optional, max 9 items)
- `rawXml` (string, optional, max length 400000)
- `figureCheck` (object, optional)
- `slides` (PresentationOutlineSlide[], required, max 200 items) — Slides in presentation order.

### PresentationOutlineSlide

One validated slide in a generated or caller-authored outline.

- `heading` (string, required, max length 2000) — Slide title; may wrap one key span in `**bold**`.
- `subheading` (string, optional, max length 2000) — Optional subtitle; on the cover it is the deck subtitle.
- `description` (string, optional, max length 20000) — Plain-text slide content; the content source when `graphics` is absent.
- `category` (string, optional, max length 200) — Fallback for `useCase` when that is absent.
- `useCase` (string, optional, max length 200) — 2-4 word slide-purpose label shown above the title; `Cover` and `Section Break` mark those slide kinds.
- `speakerNotes` (string, optional, max length 5000) — Presenter talking points.
- `visualComposition` (string[], optional, max 20 items) — Ordered graphic types used to pick the layout, starting with `titleandsubtitle`; a comma-separated string is also accepted.
- `graphicSubtypes` (object, optional) — Subtype per graphic type, e.g. `{"diagram": "pyramid"}`.
- `graphics` (OutlineGraphic[], optional, max 10 items) — Structured body graphics in reading order; omitted on cover and section break slides.
- `imageQuery` (string, optional, max length 1000) — Stock-photo search caption describing what the photo shows.
- `sources` (OutlineSource[], optional, max 8 items) — Publishers of this slide's figures.
- `confidence` (string, optional, max length 20) — `high`, `medium` or `low`: how firmly the slide's figures are sourced.
- `knowledge` (OutlineKnowledgeFact[], optional, max 20 items) — Figures stated from the writer's own knowledge, with the source it names.

### TextSource

Inline factual source material supplied directly in the request.

- `type` (`text`, required) — Source kind discriminator.
- `content` (string, required, max length 200000) — Factual material to build from; all text sources together are capped at 200,000 characters.