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

# 8. Publish or schedule

> Posts the latest finished render (or video_url) now, or at `when`. Posts publicly. Publishing now counts toward the monthly publish limit (free 10, starter 100, creator 300, studio 800, enterprise unlimited).



## OpenAPI

````yaml https://lavendly.ai/openapi.json post /v1/workflows/{id}/publish
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/{id}/publish:
    parameters:
      - name: id
        in: path
        required: true
        description: Workflow id
        schema:
          type: string
    post:
      tags:
        - Create to publish
      summary: 8. Publish or schedule
      description: >-
        Posts the latest finished render (or video_url) now, or at `when`. Posts
        publicly. Publishing now counts toward the monthly publish limit (free
        10, starter 100, creator 300, studio 800, enterprise unlimited).
      operationId: publishVideo
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - channel_id
              properties:
                channel_id:
                  type: string
                  description: From GET /v1/channels
                caption:
                  type: string
                title:
                  type: string
                  description: Required for YouTube
                when:
                  type: string
                  format: date-time
                  description: Future time to schedule
                video_url:
                  type: string
                settings:
                  type: object
            example:
              channel_id: ch_...
              title: Ocean facts
              caption: Five things about the reef
      responses:
        '200':
          description: Published or publishing
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    enum:
                      - publishing
                      - published
                  post_id:
                    type: string
                  release_url:
                    type:
                      - string
                      - 'null'
                  adopted:
                    type: boolean
                  channel:
                    type: object
                  message:
                    type: string
        '202':
          description: Scheduled
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                  scheduled_post_id:
                    type: string
                  when:
                    type: string
                  channel:
                    type: object
                  message:
                    type: string
        '400':
          $ref: '#/components/responses/E400'
        '401':
          $ref: '#/components/responses/E401'
        '404':
          $ref: '#/components/responses/E404'
        '409':
          $ref: '#/components/responses/E409'
        '412':
          $ref: '#/components/responses/E412'
        '429':
          $ref: '#/components/responses/E429'
components:
  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: ...
    E404:
      description: >-
        workflow_not_found, node_not_found, job_not_found, channel_not_found,
        track_not_found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: workflow_not_found
              message: ...
    E409:
      description: no_video, workspace_unresolved, idempotency_in_flight
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: no_video
              message: ...
    E412:
      description: postiz_not_connected
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: postiz_not_connected
              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
  schemas:
    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
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: API key from Settings > API, e.g. lv_...

````