> ## Documentation Index
> Fetch the complete documentation index at: https://docs.lavendly.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# 1. Create a workflow from shots

> Free. A workflow is one video. Pass shots and the server builds the scenes. Filed into project_name (created if missing) or project_id.



## OpenAPI

````yaml https://lavendly.ai/openapi.json post /v1/workflows
openapi: 3.1.0
info:
  title: Lavendly API
  version: 1.1.0
  description: >-
    The Lavendly v1 API: build a video from shots, price it, generate the
    scenes, render the film, and publish it. Authenticate with a Bearer API key
    (lv_...) from Settings > API. Rate limits are per account per minute: 20
    writes, 60 render polls, 120 other reads; a 429 carries Retry-After and
    retry_after_ms. Errors are { error: { code, message } }; 5xx adds a ref. The
    same API is an MCP server at https://mcp.lavendly.ai/mcp and in the
    @lavendly/mcp npm package.
  contact:
    name: Lavendly
    email: hello@lavendly.ai
servers:
  - url: https://lavendly.ai/api
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Create to publish
    description: The main loop, in order.
  - name: Workflows
  - name: Edit
  - name: Audio
  - name: Assets
  - name: Renders
  - name: Account
  - name: Single clips
paths:
  /v1/workflows:
    post:
      tags:
        - Create to publish
      summary: 1. Create a workflow from shots
      description: >-
        Free. A workflow is one video. Pass shots and the server builds the
        scenes. Filed into project_name (created if missing) or project_id.
      operationId: createWorkflow
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - name
              properties:
                name:
                  type: string
                  description: Display name
                description:
                  type: string
                shots:
                  type: array
                  description: One entry per scene
                  items:
                    type: object
                    required:
                      - prompt
                    properties:
                      prompt:
                        type: string
                      duration:
                        type: number
                        description: Seconds
                aspect:
                  type: string
                  description: 9:16 or 16:9 for compiled shots
                videoModel:
                  type: string
                  description: Video model for compiled shots (default auto)
                project_name:
                  type: string
                  description: File into this project, creating it if needed
                project_id:
                  type: string
                  description: File into this exact project
                nodes:
                  type: array
                  description: Raw canvas nodes instead of shots
                edges:
                  type: array
                  description: Raw canvas edges
            example:
              name: Ocean facts
              project_name: API
              aspect: '9:16'
              shots:
                - prompt: Slow push-in on a coral reef at dawn
                  duration: 6
                - prompt: A sea turtle glides past the camera
                  duration: 6
      responses:
        '200':
          description: The saved workflow
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Workflow'
        '400':
          $ref: '#/components/responses/E400'
        '401':
          $ref: '#/components/responses/E401'
        '413':
          $ref: '#/components/responses/E413'
        '429':
          $ref: '#/components/responses/E429'
components:
  schemas:
    Workflow:
      type: object
      properties:
        id:
          type: string
          description: wf_...
        name:
          type: string
        description:
          type: string
        project_id:
          type:
            - string
            - 'null'
        nodes:
          type: array
        edges:
          type: array
        duration:
          type:
            - number
            - 'null'
        created_at:
          type: integer
        updated_at:
          type: integer
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
            message:
              type: string
            ref:
              type: string
              description: '5xx only: quote to support'
            retry_after_ms:
              type: integer
              description: 429 rate_limited only
  responses:
    E400:
      description: Bad request (invalid_args, invalid_edits, invalid_split, video_too_long)
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: invalid_args
              message: ...
    E401:
      description: Missing or revoked key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: unauthenticated
              message: ...
    E413:
      description: file_too_large, storage_full, workflow_too_large
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: file_too_large
              message: ...
    E429:
      description: >-
        rate_limited (per minute; see Retry-After), publish_limit (monthly),
        free_ops_cap, render_busy
      headers:
        Retry-After:
          schema:
            type: integer
          description: Seconds to wait
        X-Lavendly-RateLimit-Limit:
          schema:
            type: integer
        X-Lavendly-RateLimit-Remaining:
          schema:
            type: integer
        X-Lavendly-RateLimit-Reset:
          schema:
            type: integer
          description: Unix seconds
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: rate_limited
              message: Rate limit exceeded for mutation requests. Retry in ~12s.
              retry_after_ms: 11480
              limit: 20
              window_seconds: 60
              class: mutation
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: API key from Settings > API, e.g. lv_...

````