---
agentTools:
  projectIndex: https://elai.readme.io/llms.txt
---

# Build a video from an outline

Turns the outline into a video. Every field is optional — omit them all for the default template, no brand kit, and the root folder. Counts against the account's video creation limit. Render the result with `POST /videos/render/{videoId}`.

Turns a finished outline into a video. Every field is optional — omit them all and you get the
default template, no brand kit, and the root folder.

This is the replacement for the retired `create-by-outline` enhancement.

## `mode`

| `mode`            | Result                                                                                                                     |
| :---------------- | :------------------------------------------------------------------------------------------------------------------------- |
| `video` (default) | Finished slides, ready to render immediately                                                                               |
| `story`           | Story-mode slides with empty header / sub-header / list / image placeholders, to fill in the story editor before rendering |

Quiz drafts always produce a finished silent slide regardless of `mode`.

## After building

The response is the created video. Render it with
[`POST /videos/render/{videoId}`](https://elai.readme.io/reference/render-video), which accepts the work and returns
immediately — watch for the `video_ready` or `video_error` [webhook](https://elai.readme.io/reference/webhooks-overview) rather
than expecting the render outcome in an HTTP response.

> 🚧 This counts against your video creation limit
>
> A **429** here is the 8-hour video quota, not a rate limit. Note that
> [Create an outline](https://elai.readme.io/reference/create-outline) already consumed one, so a single prompt-to-video run
> uses two.

`brandKitId` is validated before the video is built, so an invalid id fails the whole request
rather than producing an unbranded video.

# OpenAPI definition

````json
{
  "openapi": "3.1.0",
  "info": {
    "title": "Elai Public API",
    "version": "1.0",
    "description": "Every endpoint below is served under `https://apis.elai.io/api/v1`.\n\n## Authentication\n\nSend your workspace API token as a bearer token on every request:\n\n```\nAuthorization: Bearer <your-api-token>\n```\n\nGenerate and rotate the token in the Elai web app under **Settings → API**, or through\n`POST /generateToken`. The token is scoped to one **workspace** and authenticates as that\nworkspace's admin user — it is not tied to an individual person, and it carries admin rights\ninside that workspace.\n\nA request with a missing, unknown or revoked token gets a bare `401` with no response body.\n\n> **Organizations on the Unlimited plan cannot use the API.** Their requests are rejected with the\n> same bare `401` as an invalid token, with nothing to distinguish the two. If a valid, freshly\n> generated token returns `401` on every endpoint, check the plan first.\n\n## Errors\n\nFailures carry a JSON body of the shape `{ \"message\": \"...\" }`. Validation failures on the newer\nendpoints may add an `errors` array naming the offending fields. `401` is the exception: it has no\nbody at all.\n\nBoth render endpoints are **fire-and-forget** — they queue work and return immediately, so a\n`200` means \"accepted\", not \"rendered\". Render failures surface only through the `video_error`\nwebhook, never as an HTTP error on the call that started the render.\n\n## Scope\n\nThis reference is generated from the running code rather than maintained by hand, so it cannot\nquietly fall behind the API it describes. It documents 96 operations across the\n`/api/v1` surface.\n\nEndpoints are grouped by subject in the sidebar. If something you need is missing, or an endpoint\ndoes not behave as described here, tell us.\n\n---\n\n_Generated from `chore/web-4760/api-v1-reference-build` at `5289745d` on 2026-09-04._"
  },
  "servers": [
    {
      "url": "https://apis.elai.io/api/v1"
    }
  ],
  "components": {
    "securitySchemes": {
      "sec0": {
        "type": "apiKey",
        "in": "header",
        "name": "Authorization",
        "x-bearer-format": "bearer",
        "x-default": "SECRET_KEY"
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string",
            "description": "Human-readable explanation of the failure."
          }
        }
      }
    }
  },
  "security": [
    {
      "sec0": []
    }
  ],
  "paths": {
    "/outline/{outlineId}/video": {
      "post": {
        "operationId": "build-outline-video",
        "summary": "Build a video from an outline",
        "description": "Turns the outline into a video. Every field is optional — omit them all for the default template, no brand kit, and the root folder. Counts against the account's video creation limit. Render the result with `POST /videos/render/{videoId}`.",
        "parameters": [
          {
            "name": "outlineId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Id of the outline."
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "templateId": {
                    "type": "string",
                    "description": "Template to take slide visuals from. Must be published."
                  },
                  "folderId": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "brandKitId": {
                    "type": "string",
                    "description": "Validated before the video is built; an invalid id fails the request."
                  },
                  "mode": {
                    "type": "string",
                    "enum": [
                      "video",
                      "story"
                    ],
                    "default": "video",
                    "description": "`video` produces finished slides ready to render. `story` produces story-mode slides with empty header / sub-header / list / image placeholders to fill in first. Quiz drafts always produce a finished silent slide regardless of `mode`."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The video built from the outline.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "videoId": {
                      "type": "string",
                      "description": "Pass this to `POST /videos/render/{videoId}`."
                    },
                    "feedbackContexts": {
                      "type": "object",
                      "additionalProperties": true,
                      "description": "Opaque, short-lived identifiers for the generation. Safe to ignore."
                    }
                  },
                  "required": [
                    "videoId"
                  ]
                },
                "example": {
                  "videoId": "66a1f0c2b7cd13032a9c6002"
                }
              }
            }
          },
          "400": {
            "description": "Invalid `mode`, unknown brand kit, or an unknown field was included.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "message": "Invalid enum value"
                }
              }
            }
          },
          "404": {
            "description": "No outline with that id in the caller's account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "message": "Outline not found"
                }
              }
            }
          },
          "429": {
            "description": "Video creation limit for the account reached (rolling 8-hour window).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "message": "You have reached the limit of 1000 videos per last 8 hours, please try again later"
                }
              }
            }
          }
        },
        "tags": [
          "Outline"
        ]
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "tags": [
    {
      "name": "Outline",
      "description": "The prompt-to-video flow: create an outline, generate chapters, script and quizzes, then build a video from it."
    }
  ],
  "_id": {
    "buffer": {
      "0": 106,
      "1": 154,
      "2": 229,
      "3": 101,
      "4": 201,
      "5": 178,
      "6": 243,
      "7": 252,
      "8": 223,
      "9": 58,
      "10": 69,
      "11": 151
    }
  }
}
````