# Decks (/docs/api/decks)

Create decks asynchronously from prompts, typed sources, or a caller-edited outline, then poll, inspect, and download the rendered result.

## List Decks

`GET https://api.presentations.ai/api/v1/decks`

List accessible decks with project, flag, sort, search, and pagination filters.

Decks that have no slides yet (generation still running, or never completed)
are omitted; fetch those by id.

**Query parameters**

- `project_id` (string (uuid), optional) — Only decks in this project; a project-bound key defaults to its own.
- `flag` (DeckFlagType, optional) — Only decks you flagged this way, e.g. `STARRED`.
- `sort` (DeckSort, optional, default `RECENT`) — Order: `RECENT` (last edited), `UPDATED`, `CREATED`, or `NAME`.
- `search` (string, optional) — Only decks whose name contains this text (case-insensitive).
- `page` (integer, optional, ≥ 1, default `1`) — Page number, starting at 1.
- `limit` (integer, optional, ≥ 1, ≤ 200, default `50`) — Items per page.

**Responses**

- `200`: Page_Deck_ — Successful Response
- `401`: APIErrorResponse — Missing, malformed, expired, or revoked Bearer API key. `error.code`: `UNAUTHENTICATED`, `INVALID_TOKEN`.
- `403`: APIErrorResponse — The API key, workspace role, project scope, or plan lacks permission. `error.code`: `FORBIDDEN`, `FEATURE_NOT_IN_PLAN`, `PLAN_LIMIT_EXCEEDED`.
- `422`: RequestValidationErrorResponse — A path, query, header, or request-body field failed validation. `error.code`: `VALIDATION_FAILED`.
- `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`.

## Create a deck and generate it through final export

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

Create a deck and run supplied content through final export.

A request with generation inputs requires `Request-Id`, returns 202 +
Location by default, and accepts `Prefer: wait=N` up to 180 seconds. Supply
either a prompt and/or typed document sources, or a complete authored
outline. Authored outlines skip outline generation but still run slides and
export. Same-ID/different-body returns a rich 409 suggesting a
version-suffixed request ID.

**Header parameters**

- `Request-Id` (string, required, max length 255, pattern `^[A-Za-z0-9][A-Za-z0-9._:~-]{0,254}$`) — Required caller request ID; reuse it to safely retry this create. `derive` lets the server derive it from the request, for AI agents and tools that can't keep one: the same request from the same user returns the same deck, until that deck fails or is deleted. Files count by their `file_id`, so a file uploaded again is a new request.
- `Prefer` (string, optional, max length 32, pattern `^\s*wait=\d+\s*$`) — Optional bounded generation wait: `wait=N`, where N is 0-180.

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

Generate a deck directly from a prompt:

```json
{
  "name": "Launch plan",
  "prompt": "Explain our launch plan to sales leadership.",
  "slide_count": "10",
  "export_format": "PPTX"
}
```

Render a caller-edited outline:

```json
{
  "name": "Q3 customer review",
  "outline": {
    "documentTitle": "Q3 customer review",
    "hook": "Retention improved while expansion revenue became the next constraint.",
    "slides": [
      {
        "heading": "Q3 in one minute",
        "description": "Revenue, retention, and the two decisions needed from the board.",
        "visualComposition": [
          "kpi_block"
        ]
      },
      {
        "heading": "Expansion is the next growth lever",
        "description": "Segment expansion by customer cohort and identify the largest gap.",
        "speakerNotes": "Call out the enterprise cohort before discussing actions.",
        "visualComposition": [
          "chart",
          "list_with_description"
        ]
      }
    ]
  },
  "export_format": "PPTX"
}
```

**Responses**

- `201`: GeneratedDeckResponse — Generation became terminal during the requested bounded wait.
- `202`: GeneratedDeckResponse — Deck generation accepted; poll the returned request URL.
- `400`: APIErrorResponse — Invalid bounded-wait duration.
- `401`: APIErrorResponse — Authentication failed.
- `402`: APIErrorResponse — The workspace has insufficient generation credits.
- `403`: APIErrorResponse — The caller or workspace plan cannot create the deck.
- `404`: APIErrorResponse — A referenced source file does not exist in the caller's workspace.
- `409`: RequestIdConflictResponse \| APIErrorResponse — Request-ID conflict or source files are not ready.
- `422`: RequestValidationErrorResponse \| APIErrorResponse — A header or request-body field failed validation, or the prompt, source text, insider content 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`.

## Create a deck and stream bounded generation status

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

Create or replay a durable deck generation and stream bounded status.

This is the streaming transport for the same idempotent operation as
`POST /decks`. Disconnecting or reaching the wait bound never cancels the
generation; callers resume through the emitted `request.status_url`.

**Query parameters**

- `wait` (integer, optional, ≥ 0, ≤ 180, default `180`) — Seconds to stream request status before detaching (0-180).

**Header parameters**

- `Request-Id` (string, required, max length 255, pattern `^[A-Za-z0-9][A-Za-z0-9._:~-]{0,254}$`) — Caller request ID shared with POST /decks retries. `derive` lets the server derive it from the request, for AI agents and tools that can't keep one: the same request from the same user returns the same deck, until that deck fails or is deleted. Files count by their `file_id`, so a file uploaded again is a new request.

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

**Responses**

- `200`: DeckStreamAccepted \| DeckStreamStatus \| DeckStreamDetached — Strict accepted and request-status events. A detached event means durable generation is still running and should be polled at its status URL.
- `401`: APIErrorResponse — Authentication failed.
- `402`: APIErrorResponse — The workspace has insufficient generation credits.
- `403`: APIErrorResponse — The caller or workspace plan cannot create the deck.
- `404`: APIErrorResponse — A referenced source file does not exist in the caller's workspace.
- `409`: RequestIdConflictResponse \| APIErrorResponse — Request-ID conflict or source files are not ready.
- `422`: RequestValidationErrorResponse — A header, query, or request-body field failed validation.
- `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`.

## Get Deck

`GET https://api.presentations.ai/api/v1/decks/{deck_id}`

Fetch deck metadata, latest generation status, and existing export artifacts.

Over MCP, export download URLs open without a key and expire after 15 minutes.

**Path parameters**

- `deck_id` (string (uuid), required) — ID of the deck.

**Responses**

