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

# Import Motion

> Create a reusable Motion from an official Viggle motion template.

Copies the official template identified by `template_id` into a Motion asset owned by the calling principal.

<Note>
  **Pricing** (1 credit = \$0.01): **1 credit per second** of the source template's duration, with a minimum of **1 credit**. See [Pricing and retention](/v1/pricing#import-motion).
</Note>

## Request parameters

Send a JSON body.

| Parameter | Type | Required | Default | Description |
| - | - | :-: | - | - |
| `template_id` | string | One of | — | ID of the official Viggle motion template to copy into the caller's assets. Preferred for new integrations; supply either this field or `template_uuid`. |
| `template_uuid` | string | One of | — | Backward-compatible alias for `template_id`. Supply one template identifier rather than sending both fields. |
| `name` | string | No | `Imported: ` + first 8 characters of the template ID | Optional display label for the imported Motion. When omitted, the service derives the default from the selected template ID. |
| `model` | string | No | `V3_Preview` | Render model associated with the imported motion: `V3_Preview` or `V4_BaseSG`; `V4_Preview` is accepted as a backward-compatible alias for `V4_BaseSG`. |

Send `template_id` in new integrations; unknown properties are ignored.

## Response parameters

Returns `200 OK`. Only `id` and `status` carry information here; `name` and `created_at` are populated from [Get Motion](/v1/api-reference/motions/get). See [Create Motion](/v1/api-reference/motions/create) for the field-by-field definition of the full Motion object.

```json theme={null}
{"id":"mot_550e8400-e29b-41d4-a716-446655440000","status":"queued","name":"","progress":0,"capabilities":[],"created_at":null,"completed_at":null,"error":null,"type":"render","vsplat":null,"glb":null}
```

## Examples

<CodeGroup>
  ```go Go theme={null}
  payload := strings.NewReader(`{"template_id":"YOUR_TEMPLATE_ID","name":"Campaign dance"}`)
  req, _ := http.NewRequest("POST", "https://apis.viggle.ai/v1/motions/import", payload)
  req.Header.Set("Authorization", "Bearer "+os.Getenv("VIGGLE_API_KEY")); req.Header.Set("Content-Type", "application/json")
  resp, err := http.DefaultClient.Do(req); if err != nil { panic(err) }; defer resp.Body.Close()
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch("https://apis.viggle.ai/v1/motions/import", {method:"POST", headers:{Authorization:`Bearer ${process.env.VIGGLE_API_KEY}`,"Content-Type":"application/json"}, body:JSON.stringify({template_id:"YOUR_TEMPLATE_ID",name:"Campaign dance"})});
  const motion = await response.json();
  ```

  ```python Python theme={null}
  import os, requests
  response = requests.post("https://apis.viggle.ai/v1/motions/import", headers={"Authorization":f"Bearer {os.environ['VIGGLE_API_KEY']}"}, json={"template_id":"YOUR_TEMPLATE_ID","name":"Campaign dance"})
  response.raise_for_status(); motion = response.json()
  ```

  ```bash cURL theme={null}
  curl -X POST "https://apis.viggle.ai/v1/motions/import" -H "Authorization: Bearer $VIGGLE_API_KEY" -H "Content-Type: application/json" -d '{"template_id":"YOUR_TEMPLATE_ID","name":"Campaign dance"}'
  ```
</CodeGroup>


## OpenAPI

````yaml openapi.yaml POST /v1/motions/import
openapi: 3.0.3
info:
  title: Viggle API
  description: Generate AI-powered character animation videos
  version: 2.0.0
  contact:
    name: Viggle Support
    url: https://viggle.ai
servers:
  - url: https://apis.viggle.ai
    description: Production server
security:
  - bearerAuth: []
