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

> Create a reusable template from a saved generation. All its compositions are included.



## OpenAPI

````yaml /2026-10-22/openapi.json post /templates
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:
  /templates:
    post:
      tags:
        - Templates
      summary: Create a template
      description: >-
        Create a reusable template from a saved generation. All its compositions
        are included.
      operationId: CreateTemplate
      parameters:
        - in: header
          name: Idempotency-Key
          required: false
          description: >-
            Optional UUID for identical REST retries. Reuse the same key and
            body after a lost response.
          schema:
            type: string
            format: uuid
        - $ref: '#/components/parameters/MotionApiVersion'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties: false
              required:
                - title
                - generation_id
              properties:
                title:
                  type: string
                  maxLength: 120
                generation_id:
                  type: string
                  format: uuid
                  description: >-
                    Saved project version used as the source. Null when not
                    recorded.
                mode:
                  type: string
                  enum:
                    - style
                    - layout_and_style
                  default: layout_and_style
                instructions:
                  type: string
                  maxLength: 12000
            example:
              title: Product launch
              generation_id: 9d2f19e2-2366-46bd-8963-869c340f723a
      responses:
        '201':
          description: Saved resource
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MotionCreateVisualTemplateResponse'
              example:
                template:
                  id: launch-film
                  title: Product launch
                  kind: video
                  mode: style
                  editable: true
                  version_id: null
                  instructions: Use the saved layout and adapt the text to the new brief.
                  width: null
                  height: null
                  duration_seconds: null
                  preview_status: preparing
                  preview_url: null
                  thumbnail_url: null
                  brand_kit_id: null
                  default_brand_kit_available: true
                  generation_id: 9d2f19e2-2366-46bd-8963-869c340f723a
                  created_at: null
                  resource_url: /api/motion/templates/launch-film
        '400':
          description: Invalid input or cursor
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Credential invalid or revoked
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Missing scope, role, resource access or entitlement
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Resource not visible
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '409':
          description: Resource conflict. Fetch the latest state and retry.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '503':
          description: Service temporarily unavailable.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - MotionApiKey: []
        - MotionOAuth:
            - motion:sessions:read
            - motion:templates:write
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:
    MotionCreateVisualTemplateResponse:
      type: object
      properties:
        template:
          type: object
          properties:
            id:
              type: string
            title:
              type: string
            kind:
              type: string
              enum:
                - video
                - image
            mode:
              type: string
              enum:
                - style
                - layout_and_style
            editable:
              type: boolean
            version_id:
              type:
                - string
                - 'null'
            instructions:
              type: string
            width:
              type:
                - number
                - 'null'
            height:
              type:
                - number
                - 'null'
            duration_seconds:
              type:
                - number
                - 'null'
            preview_status:
              type: string
              enum:
                - preparing
                - ready
                - failed
            preview_url:
              anyOf:
                - type: string
                  format: uri
                - type: 'null'
            thumbnail_url:
              anyOf:
                - type: string
                  format: uri
                - type: 'null'
            brand_kit_id:
              anyOf:
                - type: string
                  format: uuid
                - type: 'null'
            default_brand_kit_available:
              type: boolean
            generation_id:
              anyOf:
                - type: string
                  format: uuid
                - type: 'null'
            created_at:
              anyOf:
                - type: string
                  format: date-time
                - type: 'null'
            resource_url:
              type: string
          required:
            - id
            - title
            - kind
            - mode
            - editable
            - version_id
            - instructions
            - width
            - height
            - duration_seconds
            - preview_status
            - preview_url
            - thumbnail_url
            - brand_kit_id
            - default_brand_kit_available
            - generation_id
            - created_at
            - resource_url
          additionalProperties: false
          description: >-
            Saved template, current version, source generation ID and preview
            status.
      required:
        - template
      additionalProperties: false
    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
  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.
    MotionOAuth:
      type: oauth2
      description: >-
        OAuth REST tokens use the full MCP audience, https://mcp.motion.so/mcp.
        Reauthorize existing connections to add scopes. Current workspace roles
        and resource permissions still apply.
      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.
            motion:connectors:read: >-
              Read available services, your private organization connections and
              allowed actions without secrets.
            motion:connectors:write: >-
              Connect and disconnect your private accounts inside the credential
              organization workspace.
            motion:templates:read: Read and preview accessible templates.
            motion:templates:write: Create, edit, share, and archive prompt templates.
            motion:sessions:read: Read permitted chats, job status and saved exports.
            motion:sessions:write: >-
              Create and steer Motion projects using organization workspace
              credits.
            motion:assets:read: Find and read permitted media library assets.
            motion:brand-kits:read: Read permitted brand kits.
            motion:brand-kits:write: Create and edit brand kits within current app permissions.
            motion:social:read: Read authorized social accounts and posts.
            motion:social:write: >-
              Draft, submit, approve and cancel posts within current app
              permissions.
            motion:assets:write: Create and complete reusable media library uploads.

````

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