> ## 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 an automation

>  Requires motion:automations:write for OAuth tokens. API keys use the owner account permissions. Automation access must be enabled for the account and environment. See /guides/automations. Automations execute only with GVA; Claude supports reads, pause, and delete only.



## OpenAPI

````yaml /openapi.json post /automations
openapi: 3.1.0
info:
  title: Motion
  version: 1.0.0
  description: >-
    Create and edit videos with Motion through a prompt, optional attachments,
    and follow-up edits. New video jobs default to GVA standard. Motion Legacy
    requires eligible existing-account or administrator access. Use GET /engines
    for available choices. Manage owner-scoped automations, schedules, run
    history, and analytics. Automation execution is GVA-only and defaults to
    standard effort.
servers:
  - url: https://api.motion.so/api/motion
security:
  - MotionApiKey: []
paths:
  /automations:
    post:
      tags:
        - Automations
      summary: Create an automation
      description: ' Requires motion:automations:write for OAuth tokens. API keys use the owner account permissions. Automation access must be enabled for the account and environment. See /guides/automations. Automations execute only with GVA; Claude supports reads, pause, and delete only.'
      operationId: create_automation
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateAutomationRequest'
            example:
              name: Daily update
              prompt: Create a short daily title animation.
              trigger:
                type: schedule_recurring
                platform: schedule
                label: Every day
                source: Schedule
                intervalMinutes: 1440
              execution:
                engine: gva
                effort: standard
      responses:
        '201':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AutomationEnvelope'
        '400':
          description: Invalid input or cursor; read the error message.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AutomationError'
        '401':
          description: Missing, invalid, or wrong-audience credential.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AutomationError'
        '403':
          description: Missing OAuth scope, account automation access, or engine access.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AutomationError'
        '404':
          description: >-
            Unavailable environment, or automation/run not owned by this
            account.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AutomationError'
        '503':
          description: Temporarily unavailable; retry later.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AutomationError'
      security:
        - MotionApiKey: []
        - MotionOAuth:
            - motion:automations:write
