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

# Templates

> Save a finalized project generation as a reusable visual template and apply its layout, pacing, and motion style across new projects.

A **Template** is a reusable creative blueprint saved directly from a finalized project **[Generation](https://docs.motion.so/api/projects#the-generation-object)**. Instead of repeating layout, typography, pacing, and animation rules in every prompt, save a generation once via `POST /templates` and pass `template_ids: ["TEMPLATE_ID"]` on future [Projects](https://docs.motion.so/api/projects) or follow-up messages.

Because `POST /templates` saves straight from `generation_id`, you do **not** need to render an MP4 first—all compositions in that generation are captured automatically, and later edits to the source project never mutate the template.

> [!NOTE]
>
> **Required scopes:** `motion:templates:read` to list or read saved templates; `motion:templates:write` to create, update, or delete templates. Creating a template from a project generation (`POST /templates`) also requires `motion:projects:read`.

## Template modes

* **`layout_and_style`** *(default)* — Preserves both scene structure/layout and visual styling (typography, palette, motion language). Ideal for recurring formats like product launches, daily news clips, or ad series.
* **`style`** — Transfers typography, color palette, and motion feel while letting Motion design new layouts for each brief.

## Safe retries & concurrency control

* **Idempotent creation:** Pass an `Idempotency-Key` header on `POST /templates` so retries return the same template instead of creating duplicates.
* **Optimistic locking:** `PATCH /templates/{slug}` requires the template's current UUID `version_id`; concurrent edits fail cleanly with `409`.

## The Template object

```json theme={null}
{
  "template": {
    "id": "tpl_9f8e7d6c5b4a",
    "title": "Product launch",
    "kind": "video",
    "mode": "layout_and_style",
    "editable": true,
    "version_id": "2d4f6a8c-1b3e-4f5a-9c7d-0e1f2a3b4c5d",
    "instructions": "Swap product name, screenshots, and tagline while keeping pacing and typography.",
    "width": 1920,
    "height": 1080,
    "duration_seconds": 15,
    "preview_status": "ready",
    "preview_url": "https://storage.googleapis.com/...",
    "thumbnail_url": "https://storage.googleapis.com/...",
    "brand_kit_id": "b7c8d9e0-1234-4567-89ab-cdef01234567",
    "default_brand_kit_available": true,
    "generation_id": "c72e9f10-4b3a-4d8e-a123-567890abcdef",
    "created_at": "2026-11-23T09:20:00.000Z",
    "resource_url": "https://motion.so/..."
  }
}
```

**id** `string`

Stable template identifier. Pass as `{slug}` on `GET`, `PATCH`, and `DELETE`, and inside `template_ids` on `POST /projects` or `POST /projects/{id}/messages`.

**kind** `enum`

Media kind of the template: `video` or `image`.

**mode** `enum`

`layout_and_style` or `style`—determines whether new projects inherit both structure and look or visual style only.

**generation\_id** `string | null`

UUID of the immutable saved [Generation](https://docs.motion.so/api/projects#the-generation-object) this template was created from.

**version\_id** `string | null`

UUID optimistic concurrency token. Pass this exact `version_id` when calling `PATCH /templates/{slug}`.

**instructions** `string`

Reusable guidance explaining which elements to swap (copy, screenshots, data) and which visual rules to keep consistent.

**preview\_status** `enum`

`preparing`, `ready`, or `failed`—tracks preparation of the template's `preview_url` and `thumbnail_url`.

**brand\_kit\_id** `string | null`

Optional default [Brand kit](https://docs.motion.so/api/brand-kits) linked to this template.

## Endpoints

| Method & Path | Description |
| - | - |
| [`GET /templates`](https://docs.motion.so/api/templates/list) | List saved workspace templates with cursor pagination. |
| [`POST /templates`](https://docs.motion.so/api/templates/create) | Save a finalized project `generation_id` as a reusable template. |
| [`GET /templates/{slug}`](https://docs.motion.so/api/templates/retrieve) | Retrieve a template's metadata, `version_id`, `generation_id`, and previews. |
| [`PATCH /templates/{slug}`](https://docs.motion.so/api/templates/update) | Update a template's title, mode, or instructions (requires `version_id`). |
| [`DELETE /templates/{slug}`](https://docs.motion.so/api/templates/delete) | Delete a saved workspace template. |


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