- `200`: DeckDetailResponse — Successful Response
- `401`: APIErrorResponse — Missing, malformed, expired, or revoked Bearer API key. `error.code`: `UNAUTHENTICATED`, `INVALID_TOKEN`.
- `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 — The resource does not exist or is outside the caller's scope. `error.code`: `NOT_FOUND`.
- `422`: RequestValidationErrorResponse — A path, query, header, or request-body field failed validation. `error.code`: `VALIDATION_FAILED`.
- `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`.

## Patch Deck

`PATCH https://api.presentations.ai/api/v1/decks/{deck_id}`

Rename a deck, change who can open it, or move it to another project.

It can also switch which content version the deck shows. Changing visibility can make the
deck public or remove other people's access; setting it to anything but `PUBLIC` also turns
the deck's share link off. It doesn't start generation or create an export.

**Path parameters**

- `deck_id` (string (uuid), required) — ID of the deck.

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

**Responses**

- `200`: Deck — Successful Response
- `401`: APIErrorResponse — Missing, malformed, expired, or revoked Bearer API key. `error.code`: `UNAUTHENTICATED`, `INVALID_TOKEN`.
- `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 — The resource does not exist or is outside the caller's scope. `error.code`: `NOT_FOUND`.
- `422`: RequestValidationErrorResponse — A path, query, header, or request-body field failed validation. `error.code`: `VALIDATION_FAILED`.
- `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`.

## Delete Deck

`DELETE https://api.presentations.ai/api/v1/decks/{deck_id}`

Soft-delete a deck; the operation is idempotent for an already deleted deck.

**Path parameters**

- `deck_id` (string (uuid), required) — ID of the deck.

**Responses**

- `204` — Successful Response
- `401`: APIErrorResponse — Missing, malformed, expired, or revoked Bearer API key. `error.code`: `UNAUTHENTICATED`, `INVALID_TOKEN`.
- `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 — The resource does not exist or is outside the caller's scope. `error.code`: `NOT_FOUND`.
- `422`: RequestValidationErrorResponse — A path, query, header, or request-body field failed validation. `error.code`: `VALIDATION_FAILED`.
- `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`.

## Unset Deck Flag

`DELETE https://api.presentations.ai/api/v1/decks/{deck_id}/flags/{flag}`

Remove one user-private organizational flag from a deck.

**Path parameters**

- `deck_id` (string (uuid), required) — ID of the deck.
- `flag` (DeckFlagType, required) — The flag to set or remove.

**Responses**

- `204` — Successful Response
- `401`: APIErrorResponse — Missing, malformed, expired, or revoked Bearer API key. `error.code`: `UNAUTHENTICATED`, `INVALID_TOKEN`.
- `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 — The resource does not exist or is outside the caller's scope. `error.code`: `NOT_FOUND`.
- `422`: RequestValidationErrorResponse — A path, query, header, or request-body field failed validation. `error.code`: `VALIDATION_FAILED`.
- `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`.

## Set Deck Flag

`PUT https://api.presentations.ai/api/v1/decks/{deck_id}/flags/{flag}`

Set a user-private organizational flag such as starred or archived.

**Path parameters**

- `deck_id` (string (uuid), required) — ID of the deck.
- `flag` (DeckFlagType, required) — The flag to set or remove.

**Responses**

- `204` — Successful Response
- `401`: APIErrorResponse — Missing, malformed, expired, or revoked Bearer API key. `error.code`: `UNAUTHENTICATED`, `INVALID_TOKEN`.
- `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 — The resource does not exist or is outside the caller's scope. `error.code`: `NOT_FOUND`.
- `422`: RequestValidationErrorResponse — A path, query, header, or request-body field failed validation. `error.code`: `VALIDATION_FAILED`.
- `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`.

## Get Deck Thumbnail

`GET https://api.presentations.ai/api/v1/decks/{deck_id}/thumbnail`

Stream the current JPEG thumbnail; return 404 until one is available.

**Path parameters**

- `deck_id` (string (uuid), required) — ID of the deck.

**Query parameters**

- `width` (integer, optional) — Stored size to serve (see `thumbnails`); the largest by default.

**Responses**

- `200`: string (binary) — The deck's JPEG thumbnail.
- `401`: APIErrorResponse — Missing, malformed, expired, or revoked Bearer API key. `error.code`: `UNAUTHENTICATED`, `INVALID_TOKEN`.
- `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 — The resource does not exist or is outside the caller's scope. `error.code`: `NOT_FOUND`.
- `422`: RequestValidationErrorResponse — A path, query, header, or request-body field failed validation. `error.code`: `VALIDATION_FAILED`.
- `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`.

## List Deck Exports

`GET https://api.presentations.ai/api/v1/decks/{deck_id}/exports`

Most-recent-first export artifacts for a deck.

**Path parameters**

- `deck_id` (string (uuid), required) — ID of the deck.

**Query parameters**

- `page` (integer, optional, ≥ 1, default `1`) — Page number, starting at 1.
- `limit` (integer, optional, ≥ 1, ≤ 200, default `200`) — Items per page.

**Responses**

- `200`: Page_ExternalDeckExportResponse_ — Successful Response
- `401`: APIErrorResponse — Missing, malformed, expired, or revoked Bearer API key. `error.code`: `UNAUTHENTICATED`, `INVALID_TOKEN`.
- `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 — The resource does not exist or is outside the caller's scope. `error.code`: `NOT_FOUND`.
- `422`: RequestValidationErrorResponse — A path, query, header, or request-body field failed validation. `error.code`: `VALIDATION_FAILED`.
- `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`.

## Get Deck Export Content

`GET https://api.presentations.ai/api/v1/decks/{deck_id}/exports/{export_id}/content`

Download a produced export artifact.

**Path parameters**

- `deck_id` (string (uuid), required) — ID of the deck.
- `export_id` (string (uuid), required) — ID of the export, from the deck's `exports`.

**Query parameters**

- `encoding` (`base64`, optional) — `base64` returns the file inside JSON, for platforms that can only move files that way; up to 4 MB.

**Responses**

- `200`: string (binary) — The export file: PPTX, PDF, or a ZIP of slide images; with `encoding=base64`, the same file as base64 inside JSON.
- `400`: APIErrorResponse — With `encoding=base64`, the file is larger than 4 MB.
- `401`: APIErrorResponse — Missing, malformed, expired, or revoked Bearer API key. `error.code`: `UNAUTHENTICATED`, `INVALID_TOKEN`.
- `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 — The resource does not exist or is outside the caller's scope. `error.code`: `NOT_FOUND`.
- `422`: RequestValidationErrorResponse — A path, query, header, or request-body field failed validation. `error.code`: `VALIDATION_FAILED`.
- `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`.

## Create Export Download Link

`POST https://api.presentations.ai/api/v1/decks/{deck_id}/exports/{export_id}/download-links`

