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

# Create a session

> Deprecated: use /projects for new integrations. This route remains callable with its existing single-video arguments and response contract. No removal date is scheduled.



## OpenAPI

````yaml /2026-10-22/openapi.json post /sessions
openapi: 3.1.0
info:
  title: Motion
  version: '2026-10-22'
  description: >-
    Motion 2026-10-22 (legacy) REST API — original contract retained for
    existing integrations. Pass Motion-API-Version: 2026-10-22 (legacy) to
    select this contract explicitly.
servers:
  - url: https://api.motion.so/api/motion
security:
  - MotionApiKey: []
tags:
  - name: Projects
  - name: Exports
  - name: Library
  - name: Templates
  - name: Brand kits
  - name: Connectors
    description: Connect services and control the actions a project may use.
  - name: Automations
  - name: Social posting
  - name: Deprecated (/sessions)
    description: >-
      Earlier single-video endpoints kept callable for existing 2026-10-22
      integrations. Use Projects on 2026-11-19 for new integrations.
paths:
  /sessions:
    post:
      tags:
        - Deprecated (/sessions)
      summary: Create a session
      description: >-
        Deprecated: use /projects for new integrations. This route remains
        callable with its existing single-video arguments and response contract.
        No removal date is scheduled.
      operationId: createMotionSession
      parameters:
        - $ref: '#/components/parameters/MotionApiVersion'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateMotionSessionRequest'
            examples:
              basic:
                value:
                  prompt: Create a 20-second launch video.
              withReferences:
                value:
                  prompt: Create a short event recap video.
                  aspect_ratio: '9:16'
                  duration: 30s-1min
                  design_md:
                    filename: DESIGN.md
                    content: >-
                      # Design System


                      Use a dark editorial canvas, crisp white type, and cobalt
                      accent lines.
                    jsonFilename: style-extraction.json
                    jsonContent: '{"taste_dna":{"mood":"editorial precision"}}'
                  style_reference_url: https://www.youtube.com/watch?v=EXAMPLE_ID
                  attachments:
                    - url: https://storage.example.com/signed/hero-image.png
                      name: Hero image
                      type: image
                      content_type: image/png
      responses:
        '202':
          description: Job accepted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateMotionSessionResponse'
              example:
                job_id: 4f20dcdd-f63b-4898-97d6-2e05c0d37c78
                status: queued
                status_url: >-
                  https://api.motion.so/api/motion/sessions/4f20dcdd-f63b-4898-97d6-2e05c0d37c78
                chat_url: >-
                  https://motion.so/agent?chat=4f20dcdd-f63b-4898-97d6-2e05c0d37c78
                engine: gva
                effort: standard
                template: null
          headers:
            Deprecation:
              description: Deprecation date as a structured timestamp.
              schema:
                type: string
              example: '@1794441600'
            Link:
              description: Project API successor, with rel="successor-version".
              schema:
                type: string
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          headers:
            Deprecation:
              description: Deprecation date as a structured timestamp.
              schema:
                type: string
              example: '@1794441600'
            Link:
              description: Project API successor, with rel="successor-version".
              schema:
                type: string
        '401':
          description: Missing or invalid Motion API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          headers:
            Deprecation:
              description: Deprecation date as a structured timestamp.
              schema:
                type: string
              example: '@1794441600'
            Link:
              description: Project API successor, with rel="successor-version".
              schema:
                type: string
        '402':
          description: >-
            Insufficient Motion credits. Purchase credits or configure auto
            top-ups in the Motion frontend at https://motion.so.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InsufficientCreditsError'
          headers:
            Deprecation:
              description: Deprecation date as a structured timestamp.
              schema:
                type: string
              example: '@1794441600'
            Link:
              description: Project API successor, with rel="successor-version".
              schema:
                type: string
        '403':
          description: >-
            The account lacks access to the selected or persisted engine. No
            generation starts.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error: engine_access_required
                message: >-
                  Your account does not have access to this engine. Use
                  list_engines or GET /engines to see available engines.
          headers:
            Deprecation:
              description: Deprecation date as a structured timestamp.
              schema:
                type: string
              example: '@1794441600'
            Link:
              description: Project API successor, with rel="successor-version".
              schema:
                type: string
      deprecated: true
      security:
        - MotionApiKey: []
