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

# Create an outline

Creates an outline, either from a topic (`prompt`) or from an existing video (`videoId`). Send exactly one of the two — never both. An outline is a stored, editable resource: generate chapters, review them, expand them into a script, then build a video. Counts against the account's video creation limit.

An outline is a stored, editable plan for a video. Creating one is the first step of the
[prompt → video flow](https://elai.readme.io/reference/prompt-to-video-walkthrough), and it replaces the retired
`POST /gpt/generate-outline`.

Send **either** `prompt` **or** `videoId`, never both:

* **`prompt`** — a topic, 8–400 characters after trimming. Use this to build something new.
* **`videoId`** — an existing video. Use this to plan changes against a video you already have.

The response is an empty outline with no chapters yet. Generate them with
[Generate chapters](https://elai.readme.io/reference/generate-outline-chapters).

> 🚧 This counts against your video creation limit
>
> Even though no video exists yet, outline creation consumes the same 8-hour rolling quota as
> `POST /videos` — 50 per 8 hours on free accounts, 1000 on paid, 6000 on Enterprise. A **429**
> here means the quota, not a rate limit.

`quizSettings` is optional and only shapes later quiz generation; you can also set it any time
with [Update an outline](https://elai.readme.io/reference/update-outline).

# 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."
          }
        }
      },
      "QuizSettings": {
        "type": "object",
        "description": "How future quiz generation should behave. Distinct from a draft's actual `quiz` object.",
        "properties": {
          "quizType": {
            "type": "string",
            "enum": [
              "single",
              "multiple",
              "true-false",
              "mixed"
            ]
          },
          "placement": {
            "type": "string",
            "enum": [
              "distributed",
              "end"
            ]
          },
          "count": {
            "type": "integer",
            "minimum": 0
          },
          "answersCount": {
            "type": "integer",
            "minimum": 2,
            "maximum": 6
          },
          "feedback": {
            "type": "boolean"
          }
        }
      }
    }
  },
  "security": [
    {
      "sec0": []
    }
  ],
  "paths": {
    "/outline": {
      "post": {
        "operationId": "create-outline",
        "summary": "Create an outline",
        "description": "Creates an outline, either from a topic (`prompt`) or from an existing video (`videoId`). Send exactly one of the two — never both. An outline is a stored, editable resource: generate chapters, review them, expand them into a script, then build a video. Counts against the account's video creation limit.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "oneOf": [
                  {
                    "title": "From a topic",
                    "required": [
                      "prompt"
                    ],
                    "properties": {
                      "prompt": {
                        "type": "string",
                        "minLength": 8,
                        "maxLength": 400,
                        "description": "Topic to generate from. Trimmed before validation; must be 8-400 characters."
                      },
                      "folderId": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "description": "Folder for the video built later. Defaults to the root."
                      },
                      "quizSettings": {
                        "$ref": "#/components/schemas/QuizSettings"
                      }
                    }
                  },
                  {
                    "title": "From an existing video",
                    "required": [
                      "videoId"
                    ],
                    "properties": {
                      "videoId": {
                        "type": "string",
                        "minLength": 1
                      },
                      "quizSettings": {
                        "$ref": "#/components/schemas/QuizSettings"
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The new outline id, as a **bare string** — not a JSON object, and not quoted.\n\nExpress labels it `text/html`; read the body as text and use it directly as `outlineId` in the calls that follow. Every other endpoint in this flow answers with JSON.",
            "content": {
              "text/html": {
                "schema": {
                  "type": "string",
                  "description": "24-char hex ObjectId."
                },
                "example": "66a1f0c2b7cd13032a9c6001"
              }
            }
          },
          "400": {
            "description": "Neither or both of `prompt`/`videoId` sent, or `prompt` is outside 8-400 characters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "message": "prompt length must be between 8 and 400 characters"
                }
              }
            }
          },
          "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
    }
  }
}
````