Create a link that downloads the file without a key, for people or systems that have none.

Anyone holding the link can download the file until it expires; it can't be revoked.

**Path parameters**

- `deck_id` (string (uuid), required) — ID of the deck.
- `export_id` (string (uuid), required) — ID of the export, from the deck's `exports`.

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

**Responses**

- `201`: ExportDownloadLink — Successful Response
- `401`: APIErrorResponse — Missing, malformed, expired, or revoked Bearer API key. `error.code`: `UNAUTHENTICATED`, `INVALID_TOKEN`.
- `403`: APIErrorResponse — A link longer than 15 minutes needs the right to share this deck: the `decks:share` scope, on a deck the caller made or manages.
- `404`: APIErrorResponse — The resource does not exist or is outside the caller's scope. `error.code`: `NOT_FOUND`.
- `422`: RequestValidationErrorResponse — A path, query, header, or request-body field failed validation. `error.code`: `VALIDATION_FAILED`.
- `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`.

## Get Deck Content

`GET https://api.presentations.ai/api/v1/decks/{deck_id}/content`

Return a deck's ordered slides and document head in one read.

`version` says which shape to read: `v1` decks carry their markup in `document`
(and in `assembled_html` with `assembled=true`), `v2` decks in `slides[].data`.

**Path parameters**

- `deck_id` (string (uuid), required) — ID of the deck.

**Query parameters**

- `assembled` (boolean, optional, default `false`) — Also return a `v1` deck's reassembled markup in `assembled_html`.

**Responses**

- `200`: DeckContentResponse — Successful Response
- `401`: APIErrorResponse — Missing, malformed, expired, or revoked Bearer API key. `error.code`: `UNAUTHENTICATED`, `INVALID_TOKEN`.
- `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 — The resource does not exist or is outside the caller's scope. `error.code`: `NOT_FOUND`.
- `422`: RequestValidationErrorResponse — A path, query, header, or request-body field failed validation. `error.code`: `VALIDATION_FAILED`.
- `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`.

## Get Deck Outline

`GET https://api.presentations.ai/api/v1/decks/{deck_id}/outline`

Durable outline state for a generated deck.

**Path parameters**

- `deck_id` (string (uuid), required) — ID of the deck.

**Responses**

- `200`: ExternalDeckOutline — Successful Response
- `401`: APIErrorResponse — Missing, malformed, expired, or revoked Bearer API key. `error.code`: `UNAUTHENTICATED`, `INVALID_TOKEN`.
- `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 — The resource does not exist or is outside the caller's scope. `error.code`: `NOT_FOUND`.
- `422`: RequestValidationErrorResponse — A path, query, header, or request-body field failed validation. `error.code`: `VALIDATION_FAILED`.
- `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`.

## Generate Slide

`POST https://api.presentations.ai/api/v1/decks/slides`

Fill one slide layout with content and return the slide data. Nothing is saved.

Pick the layout in `selected_template` and pass its `elements`. The content is
`graphics_xml` when given (structured slide graphics, the same fill the app runs),
otherwise `heading` + `description` as plain text.

Costs one slide at the API tier's rate (Standard), refunded if the fill fails. Send a
`Request-Id` to retry safely: an ID that already paid is a 409.

**Header parameters**

- `Request-Id` (string, optional) — Retry key, the header `POST /decks` takes; a spent one is a 409.
- `Idempotency-Key` (string, optional) — Older name for `Request-Id`; still accepted.

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

**Responses**

- `200`: GeneratedSlide — Successful Response
- `401`: APIErrorResponse — Missing, malformed, expired, or revoked Bearer API key. `error.code`: `UNAUTHENTICATED`, `INVALID_TOKEN`.
- `403`: APIErrorResponse — The API key, workspace role, project scope, or plan lacks permission. `error.code`: `FORBIDDEN`, `FEATURE_NOT_IN_PLAN`, `PLAN_LIMIT_EXCEEDED`.
- `422`: RequestValidationErrorResponse — A path, query, header, or request-body field failed validation. `error.code`: `VALIDATION_FAILED`.
- `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`.

## Change Slide

`POST https://api.presentations.ai/api/v1/decks/slides/change`

Convert slide content onto a different graphic type and return the slide data.

Nothing is saved. Give the content and `target_template` (e.g. `chart`, with `subtype`
`line`); pass `elements` to fill a specific layout of that type.

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

**Responses**

- `200`: GeneratedSlide — Successful Response
- `401`: APIErrorResponse — Missing, malformed, expired, or revoked Bearer API key. `error.code`: `UNAUTHENTICATED`, `INVALID_TOKEN`.
- `403`: APIErrorResponse — The API key, workspace role, project scope, or plan lacks permission. `error.code`: `FORBIDDEN`, `FEATURE_NOT_IN_PLAN`, `PLAN_LIMIT_EXCEEDED`.
- `422`: RequestValidationErrorResponse — A path, query, header, or request-body field failed validation. `error.code`: `VALIDATION_FAILED`.
- `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`.

## List Grants

`GET https://api.presentations.ai/api/v1/decks/{deck_id}/grants`

List all active grants on a deck.

**Path parameters**

- `deck_id` (string (uuid), required) — ID of the deck.

**Responses**

- `200`: DeckGrantResponse[] — Successful Response
- `401`: APIErrorResponse — Missing, malformed, expired, or revoked Bearer API key. `error.code`: `UNAUTHENTICATED`, `INVALID_TOKEN`.
- `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 — The resource does not exist or is outside the caller's scope. `error.code`: `NOT_FOUND`.
- `422`: RequestValidationErrorResponse — A path, query, header, or request-body field failed validation. `error.code`: `VALIDATION_FAILED`.
- `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`.

## Create Grant

`POST https://api.presentations.ai/api/v1/decks/{deck_id}/grants`

Share a deck with one person, by user ID or email address, at the given role.

No email is sent: they see the deck when they sign in to Presentations.AI with that
address. If they already have access, their role is replaced, which can lower it.

**Path parameters**

- `deck_id` (string (uuid), required) — ID of the deck.

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

**Responses**