components:
  parameters:
    MotionApiVersion:
      name: Motion-API-Version
      in: header
      required: false
      description: >-
        Optional API version override for this request. When omitted, Motion
        uses the API version pinned to your API key or OAuth connection.
      schema:
        type: string
        enum:
          - '2026-10-22'
        default: '2026-10-22'
      example: '2026-10-22'
  schemas:
    CreateMotionSessionRequest:
      type: object
      description: >-
        Creates a durable video job owned by the API key user. Requires
        available Motion credits on that user's account. Credits and auto
        top-ups are managed at https://motion.so, not through the API.
      required:
        - prompt
      additionalProperties: false
      properties:
        prompt:
          type: string
          minLength: 1
          maxLength: 12000
        aspect_ratio:
          $ref: '#/components/schemas/MotionAspectRatio'
        duration:
          $ref: '#/components/schemas/MotionDurationBucket'
        design_system_id:
          $ref: '#/components/schemas/MotionDesignSystemId'
        design_md:
          description: >-
            Pro/Max custom DESIGN.md content, optionally with a companion style
            extraction JSON artifact. If both design_system_id and design_md are
            sent, design_md content is used.
          anyOf:
            - type: string
              minLength: 1
              maxLength: 200000
            - $ref: '#/components/schemas/MotionDesignMd'
        style_reference_url:
          type: string
          format: uri
          maxLength: 2048
          description: Optional YouTube style reference URL.
        attachments:
          type: array
          maxItems: 100
          items:
            $ref: '#/components/schemas/MotionAttachment'
        engine:
          type: string
          description: Video engine.
        effort:
          type: string
          enum:
            - standard
            - extended
            - light
            - medium
            - high
          description: Project effort, fixed at creation. Defaults to standard.
        mode:
          type: string
          enum:
            - light
            - medium
            - high
          deprecated: true
          description: Alias for effort.
        template:
          type: string
          description: >-
            Identifier from the selected engine template catalog. Set at
            creation; requires Pro or Max.
    CreateMotionSessionResponse:
      type: object
      required:
        - job_id
        - status
        - status_url
      properties:
        job_id:
          type: string
        status:
          type: string
          enum:
            - queued
        status_url:
          type: string
          format: uri
          description: >-
            Authenticated public API polling URL for GET /sessions/{job_id}.
            This is not a Motion app page.
        chat_url:
          type:
            - string
            - 'null'
          format: uri
          description: >-
            Motion app chat URL for a human to open, inspect, or continue the
            run. Null only for legacy flows where no chat is available.
        engine:
          type:
            - string
            - 'null'
          description: Null when engine details are unavailable to this account.
        effort:
          type:
            - string
            - 'null'
          enum:
            - standard
            - extended
            - light
            - medium
            - high
            - null
          description: Project effort, fixed at creation. Defaults to standard.
        template:
          type:
            - string
            - 'null'
    ErrorResponse:
      type: object
      description: >-
        Error bodies are JSON. Check the HTTP status first. Permission and
        validation errors use error; service errors may use detail. Optional
        fields explain how to correct the request.
      anyOf:
        - required:
            - error
        - required:
            - detail
      properties:
        error:
          type: string
          description: Error code or readable explanation.
        detail:
          type: string
          description: Readable explanation from the service.
        message:
          type: string
          description: Readable explanation accompanying an error code.
        error_description:
          type: string
          description: Authentication or permission explanation.
        required_scope:
          type: string
          description: Permission required by this operation.
        details:
          type: array
          description: Invalid request fields. Each issue includes a path and message.
          items:
            type: object
            properties:
              code:
                type: string
              path:
                type: array
                items:
                  oneOf:
                    - type: string
                    - type: integer
              message:
                type: string
        issues:
          type: array
          description: Service validation issues.
          items:
            type: object
    InsufficientCreditsError:
      type: object
      required:
        - error
      properties:
        error:
          type: string
          const: insufficient_credits
        code:
          type: string
        message:
          type: string
        minimum_required_credits:
          type: number
        current_balance:
          type: number
      description: >-
        Returned when the API key owner's account does not have enough Motion
        credits. Purchase credits or configure auto top-ups in the Motion
        frontend at https://motion.so.
    MotionAspectRatio:
      type: string
      enum:
        - '16:9'
        - '9:16'
        - '1:1'
        - '4:5'
        - '21:9'
      description: Target video aspect ratio.
    MotionDurationBucket:
      type: string
      enum:
        - <10s
        - 10-30s
        - 30s-1min
        - 1-5min
      description: Target video duration bucket.
    MotionDesignSystemId:
      type: string
      enum:
        - mosaic
        - apple
        - claude
        - cursor
        - linear
        - vercel
        - stripe
        - figma
        - notion
        - spotify
        - supabase
        - raycast
        - framer
        - resend
        - mintlify
        - sentry
        - tesla
        - nike
        - shopify
        - airbnb
        - posthog
      description: Pro/Max built-in DESIGN.md preset to apply.
    MotionDesignMd:
      type: object
      required:
        - content
      additionalProperties: false
      properties:
        filename:
          type: string
          minLength: 1
          maxLength: 255
          default: DESIGN.md
        sourceUrl:
          type: string
          maxLength: 2048
          description: Optional source website URL for imported style extraction context.
        content:
          type: string
          minLength: 1
          maxLength: 200000
          description: >-
            Pro/Max markdown design system guidance saved as DESIGN.md for the
            job.
        jsonFilename:
          type: string
          minLength: 1
          maxLength: 255
          default: style-extraction.json
          description: Optional companion style extraction JSON filename.
        jsonContent:
          type: string
          minLength: 1
          maxLength: 200000
          description: >-
            Optional structured style extraction JSON saved alongside DESIGN.md
            for agent context.
    MotionAttachment:
      type: object
      required:
        - url
      additionalProperties: false
      properties:
        url:
          type: string
          format: uri
          maxLength: 4096
          description: Publicly accessible signed URL.
        name:
          type: string
          minLength: 1
          maxLength: 240
        type:
          type: string
          enum:
            - image
            - video
            - audio
            - file
        content_type:
          type: string
          minLength: 1
          maxLength: 160
  securitySchemes:
    MotionApiKey:
      type: http
      scheme: bearer
      description: >-
        A Motion API key. Access is limited to its stored organization,
        workspace, scopes and the creator’s current permissions.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.