---
title: "Create a canvas template"
method: POST
path: "/v1/canvas-templates"
tags: ["Canvases"]
---

# Create a canvas template

`POST /v1/canvas-templates`

## Request

- Base URL: `https://api.masko.ai`
- URL: `https://api.masko.ai/v1/canvas-templates`
- Auth: HTTP bearer

Creates a reusable user-owned canvas template. Templates can later be applied via POST `/v1/mascots/{id}/canvases` with `template_id`. No credit cost.

Select Masko-API-Version: 2026-09-26 (or api_version=2026-09-26) for the canonical mascot contract shown first. Existing unversioned clients keep legacy collection fields. A mascot_id query filter also selects the canonical contract. Mixing identifier names returns 400.

## Query parameters

- `api_version` '2026-09-26' | 'legacy'

## Headers

- `Idempotency-Key` string
- `Masko-API-Version` '2026-09-26' | 'legacy'

## Request body

- union
  - StudioCreateTemplateBody
    - `name` string, required: Template name.
    - `description` string: What the template does.
    - `canvas_id` string, uuid: Existing canvas to snapshot. Required together with mascot_id. Mutually exclusive with template.
    - `mascot_id` string, uuid: Source mascot for the snapshot. Required together with canvas_id.
    - `template` object: Raw template JSON. Provide this OR (canvas_id + collection_id).
    - `public` boolean: If true, template is visible to all users. Defaults to false.
  - CreateTemplateBody
    - `name` string, required: Template name.
    - `description` string: What the template does.
    - `canvas_id` string, uuid: Existing canvas to snapshot. Required together with collection_id. Mutually exclusive with template.
    - `collection_id` string, uuid: Source collection for the snapshot. Required together with canvas_id.
    - `template` object: Raw template JSON. Provide this OR (canvas_id + collection_id).
    - `public` boolean: If true, template is visible to all users. Defaults to false.

## Response `201`

Created template

- CanvasTemplateResponse
  - `data` CanvasTemplate, required
    - `object` 'canvas_template': Resource type. Always "canvas_template".
    - `id` string, required
    - `name` string, required
    - `description` string, nullable, required
    - `source` 'builtin' | 'user', required
    - `public` boolean
    - `nodes` object[]
    - `edges` object[]
    - `inputs` object[]
    - `created_at` string

## Other responses

- `400`: Validation error
- `401`: Unauthorized
- `403`: Forbidden
- `404`: Not found
- `409`: Conflict

---

[API](https://skmtc.dev/masko/apis/masko-api.md) · [All operations](https://skmtc.dev/masko/apis/masko-api/llms.txt) · [OpenAPI document](https://skmtc.dev/masko/apis/masko-api/revisions/91eb3006a92f?raw)