components:
  schemas:
    CreateAutomationRequest:
      type: object
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 160
        prompt:
          type: string
          minLength: 1
          maxLength: 20000
          description: Self-contained instructions used for every future invocation.
        trigger:
          $ref: '#/components/schemas/AutomationTrigger'
        memory:
          $ref: '#/components/schemas/AutomationMemory'
        connectorPolicy:
          $ref: '#/components/schemas/AutomationConnectorPolicy'
        maxConcurrentRuns:
          type: integer
          minimum: 1
          maximum: 10
          default: 1
        maxRunsPerHour:
          type: integer
          minimum: 1
          maximum: 100
          default: 4
        execution:
          $ref: '#/components/schemas/AutomationExecution'
        outputKind:
          type: string
          enum:
            - video
            - text
            - auto
          default: video
      required:
        - name
        - prompt
        - trigger
      additionalProperties: false
      description: >-
        Creates an enabled automation. Defaults: GVA standard, memory
        {rememberProcessedItems:true,includePreviousRuns:5,compactAfterRuns:20},
        no connectors, one concurrent run and four runs per hour. Creation is
        not idempotent; do not blindly repeat a request after a lost response.
    AutomationEnvelope:
      type: object
      properties:
        automation:
          $ref: '#/components/schemas/Automation'
      required:
        - automation
      additionalProperties: false
    AutomationError:
      type: object
      properties:
        error:
          type: string
        message:
          type: string
      required:
        - error
        - message
      additionalProperties: false
    AutomationTrigger:
      type: object
      properties:
        type:
          type: string
          enum:
            - schedule_once
            - schedule_recurring
            - youtube_video_uploaded
            - twitch_stream_ended
            - kick_stream_ended
        platform:
          type: string
          enum:
            - schedule
            - youtube
            - twitch
            - kick
        label:
          type: string
          minLength: 1
          maxLength: 160
        source:
          type: string
          minLength: 1
          maxLength: 2000
          description: >-
            Use Schedule for schedules; otherwise a channel URL, handle, or
            YouTube channel ID.
        timezone:
          type: string
          maxLength: 100
          description: >-
            Display timezone. Recurring intervals use elapsed minutes, not
            wall-clock cron scheduling.
        intervalMinutes:
          type: integer
          minimum: 1
          maximum: 525600
          description: Required for recurring schedules.
        runAt:
          type: string
          format: date-time
          description: >-
            Required for one-time schedules. Include a UTC offset and choose a
            future timestamp.
      required:
        - type
        - platform
        - label
        - source
      additionalProperties: false
      description: >-
        Match platform to trigger type. Discover environment availability with
        GET /automations/capabilities.
    AutomationMemory:
      type: object
      properties:
        rememberProcessedItems:
          type: boolean
        includePreviousRuns:
          type: integer
          minimum: 0
          maximum: 20
        compactAfterRuns:
          type: integer
          minimum: 5
          maximum: 100
      required:
        - rememberProcessedItems
        - includePreviousRuns
        - compactAfterRuns
      additionalProperties: false
    AutomationConnectorPolicy:
      type: object
      properties:
        mode:
          type: string
          enum:
            - none
            - fixed
            - conditional
        onUnavailable:
          type: string
          enum:
            - block
            - run_without
        grants:
          type: array
          maxItems: 6
          items:
            $ref: '#/components/schemas/AutomationConnectorGrant'
      required:
        - mode
        - onUnavailable
        - grants
      additionalProperties: false
      description: >-
        Uses existing connected accounts and permissions; this request cannot
        connect an account or grant access.
    AutomationExecution:
      type: object
      properties:
        engine:
          type: string
          enum:
            - gva
          description: Automations execute only with GVA.
        effort:
          type: string
          enum:
            - standard
            - extended
          description: >-
            Defaults to standard. Motion Legacy efforts are unavailable for
            automations.
      required: []
      additionalProperties: false
      minProperties: 1
      description: >-
        Supply engine or effort. Engine changes use the new engine default when
        effort is omitted.
    Automation:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        enabled:
          type: boolean
        prompt:
          type: string
        trigger:
          type: object
          properties:
            type:
              type: string
            platform:
              type: string
            source:
              type: string
          required:
            - type
            - platform
            - source
          additionalProperties: true
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
        nextRunAt:
          type:
            - string
            - 'null'
          format: date-time
        runs:
          type: array
          items:
            $ref: '#/components/schemas/AutomationRun'
        memory:
          $ref: '#/components/schemas/AutomationMemory'
        connectorPolicy:
          $ref: '#/components/schemas/AutomationConnectorPolicy'
        maxConcurrentRuns:
          type: integer
        maxRunsPerHour:
          type: integer
      required:
        - id
        - name
        - enabled
        - prompt
        - trigger
        - createdAt
        - updatedAt
        - nextRunAt
        - runs
      additionalProperties: true
      description: >-
        Owner-scoped read view. Read responses can include additional saved
        context and history. Use the dedicated run-history endpoint for
        pagination. Read fields are not accepted as write inputs.
    AutomationConnectorGrant:
      type: object
      properties:
        connectorId:
          type: string
          enum:
            - github
            - notion
            - figma
            - google-drive
            - dropbox
            - getty
        access:
          type: string
          enum:
            - read
        resources:
          type: array
          maxItems: 50
          items:
            type: string
            minLength: 1
            maxLength: 2000
        condition:
          $ref: '#/components/schemas/AutomationConnectorCondition'
      required:
        - connectorId
        - access
        - resources
      additionalProperties: false
    AutomationRun:
      type: object
      properties:
        id:
          type: string
        status:
          type: string
          enum:
            - queued
            - running
            - completed
            - skipped
            - failed
            - blocked
        motionAgentChatId:
          type:
            - string
            - 'null'
          description: >-
            Null until a Motion chat is created. Open
            https://motion.so/agent?chat={motionAgentChatId} to inspect the run.
        queuedAt:
          type: string
          format: date-time
        startedAt:
          type:
            - string
            - 'null'
          format: date-time
        completedAt:
          type:
            - string
            - 'null'
          format: date-time
        attempt:
          type: integer
        resultSummary:
          type:
            - string
            - 'null'
        error:
          type:
            - string
            - 'null'
      required:
        - id
        - status
        - motionAgentChatId
        - queuedAt
      additionalProperties: true
      description: >-
        Read view can also include event context, logs, artifacts, and connector
        snapshots. An accepted or completed agent run is not proof of a
        downloadable video; inspect saved exports in its Motion chat.
    AutomationConnectorCondition:
      type: object
      properties:
        eventTypes:
          type: array
          items:
            type: string
            enum:
              - schedule_once
              - schedule_recurring
              - youtube_video_uploaded
              - twitch_stream_ended
              - kick_stream_ended
        payloadField:
          type: string
          maxLength: 200
        equals:
          type: string
          maxLength: 2000
      required: []
      additionalProperties: false
  securitySchemes:
    MotionApiKey:
      type: http
      scheme: bearer
      description: >-
        Motion API key (motion_ prefix), authenticated as its owner. Account and
        engine permissions still apply.
    MotionOAuth:
      type: oauth2
      description: >-
        OAuth token audience must be https://mcp.motion.so/mcp for REST. Tokens
        for restricted MCP profiles cannot be reused here. Existing grants
        require reauthorization to add automation scopes.
      flows:
        authorizationCode:
          authorizationUrl: https://mcp.motion.so/oauth/authorize
          tokenUrl: https://mcp.motion.so/oauth/token
          scopes:
            motion:automations:read: Read automation definitions, capabilities, runs, and analytics.
            motion:automations:write: Create, edit, delete, invoke, and retry automations.

````

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