- `201`: DeckGrantResponse — Successful Response
- `401`: APIErrorResponse — Missing, malformed, expired, or revoked Bearer API key. `error.code`: `UNAUTHENTICATED`, `INVALID_TOKEN`.
- `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 — The resource does not exist or is outside the caller's scope. `error.code`: `NOT_FOUND`.
- `422`: RequestValidationErrorResponse — A path, query, header, or request-body field failed validation. `error.code`: `VALIDATION_FAILED`.
- `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`.

## Update Grant

`PATCH https://api.presentations.ai/api/v1/decks/{deck_id}/grants/{grant_id}`

Update the role on a deck grant.

**Path parameters**

- `grant_id` (string (uuid), required) — ID of the grant, from `GET /decks/{deck_id}/grants`.
- `deck_id` (string (uuid), required) — ID of the deck.

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

**Responses**

- `200`: DeckGrantResponse — Successful Response
- `401`: APIErrorResponse — Missing, malformed, expired, or revoked Bearer API key. `error.code`: `UNAUTHENTICATED`, `INVALID_TOKEN`.
- `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 — The resource does not exist or is outside the caller's scope. `error.code`: `NOT_FOUND`.
- `422`: RequestValidationErrorResponse — A path, query, header, or request-body field failed validation. `error.code`: `VALIDATION_FAILED`.
- `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`.

## Delete Grant

`DELETE https://api.presentations.ai/api/v1/decks/{deck_id}/grants/{grant_id}`

Delete a deck grant.

**Path parameters**

- `grant_id` (string (uuid), required) — ID of the grant, from `GET /decks/{deck_id}/grants`.
- `deck_id` (string (uuid), required) — ID of the deck.

**Responses**

- `204` — Successful Response
- `401`: APIErrorResponse — Missing, malformed, expired, or revoked Bearer API key. `error.code`: `UNAUTHENTICATED`, `INVALID_TOKEN`.
- `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 — The resource does not exist or is outside the caller's scope. `error.code`: `NOT_FOUND`.
- `422`: RequestValidationErrorResponse — A path, query, header, or request-body field failed validation. `error.code`: `VALIDATION_FAILED`.
- `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`.

## Get Share Link

`GET https://api.presentations.ai/api/v1/decks/{deck_id}/share-link`

Fetch the deck's active share link URL; 404 if link sharing is off.

**Path parameters**

- `deck_id` (string (uuid), required) — ID of the deck.

**Responses**

- `200`: ShareLink — Successful Response
- `401`: APIErrorResponse — Missing, malformed, expired, or revoked Bearer API key. `error.code`: `UNAUTHENTICATED`, `INVALID_TOKEN`.
- `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 — The resource does not exist or is outside the caller's scope. `error.code`: `NOT_FOUND`.
- `422`: RequestValidationErrorResponse — A path, query, header, or request-body field failed validation. `error.code`: `VALIDATION_FAILED`.
- `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`.

## Create Share Link

`POST https://api.presentations.ai/api/v1/decks/{deck_id}/share-link`

Enable the deck's share link and return its URL.

This makes the deck public: anyone with the link and every workspace member can view it.

Reuses the existing link so the URL is stable; pass `rotate=true` to mint a
fresh token (the previous URL stops working).

**Path parameters**

- `deck_id` (string (uuid), required) — ID of the deck.

**Query parameters**

- `rotate` (boolean, optional, default `false`) — Mint a new link; the previous URL stops working.

**Responses**

- `200`: ShareLink — Successful Response
- `401`: APIErrorResponse — Missing, malformed, expired, or revoked Bearer API key. `error.code`: `UNAUTHENTICATED`, `INVALID_TOKEN`.
- `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 — The resource does not exist or is outside the caller's scope. `error.code`: `NOT_FOUND`.
- `422`: RequestValidationErrorResponse — A path, query, header, or request-body field failed validation. `error.code`: `VALIDATION_FAILED`.
- `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`.

## Delete Share Link

`DELETE https://api.presentations.ai/api/v1/decks/{deck_id}/share-link`

Disable link-sharing for the deck.

A public deck returns to the visibility it had before the link, or to workspace when that
isn't known (links made before it was recorded, or a deck created public).

**Path parameters**

- `deck_id` (string (uuid), required) — ID of the deck.

**Responses**

- `204` — Successful Response
- `401`: APIErrorResponse — Missing, malformed, expired, or revoked Bearer API key. `error.code`: `UNAUTHENTICATED`, `INVALID_TOKEN`.
- `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 — The resource does not exist or is outside the caller's scope. `error.code`: `NOT_FOUND`.
- `422`: RequestValidationErrorResponse — A path, query, header, or request-body field failed validation. `error.code`: `VALIDATION_FAILED`.
- `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

### AsyncTaskStatus

Lifecycle state of an async task: CREATED (queued), RUNNING, then COMPLETED or FAILED.

One of: `CREATED`, `RUNNING`, `COMPLETED`, `FAILED`

### Capability

Fine-grained permission checked on every authorized action.

One of: `workspace.read`, `workspace.write`, `workspace.delete`, `ownership.transfer`, `billing.manage`, `billing.read`, `payment_method.manage`, `purchases.create`, `sso.manage`, `audit.read`, `activity.read`, `activity.update`, `members.read`, `members.write`, `invites.manage`, `invites.create`, `apikeys.manage`, `brand_kit.read`, `brand_kit.manage`, `brand_assets.read`, `brand_assets.manage`, `company.read`, `company.manage`, `credits.view`, `credits.manage`, `projects.read`, `projects.create`, `project.write`, `project.delete`, `project.members.read`, `project.members.write`, `project.knowledge.read`, `project.knowledge.write`, `project.knowledge.manage`, `deck.create`, `deck.read`, `deck.write`, `deck.delete`, `deck.comment`, `deck.share.manage`, `deck.analytics.read`, `joinrequests.manage`, `mcp.tools.list`, `mcp.tools.invoke`, `mcp.resources.list`, `mcp.resources.read`, `mcp.prompts.list`, `mcp.prompts.get`

### CreateDeckRequest

Create a deck and optionally run generation through final export.

The run covers outline -> slides -> export. A `text` source is raw text used
as source material, equivalent to an attached document but with no upload
or extraction step. Files-only generates from the attached documents;
extraction must have completed (409 otherwise).

A caller-authored `outline` skips outline generation and runs the supplied
structure directly through slides and export. It cannot be combined with a
prompt or document sources. Use `POST /outlines` for stateless preview and
review before creating a deck.

At least one generation input is required. Omitted name defaults to a
placeholder, replaced by the requested or authored title when available.

