POST

Create a template

Create a workspace template, blank or from a document.

View as Markdown
POSThttps://api.muzekit.com/v1/templates
curl https://api.muzekit.com/v1/templates \
  -H "Authorization: Bearer $MUZEKIT_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "name": "Product card", "external_id": "product-card", "tags": ["shop"] }'

Body

namestringrequired

Up to 200 characters.

descriptionstring

Up to 2,000 characters.

tagsstring[]

Up to 30 tags.

external_idstring

The template's key: the same in every environment, accepted wherever a tpl_ id is. Made from the name when you leave it out. Lowercase letters, numbers, dots, dashes and underscores.

documentobject

A document (see Templates). Without one, a blank 1080 × 1080 page.

Returns the template with 201. A document that breaks a rule returns 400 invalid_document with every problem in problems. A key another template in this environment already has returns 409 external_id_taken.

Examples

Create from a saved document

Send a document you keep in your own code, or one you read from another template with Get a document. Give it a key so your code can name it the same way in Test and Live.

# product-card.json holds the document: { "pages": [ … ] }
jq '{ name: "Product card", external_id: "product-card", document: . }' \
  product-card.json \
  | curl https://api.muzekit.com/v1/templates \
    -H "Authorization: Bearer $MUZEKIT_SECRET_KEY" \
    -H "Content-Type: application/json" \
    -d @-

Create a blank template at another size

For a size other than 1080 × 1080, send a document with one empty page of that size. Your team or your users then design it in the editor.

curl https://api.muzekit.com/v1/templates \
  -H "Authorization: Bearer $MUZEKIT_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Story",
    "external_id": "story",
    "document": {
      "pages": [
        { "id": "page-1", "canvas": { "width": 1080, "height": 1920 }, "elements": [] }
      ]
    }
  }'

Retry without making two templates

Send an Idempotency-Key. If the network drops and you send the same request again within 24 hours, you get the first response back instead of a second template.

curl https://api.muzekit.com/v1/templates \
  -H "Authorization: Bearer $MUZEKIT_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: create-product-card-1" \
  -d '{ "name": "Product card", "external_id": "product-card" }'

Response

A new template has no thumbnail_url until the editor saves it.

JSON
{
  "object": "template",
  "id": "tpl_Vk1t4l9xvQv",
  "name": "Product card",
  "description": null,
  "tags": ["shop"],
  "external_id": "product-card",
  "user": null,
  "source": "api",
  "version": { "id": "ver_…", "number": 1, "revision": 1 },
  "width": 1080,
  "height": 1080,
  "page_count": 1,
  "thumbnail_url": null,
  "created_at": "2026-10-17T02:10:00.000Z",
  "updated_at": "2026-10-17T02:10:00.000Z"
}