tags:
  - name: Renders
    description: Prepare inputs, create renders, observe progress, and retrieve results.
  - name: Credits
    description: Read the credit balance available to the calling principal.
  - name: Characters
    description: |
      Create, list, inspect, and delete reusable character assets. `type`
      selects whether creation also extracts a 3D vsplat; export its
      download URL separately once ready.
  - name: Motions
    description: |
      Create, list, inspect, and delete reusable motion assets, and import one
      from an official motion template. `type` selects whether creation also
      extracts or generates a 3D animation; export its download URL
      separately once ready.
  - name: Videos
    description: >
      Generate a MiniMax H3 video from text, frames, or references (`vid_`

      prefix) or a character-animation video from a character image and/or
      driving video

      (`anim_` prefix), and read the unified view over every video the

      caller owns — H3 generations, character-animation generations, and

      character+motion Renders (`render_` prefix) — merged into one

      resource.
  - name: Images
    description: |
      Viggle Image — generate 1–6 PNG images from a text prompt with the
      `qwen` model, optionally guided by up to 8 reference images
      (`img_` prefix), and retrieve them by ID.
paths:
  /v1/motions/import:
    post:
      tags:
        - Motions
      summary: Import an official motion template as a motion asset
      description: |
        Copies the official template identified by `template_id` into a motion
        asset owned by the calling principal. Browse the available templates
        with `GET /v1/motion-templates`.
      operationId: importMotion
      parameters:
        - $ref: '#/components/parameters/RequestId'
        - $ref: '#/components/parameters/SourceChannel'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ImportMotionRequest'
      responses:
        '200':
          description: |
            Motion queued. Only `id` and `status` carry information here;
            `name` and `created_at` are populated from
            `GET /v1/motions/{motion_id}`.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/RequestId'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Asset'
        '400':
          $ref: '#/components/responses/ResourceBadRequest'
        '401':
          $ref: '#/components/responses/ResourceUnauthorized'
        '402':
          $ref: '#/components/responses/ResourcePaymentRequired'
        '404':
          $ref: '#/components/responses/ResourceNotFound'
        '500':
          $ref: '#/components/responses/ResourceInternalServerError'
        '503':
          $ref: '#/components/responses/ResourceServiceUnavailable'