- `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.
- `name` (string, optional, max length 255, default `Untitled Presentation`) — Deck name shown in the workspace. Omitted: `deck_title`, else the outline's `documentTitle`, else the generated title.
- `visibility` (DeckVisibility, optional, default `WORKSPACE`) — Who can open the deck. `PROJECT` requires `project_id`; `PUBLIC` requires the `decks:share` scope.
- `project_id` (string (uuid), optional) — Project to create the deck in. Required for `PROJECT` visibility; a project-scoped API key must pass its own project.
- `deck_title` (string, optional, max length 255) — Requested presentation title. Alone it is enough to generate from; it also names the deck when `name` is omitted.
- `outline` (PresentationOutline, optional) — Caller-authored outline, e.g. an edited `POST /outlines` result. Skips outline generation; cannot be combined with `prompt` or sources. Its slides are billed at the deck's rate, even when `POST /outlines` already billed them.
- `company` (string, optional, max length 200) — Company the deck is about; seeds research and the outline's `companyName` instead of inferring it from the prompt.
- `creator_role` (string, optional, max length 1000) — Author's job title; sets background tone and research budget. Omitted: the API key owner's profile role.
- `model` (DeckGenerationModel, optional, default `STANDARD`) — Generation model tier, case-insensitive. A tier above the workspace plan's returns 403 `FEATURE_NOT_IN_PLAN`.
- `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. `1` yields one summary slide with no cover.
- `level_of_detail` (DeckLevelOfDetail, optional) — Text density per content item, case-insensitive. Omitted: adapted to the topic and content.
- `insider_content` (string, optional, max length 200000) — Private background facts about your organisation. Used where a slide calls for them, never cited; counts toward the plan content limit.
- `export_format` (DeckExportFormat, optional, default `PPTX`) — Format of the artifact exported when generation completes.
- `audience` (string, optional, max length 200) — Who the deck is for. Omitted: inferred from the prompt and sources, never asked back (the API run has no questions).
- `deck_purpose` (string, optional, max length 64) — Purpose id from the deck purpose taxonomy: pitch, sales, marketing, strategy, report, training, teaching, coursework, product, research, security, general.
- `brand_kit_id` (string (uuid), optional) — Style the deck as a brand: an `id` from `GET /brand-kits`. Omitted: no brand kit.
- `deep_search` (boolean, optional, default `false`) — Consultant-grade research and exhibit slides; doubles the deck's per-slide credits. Not applicable to an authored outline.
- `budget_tier` (`lite` \| `standard` \| `premium`, optional, default `standard`) — Quality tier: `lite`, `standard` (default) or `premium`, each billed at its own per-slide rate. An API run is always Fast: it never asks questions, at any tier.
- `missing_data` (`placeholder` \| `estimate`, optional) — A figure only you hold that nobody gave: `placeholder` leaves a `[DATA NEEDED: …]` marker; `estimate` writes a plausible estimate (recorded as one in the outline's figure check). Omitted: taken from what the prompt asks for ("use only my numbers" leaves markers), else `estimate`.
- `fidelity` (`retain` \| `condense` \| `context`, optional) — How source material is used: `retain` keeps its slides, `condense` keeps its sections and tightens them, `context` builds a new deck from it. Omitted: picked from the request and the material.
- `narrative` (string, optional, max length 64) — Narrative arc the storyline follows (e.g. `answer_first`, `what_why_how`). Omitted: the usual arc for the purpose and audience.
- `delivery` (`stage` \| `meeting` \| `video` \| `read` \| `print`, optional) — How the deck is shown: `stage` (a big screen), `meeting`, `video` (a call), `read` (sent and read alone) or `print`. Sets the words per slide.
- `use_case` (string, optional, max length 64) — Use case id from the create flow's list; routes the writer persona and the asks.
- `speaker_notes` (boolean, optional, default `false`) — Write presenter talking points for every slide.
- `company_domain` (string, optional, max length 255) — The company's web domain (e.g. `example.com`); with `company`, seeds research and the brand lookup.
- `graphic_types` (string[], optional, max 30 items) — Allow-list of body graphics the writer may use (e.g. `table`, `list`, `diagram`); anything else is redrawn as the closest allowed type.
- `diagram_subtypes` (string[], optional, max 30 items) — Allow-list of diagram shapes (e.g. `process`, `cycle`) when `diagram` is allowed.

### Deck

Deck response shape.

- `id` (string (uuid), required) — Deck id.
- `workspace_id` (string (uuid), required) — Workspace that owns the deck.
- `project_id` (string (uuid), required) — Project the deck belongs to; null for none.
- `source_deck_id` (string (uuid), optional)
- `legacy_deck_id` (string, optional) — Legacy `is_document.id` this deck was migrated from; null if authored in-app.
- `created_by` (string (uuid), required) — User id of the creator; null once that account is deleted.
- `name` (string, required) — Deck name.
- `visibility` (DeckVisibility, required) — Who can open the deck.
- `thumbnail_url` (string, optional) — Cover thumbnail URL (absolute on the external API); null before the first render.
- `thumbnails` (Thumbnail[], optional) — Every stored size of the same render, largest first (`thumbnails[0]` is `thumbnail_url`). Empty until the first render.
- `deck_url` (string, optional) — Opens the deck in the PresentationsAI app; requires signing in as a member with access. Not a public link: share one with `POST /decks/{deck_id}/share-link`. Set on the external API.
- `has_share_link` (boolean, optional, default `false`) — Whether a public share link is active for the deck.
- `archived_at` (string (date-time), required) — When archived; null if not archived.
- `deleted_at` (string (date-time), optional) — When moved to trash; null if not deleted.
- `created_at` (string (date-time), required) — Creation time.
- `updated_at` (string (date-time), required) — Last update time.
- `flags` (DeckFlagType[], optional) — The caller's own flags on this deck, e.g. `STARRED`.
- `version` (string, optional) — Active content version: v1 | v2 | null (authored in-app)
- `origin_version` (string, optional) — Version this deck was migrated from; null if authored in-app.
- `permissions` (DeckPermissions, optional) — Caller's resolved access; set on single-deck reads and the deck list.
- `shared_with_me` (boolean, optional) — Whether someone else shared the deck with the caller; always null on the external API.

### DeckContentResponse

A deck's slides in order plus the document head, in one read.

`version` tells the client which representation to render: `v1` reads the
legacy markup in `document`, `v2` reads the native editor model in
`slides[].data`. A ported deck has both populated, so the client can switch
without a round trip.

- `deck_id` (string (uuid), required)
- `version` (string, optional) — Active content version: v1 | v2 | null (authored in-app)
- `origin_version` (string, optional) — Version this deck was migrated from; null if authored in-app.
- `legacy_deck_id` (string, optional) — Legacy `is_document.id` this deck was migrated from; null if authored in-app.
- `root_attributes` (object, optional) — Deck-level legacy attributes (theme, font, footer settings).
- `legacy_head` (string, optional) — The legacy document's <head> markup, when the deck was migrated from v1.
- `manifest` (object, optional) — Migrated decks only: the legacy asset manifest, exactly as the legacy `/docs/getContent?fileName=manifest.json` served it — {slides: {<legacy slide id>: {elements: {...}}}} listing the shapes/icons/fonts/JS assets each slide's elements load. Always present on migrated decks ({slides: {}} when legacy had none); null for decks authored in-app.
- `slides` (DeckSlide[], required)
- `document` (object, optional) — v1 decks only: the deck in the legacy content.json shape — {id, rootAttributes, slides:[{id, content}]} keyed by legacy ids — so an existing v1 renderer consumes it unchanged. Null for v2. The markup lives here rather than being repeated in `slides[]`.
- `assembled_html` (string, optional) — v1 decks only: the reassembled legacy content.xml string, byte-compatible with the legacy endpoint. Populated only when requested with assembled=true.

### DeckDetailResponse

Deck metadata plus its latest generation state and previously produced artifacts.

- `id` (string (uuid), required) — Deck id.
- `workspace_id` (string (uuid), required) — Workspace that owns the deck.
- `project_id` (string (uuid), required) — Project the deck belongs to; null for none.
- `source_deck_id` (string (uuid), optional)
- `legacy_deck_id` (string, optional) — Legacy `is_document.id` this deck was migrated from; null if authored in-app.
- `created_by` (string (uuid), required) — User id of the creator; null once that account is deleted.
- `name` (string, required) — Deck name.
- `visibility` (DeckVisibility, required) — Who can open the deck.
- `thumbnail_url` (string, required) — Absolute cover thumbnail URL; null before the first render.
- `thumbnails` (Thumbnail[], required) — Every stored size of the same render, largest first (`thumbnails[0]` is `thumbnail_url`). Empty until the first render.
- `deck_url` (string, optional) — Opens the deck in the PresentationsAI app; requires signing in as a member with access. Not a public link: share one with `POST /decks/{deck_id}/share-link`. Set on the external API.
- `has_share_link` (boolean, optional, default `false`) — Whether a public share link is active for the deck.
- `archived_at` (string (date-time), required) — When archived; null if not archived.
- `deleted_at` (string (date-time), optional) — When moved to trash; null if not deleted.
- `created_at` (string (date-time), required) — Creation time.
- `updated_at` (string (date-time), required) — Last update time.
- `flags` (DeckFlagType[], optional) — The caller's own flags on this deck, e.g. `STARRED`.
- `version` (string, optional) — Active content version: v1 | v2 | null (authored in-app)
- `origin_version` (string, optional) — Version this deck was migrated from; null if authored in-app.
- `permissions` (DeckPermissions, optional) — Caller's resolved access; set on single-deck reads and the deck list.
- `shared_with_me` (boolean, optional) — Whether someone else shared the deck with the caller; always null on the external API.
- `status` (AsyncTaskStatus, required) — Status of the deck's latest generation; null when it was never generated.
- `exports` (ExternalDeckExportResponse[], required) — Previously produced artifacts with download URLs. This read never queues or creates an export.

### DeckExportFormat

Export artifact format: PPTX, PDF, or IMAGE (a ZIP with one image per slide).

One of: `PPTX`, `PDF`, `IMAGE`

### DeckFlagType

Kinds of per-user deck flag.

One of: `STARRED`

### DeckGenerationModel

Generation model tier, lowest to highest: STANDARD, PRO, ULTRA.

The workspace plan sets the highest tier it may use.

One of: `STANDARD`, `PRO`, `ULTRA`

### DeckGenerationRequestResponse

Public generation lifecycle keyed only by request ID and deck ID.

- `request_id` (string, required, max length 255) — Caller request ID used to safely replay this deck creation.
- `deck_id` (string (uuid), required) — Deck being generated.
- `status` (AsyncTaskStatus, required) — Durable lifecycle state for this request.
- `stage` (GenerationStage, required) — Current generation stage for progress display.
- `status_url` (string (uri), required) — Canonical URL to poll for this request.
- `deck_url` (string (uri), required) — Opens the deck in the PresentationsAI app; requires signing in as a member with access. Not a public link: share one with `POST /decks/{deck_id}/share-link`.
- `error` (string, required) — Sanitized terminal failure message; non-null only when status is FAILED.
- `created_at` (string (date-time), required) — When the request was accepted.
- `updated_at` (string (date-time), required) — Last change to status, stage or warnings.
- `warnings` (TaskWarning[], optional) — Nonterminal degradations encountered while generation continued.
- `export` (ExternalDeckExportResponse, optional) — Finished artifact; non-null after successful export persistence.

### DeckGrantResponse

Wire representation of a DeckGrant.

- `id` (string (uuid), required) — Grant id.
- `deck_id` (string (uuid), required) — Deck the grant applies to.
- `subject_type` (DeckGrantSubjectType, required) — `USER` for a user id, `EMAIL` for an email address.
- `subject_user_id` (string (uuid), optional) — Granted user; set for `USER` grants.
- `subject_email` (string, optional) — Granted email address; set for `EMAIL` grants.
- `subject` (UserInfo, optional) — Profile of the granted user; null for `EMAIL` grants.
- `role` (DeckGrantRole, required) — Granted access level.
- `granted_by` (string (uuid), required) — User who created the grant.
- `created_at` (string (date-time), required) — When the grant was created.
- `membership_status` (`member` \| `non_member` \| `pending_request` \| `invited`, optional) — Subject's standing with the workspace; set on create and list responses.
- `workspace_role` (WorkspaceRole, optional) — Member's role, or the role a pending invitation or join request asks for.

### DeckGrantRole

Per-deck grant role for sharing decks independently of project membership.

One of: `VIEW`, `COMMENT`, `EDIT`

### DeckGrantSubjectType

What kind of subject a deck grant targets.

One of: `USER`, `EMAIL`

### DeckGrantUpdate

Partial update of a deck grant.

- `role` (DeckGrantRole, optional) — New access level.

### DeckLevelOfDetail

Text density per content item.

BRIEF: label plus at most a short line. STANDARD: one sentence. DETAILED: 1-2
sentences. VERY_DETAILED: 2-3 sentences.

One of: `BRIEF`, `STANDARD`, `DETAILED`, `VERY_DETAILED`

### DeckPermissions

Caller's resolved access to one deck.

- `workspace_role` (WorkspaceRole, required) — Caller's workspace role; null when access comes only from a deck grant.
- `project_role` (ProjectRole, required) — Caller's effective role on the deck's project; null when none applies.
- `deck_grant_role` (DeckGrantRole, required) — Role from a per-deck grant to the caller; null without one.
- `is_creator` (boolean, required) — Whether the caller created the deck.
- `capabilities` (Capability[], required) — Actions the caller may perform on this deck, resolved from all roles above.

### DeckSessionStatus

Deck-generation lifecycle state.

One of: `DRAFT`, `OUTLINE_FINALIZED`

### DeckSlide

A slide's persisted content. Ordering lives in the deck document state.

- `id` (string (uuid), required)
- `deck_id` (string (uuid), required)
- `variation_name` (string, optional)
- `source` (SlideSource, required)
- `data` (object, required)
- `html_content` (string, optional)
- `created_at` (string (date-time), required)
- `updated_at` (string (date-time), required)
- `trace` (object, optional)

### DeckSort

Ordering for the deck list query.

One of: `RECENT`, `NAME`, `UPDATED`, `CREATED`

### DeckStreamAccepted

Deck generation was durably accepted.

- `type` (`accepted`, optional, default `accepted`) — Event discriminator.
- `deck` (GeneratedDeckResponse, required) — The accepted generation request.

### DeckStreamDetached

The bounded stream ended while durable generation continues.

- `type` (`detached`, optional, default `detached`) — Event discriminator.
- `request` (DeckGenerationRequestResponse, required) — Request state when the stream ended; poll its `status_url` to continue.
- `message` (string, optional, default `stream wait elapsed; continue polling request.status_url`) — Why the stream ended.

### DeckStreamStatus

Current durable generation request status.

- `type` (`status`, optional, default `status`) — Event discriminator.
- `request` (DeckGenerationRequestResponse, required) — Latest request state.

### DeckVisibility

Who can open a deck.

PROJECT: the project's members. PRIVATE: the creator and explicit grants.
WORKSPACE: any workspace member. PUBLIC: published.

One of: `PROJECT`, `PRIVATE`, `WORKSPACE`, `PUBLIC`

### ExportContentBase64

An export's file inlined as base64, for platforms that move files only inside JSON.

- `file_name` (string, required) — Suggested file name, with its extension.
- `content_type` (string, required) — MIME type of the file.
- `size_bytes` (integer, required) — Size of the decoded file in bytes.
- `data` (string, required) — The file's bytes, base64-encoded.

### ExportDownloadLink

An anonymous download link: anyone holding it can download the file until it expires.

- `download_url` (string, required) — Opens the file without a key; it can't be revoked.
- `expires_at` (string (date-time), required) — When the link stops working.

### ExportDownloadLinkRequest

Lifetime of an anonymous download link for one export.

- `expires_in` (integer, optional, ≥ 60, ≤ 604800, default `900`) — Seconds the link works for, up to 7 days. Longer than 15 minutes needs the right to share the deck (the `decks:share` scope, on a deck you made or manage).

### ExternalDeckExportResponse

External export artifact projection.

- `id` (string (uuid), required) — Export id.
- `deck_id` (string (uuid), required) — Deck the artifact was exported from.
- `format` (DeckExportFormat, required) — Artifact format.
- `content_type` (string, required) — MIME type of the artifact.
- `size_bytes` (integer, required) — Artifact size in bytes.
- `download_url` (string, required) — Absolute URL of the artifact bytes; authenticate with the same Bearer credential.
- `created_at` (string (date-time), required) — When the artifact was produced.

### ExternalDeckGrantCreate

Share a deck with one person; on the API this never changes workspace membership.

- `subject` (string, required, max length 255) — A user id, or an email address (creates an `EMAIL` grant).
- `role` (DeckGrantRole, required) — Access level to grant.

### ExternalDeckOutline

A generated deck's outline state, its tier in the API's `budget_tier` names.

- `deck_id` (string (uuid), required) — Deck the outline belongs to.
- `deck_session_id` (string (uuid), required) — Generation session holding the outline.
- `status` (DeckSessionStatus, required) — `OUTLINE_FINALIZED` once the outline is fixed for slide generation.
- `outline` (PresentationOutline, optional) — Latest working outline; null before one exists.
- `final_outline` (PresentationOutline, optional) — Outline slides were generated from; null until finalized.
- `tier` (`lite` \| `standard` \| `premium`, optional) — The tier the deck was built at: `lite`, `standard` or `premium`.

### 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).

### GeneratedDeckResponse

Accepted deck generation.

Carries no viewer URL: creating a deck never shares it. A public link is
opt-in through `POST /decks/{deck_id}/share-link`.

- `request_id` (string, required, max length 255) — Caller request ID used to safely replay this deck creation.
- `deck_id` (string (uuid), required) — Deck being generated.
- `status` (AsyncTaskStatus, required) — Durable lifecycle state for this request.
- `stage` (GenerationStage, required) — Current generation stage for progress display.
- `status_url` (string (uri), required) — Canonical URL to poll for this request.
- `deck_url` (string (uri), required) — Opens the deck in the PresentationsAI app; requires signing in as a member with access. Not a public link: share one with `POST /decks/{deck_id}/share-link`.
- `error` (string, required) — Sanitized terminal failure message; non-null only when status is FAILED.
- `created_at` (string (date-time), required) — When the request was accepted.
- `updated_at` (string (date-time), required) — Last change to status, stage or warnings.
- `warnings` (TaskWarning[], optional) — Nonterminal degradations encountered while generation continued.
- `export` (ExternalDeckExportResponse, optional) — Finished artifact; non-null after successful export persistence.

### GeneratedSlide

Stateless slide-generation result (external API — not persisted).

- `variation_name` (string, optional) — Template variation the content was filled into.
- `data` (object, required) — Filled element data for that variation.

### GenerationStage

Deck generation moves QUEUED, OUTLINE, SLIDES, EXPORT, then COMPLETED or FAILED.

One of: `QUEUED`, `OUTLINE`, `SLIDES`, `EXPORT`, `COMPLETED`, `FAILED`

### 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.

### Page_Deck_

- `data` (Deck[], required) — Items on this page.
- `page` (integer, required) — 1-based page number returned.
- `limit` (integer, required) — Maximum items per page.
- `total` (integer, required) — Items matching the filters across all pages.

### Page_ExternalDeckExportResponse_

- `data` (ExternalDeckExportResponse[], required) — Items on this page.
- `page` (integer, required) — 1-based page number returned.
- `limit` (integer, required) — Maximum items per page.
- `total` (integer, required) — Items matching the filters across all pages.

### 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.

### ProjectRole

Project membership role.

One of: `LEAD`, `EDITOR`, `VIEWER`

### RequestIdConflict

A request ID was replayed with content different from the original.

- `code` (`REQUEST_ID_CONFLICT`, required) — Stable machine-readable error code.
- `message` (string, required) — Sanitized human-readable explanation.
- `details` (RequestIdConflictDetails, required) — How to reconcile the conflict.
- `trace_id` (string, optional, max length 32) — Trace identifier to include when reporting an unexpected failure.

### RequestIdConflictDetails

Reconciliation information returned for a changed idempotent request.

- `deck_id` (string (uuid), required) — Deck created by the original request.
- `resolution` (`reuse_original_payload_or_increment_request_id_version`, required) — Resend the original body to replay, or use a new `Request-Id` for a new deck.

### RequestIdConflictResponse

Typed 409 response for a request-ID content conflict.

- `error` (RequestIdConflict, required) — The conflict error.

### ShareLink

Response carrying the full share URL (includes raw token).

Grows the access-control state additively so the share dialog can render its
current settings from the same call that gives it the URL. The password's
value is on `ShareLinkSettings`.

- `url` (string (uri), required) — Public viewer URL, including the share token.
- `password_set` (boolean, optional, default `false`) — Whether viewers must enter a password.
- `expires_at` (string (date-time), optional) — When the link stops working; null for no expiry.

### SlideChangeV8Request

Convert existing slide content onto a different graphic type (and subtype).

When the target needs data the content lacks (a chart with no numbers), the fill may look
it up on the web first.

- `content` (string, required, max length 20000) — Existing slide content to convert.
- `target_template` (string, required, max length 200) — Graphic type to convert to, e.g. `chart`.
- `subtype` (string, optional, max length 100) — Subtype of the target, e.g. `line`.
- `nodecount` (integer, optional, ≥ 1) — Number of items the target graphic should have.
- `char_range` (string, optional, max length 100) — Text length per item, e.g. `40-80`; used when `elements` is not given.
- `elements` (object[], optional) — Optional target layout elements (as on `POST /decks/slides`); without them the target is the bare graphic type.
- `language` (string, optional, max length 100, default `auto`) — Output language as an English name; `auto` follows the content.

### SlideFillRequest

Stateless slide fill (external API): one slide layout filled with content.

Content comes from `graphics_xml` when given, else from `heading` + `description` as
plain text; one of the two is required. The caller says where the slide sits in its deck.

- `selected_template` (string, required, max length 200) — Name of the slide layout to fill, e.g. `cfg-agenda-list-sequence-left-preset`.
- `elements` (object[], required) — The layout's elements, copied from its template definition: each has a `name`, an `assettype` (the kind of graphic, e.g. `agenda_slide`) and optional `taghint`, `*_range` character limits, `nodecount` (`ai_min` / `ai_max` / `default` item counts) and `menu`. The fill writes content for each one.
- `shape` (object, optional) — Optional per-graphic size of the content (item counts, text lengths) that tightens the layout's limits to it; ignored when `adapt_content` is true.
- `heading` (string, optional, max length 2000, default ``) — Slide title.
- `description` (string, optional, max length 20000, default ``) — Slide content as plain text.
- `subheading` (string, optional, max length 2000, default ``) — Slide subtitle.
- `speaker_notes` (string, optional, max length 5000, default ``) — Speaker notes kept with an in-app slide; the stateless `POST /decks/slides` fill ignores them.
- `language` (string, optional, max length 100, default `English`) — Output language as an English name.
- `graphics_xml` (string, optional, max length 40000, default ``) — The slide's content as structured `<graphics>` XML, the form a generated deck's outline carries; when present it is the only content used.
- `adapt_content` (boolean, optional, default `false`) — True when the layout does not exactly fit the content: the fill reshapes the content (item counts and lengths) to the layout instead of narrowing the layout.
- `total_slides` (integer, optional, ≥ 0, default `0`) — Slides in the caller's deck, with `slide_index`; 0 when unknown.
- `slide_index` (integer, optional, ≥ 0, default `0`) — This slide's 0-based position in the deck (with total_slides).
- `fidelity` (string, optional, max length 32) — How the deck uses the source: 'retain' or 'condense' fill the slide from the caller's own text — no item is added, merged or padded.

### SlideSource

How a slide was created.

One of: `AI`, `MANUAL`, `PPT_IMPORT`

### TaskWarning

A generation warning persisted on an async task.

- `message` (string, required, max length 500) — Sanitized description.
- `stage` (string, required, max length 100) — Pipeline step that degraded (free-form).
- `source` (string, required, max length 100) — Component that reported it (free-form).
- `retryable` (boolean, optional, default `false`) — Whether a retry of the generation may avoid it.
- `occurred_at` (string (date-time), required) — When the warning was recorded.

### 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.

### Thumbnail

One stored size of a rendered thumbnail; `width`/`height` feed `srcset`.

- `url` (string, required) — Image URL for this size.
- `width` (integer, required) — Width in pixels.
- `height` (integer, required) — Height in pixels.

### UpdateDeckRequest

Partial update of a deck. project_id=None keeps the current value.

`version` flips which content the app renders (`Deck.active_version`) —
never `origin_version`, which is immutable provenance. Only "v1"/"v2" are
accepted; the service layer rejects a flip to a version the deck has no
real materialized content for (see `deck_service.update`).

- `name` (string, optional, max length 255) — New name; omitted keeps it.
- `visibility` (DeckVisibility, optional) — New visibility; omitted keeps it. Changing it needs share-manage permission.
- `project_id` (string (uuid), optional) — Move the deck to this project; omitted or null keeps it.
- `version` (`v1` \| `v2`, optional) — Content version to render; must be one the deck has content for.

### UserInfo

Public profile of a referenced user.

- `id` (string (uuid), required) — User id.
- `display_name` (string, required) — Name shown for the user.
- `avatar_url` (string, required) — Avatar image URL; null when none is set.

### WorkspaceRole

Workspace membership role; higher roles subsume lower ones for hierarchy checks.

One of: `OWNER`, `ADMIN`, `MEMBER`, `GUEST`