components:
  parameters:
    RequestId:
      name: X-Request-Id
      in: header
      required: false
      description: >-
        Optional caller-supplied correlation ID, up to 128 characters. The
        service returns the effective value in the response header for tracing
        and support.
      schema:
        type: string
        minLength: 1
        maxLength: 128
    SourceChannel:
      name: X-Viggle-Source
      in: header
      required: false
      description: >-
        Optional source-channel label, up to 128 characters, used to attribute
        traffic to an SDK, integration, product surface, or internal workflow.
      schema:
        type: string
        minLength: 1
        maxLength: 128
  schemas:
    ImportMotionRequest:
      description: |
        `template_uuid` is an accepted alias for `template_id`; supply one of
        them. Unknown properties are ignored. Costs 1 credit per second of
        the source template's duration, with a minimum of 1 credit.
      type: object
      anyOf:
        - required:
            - template_id
        - required:
            - template_uuid
      properties:
        template_id:
          type: string
          description: >-
            ID of the official Viggle motion template to copy into the caller's
            assets. Supply either this field or `template_uuid`.
          minLength: 1
        template_uuid:
          type: string
          description: >-
            Backward-compatible alias for `template_id`. Supply one identifier
            field, not both.
          minLength: 1
        name:
          description: >-
            Optional display name for the imported Motion. When omitted, it
            defaults to `Imported: ` followed by the first eight characters of
            the template ID.
          type: string
        model:
          description: >-
            Render model associated with the imported motion. Choose
            `V3_Preview` or `V4_BaseSG`; `V4_Preview` is accepted as a
            backward-compatible alias for `V4_BaseSG`. Defaults to `V3_Preview`.
          type: string
          enum:
            - V3_Preview
            - V4_BaseSG
            - V4_Preview
          default: V3_Preview
    Asset:
      description: >
        A character or motion asset. Both resources share one wire shape.


        `progress` is null in list responses. `error` is always null, including

        on a `failed` asset: read `status` to detect failure.


        `type` reflects what was requested at creation. For characters it is

        `render`, `vsplat`, or `all`; for motions it is `render`, `glb`,

        or `all`. Assets created before `type` existed report `render`.

        `vsplat` and `glb` carry that extraction's own status — never

        download URLs, which come from `GET
        /v1/characters/{character_id}/export`

        or `GET /v1/motions/{motion_id}/export` instead — and are null unless

        `type` requested that extraction. On an `all` asset, the top-level

        `status` only reaches `ready` once both the 2D render and the 3D

        extraction have; if either fails, the top-level `status` is `failed`

        while the sub-object's own `status` still shows which one it was.
      type: object
      additionalProperties: false
      required:
        - id
        - status
        - name
        - progress
        - capabilities
        - created_at
        - completed_at
        - error
        - type
        - vsplat
        - glb
      properties:
        id:
          type: string
          description: >-
            Public asset identifier. Character IDs normally begin with `char_`;
            Motion IDs normally begin with `mot_`.
          minLength: 1
        status:
          description: >-
            Overall lifecycle of the asset. Use an asset for rendering or export
            only after the required capability becomes `ready`.
          allOf:
            - $ref: '#/components/schemas/ResourceStatus'
        name:
          type: string
          description: >-
            Display name supplied at creation or derived during import; it may
            be empty when a workflow does not accept a name.
        progress:
          type: integer
          description: >-
            Best-effort processing percentage from 0 through 100 on detail
            responses; null in list responses or when unavailable.
          nullable: true
          minimum: 0
          maximum: 100
        capabilities:
          description: |
            What the asset can be used for. `video_render` appears once the
            asset is ready.
          type: array
          items:
            type: string
        created_at:
          description: >-
            ISO 8601 timestamp with a UTC offset, for example
            `2026-07-31T09:15:22+00:00`.
          type: string
          nullable: true
        completed_at:
          type: string
          description: >-
            ISO 8601 timestamp with a UTC offset when all requested processing
            reached a terminal state; null while work is active.
          nullable: true
        error:
          type: object
          description: >-
            Reserved top-level failure detail. It is currently always null;
            detect failure from `status` and inspect extraction sub-objects when
            applicable.
          nullable: true
          allOf:
            - $ref: '#/components/schemas/ResourceError'
        type:
          type: string
          description: >-
            Work requested when the asset was created. `render` produces the 2D
            render-ready asset, `vsplat`/`glb` requests 3D output, and `all`
            requests both supported outputs.
          enum:
            - render
            - vsplat
            - glb
            - all
          default: render
        vsplat:
          description: |
            Character vsplat extraction status. Null for motions, and for
            characters whose `type` is `render`. The request parameters
            (`model_precision`, etc.) submitted at creation are not echoed
            back here — this is status only.
          nullable: true
          type: object
          additionalProperties: false
          required:
            - status
            - error
          properties:
            status:
              description: >-
                Lifecycle of the character's vsplat extraction, independent of
                the top-level asset status.
              allOf:
                - $ref: '#/components/schemas/ResourceStatus'
            error:
              type: object
              description: >-
                Structured vsplat extraction failure when its status is
                `failed`; otherwise null.
              nullable: true
              allOf:
                - $ref: '#/components/schemas/ResourceError'
        glb:
          description: |
            Motion 3D animation extraction/generation status. Null for
            characters, and for motions whose `type` is `render`.
          nullable: true
          type: object
          additionalProperties: false
          required:
            - status
            - skeletons
            - error
          properties:
            status:
              description: >-
                Lifecycle of the motion's 3D animation extraction or generation,
                independent of the top-level asset status.
              allOf:
                - $ref: '#/components/schemas/ResourceStatus'
            skeletons:
              description: |
                Skeleton variants ready to export via
                `GET /v1/motions/{motion_id}/export?download_type=`.
                Empty until `status` is `ready`; both variants are
                generated up front, so this is either empty or
                `[mixamo, metahuman]`.
              type: array
              items:
                type: string
                enum:
                  - mixamo
                  - metahuman
            error:
              type: object
              description: >-
                Structured 3D animation failure when its status is `failed`;
                otherwise null.
              nullable: true
              allOf:
                - $ref: '#/components/schemas/ResourceError'
    ResourceStatus:
      description: |
        The public lifecycle shared by every asynchronous resource. It carries
        the same values as `RenderStatus`.
      type: string
      enum:
        - queued
        - processing
        - ready
        - failed
        - cancelled
    ResourceError:
      description: |
        The failure attached to an asynchronous resource. `code` is a stable,
        lower_snake_case string and deliberately not an enum: the extraction
        and render workers own this vocabulary and add to it over time, and a
        failure with no published mapping surfaces as `processing_failed`.

        Published codes: `worker_stopped`, `motion_model_mismatch`,
        `image_required`, `motion_video_required`, `unsupported_video_format`,
        `video_too_long`, `video_too_large`, `video_resolution_too_high`,
        `video_unreadable`, `invalid_background_mode`,
        `video_dimensions_must_be_even`, `result_expired`,
        `video_inaccessible`, `no_humans_detected`, `all_workers_busy`,
        `task_failed`, `unexpected_error`, `processing_failed`.
      type: object
      additionalProperties: false
      required:
        - code
        - message
        - request_id
      properties:
        code:
          type: string
          description: >-
            Stable, lower_snake_case asynchronous failure code. The vocabulary
            is open, so clients must tolerate new values.
          minLength: 1
        message:
          type: string
          description: Human-readable explanation of the asynchronous processing failure.
        request_id:
          type: string
          description: >-
            Correlation identifier from the worker or originating request; null
            when unavailable.
          nullable: true
    ResourceErrorResponse:
      type: object
      additionalProperties: false
      required:
        - error
      properties:
        error:
          description: Top-level synchronous resource-operation error payload.
          allOf:
            - $ref: '#/components/schemas/ResourceHttpError'
    ResourceHttpError:
      description: |
        The failure envelope of a synchronous resource request. Every code is
        produced by one mapping in the API service, so the set is closed; a
        failure with no published mapping surfaces as `processing_failed`.

        The asynchronous `error` object on a resource carries the wider,
        deliberately open vocabulary of `ResourceError` instead.
      type: object
      additionalProperties: false
      required:
        - code
        - message
        - request_id
      properties:
        code:
          type: string
          description: >-
            Closed, lower_snake_case error code for a synchronous resource
            request; use it for programmatic handling.
          enum:
            - authentication_required
            - invalid_api_key
            - insufficient_credits
            - invalid_request
            - motion_not_ready
            - character_not_found
            - motion_not_found
            - not_found
            - id_already_exists
            - rate_limited
            - service_unavailable
            - task_failed
            - internal_error
            - processing_failed
        message:
          type: string
          description: Human-readable explanation of the synchronous request failure.
        request_id:
          description: |
            Always null on a synchronous failure. Correlate with the
            `X-Request-Id` response header instead.
          type: string
          nullable: true
  headers:
    RequestId:
      description: Stable request identifier for support and tracing.
      schema:
        type: string
  responses:
    ResourceBadRequest:
      description: |
        Invalid request. The resource operations answer every request-shape
        rejection with `400`; they never answer `422`.
      headers:
        X-Request-Id:
          $ref: '#/components/headers/RequestId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ResourceErrorResponse'
    ResourceUnauthorized:
      description: Missing, invalid, or expired API key.
      headers:
        X-Request-Id:
          $ref: '#/components/headers/RequestId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ResourceErrorResponse'
    ResourcePaymentRequired:
      description: Insufficient credits.
      headers:
        X-Request-Id:
          $ref: '#/components/headers/RequestId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ResourceErrorResponse'
    ResourceNotFound:
      description: |
        The resource does not exist, or it is not owned by the calling
        principal. The two cases are deliberately indistinguishable.
      headers:
        X-Request-Id:
          $ref: '#/components/headers/RequestId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ResourceErrorResponse'
    ResourceInternalServerError:
      description: Unexpected server error.
      headers:
        X-Request-Id:
          $ref: '#/components/headers/RequestId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ResourceErrorResponse'
    ResourceServiceUnavailable:
      description: Service temporarily unavailable.
      headers:
        Retry-After:
          schema:
            type: integer
            minimum: 0
        X-Request-Id:
          $ref: '#/components/headers/RequestId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ResourceErrorResponse'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API key or OAuth access token
      description: |
        Server-side SDK clients use a project API key. Remote MCP clients use
        an OAuth access token. Never expose a project API key in browser code.

````

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