POST

Duplicate a template

Copy a template's current version into a new template with its own key, or into one end user's designs.

View as Markdown
POSThttps://api.muzekit.com/v1/templates/{id}/duplicate
curl -X POST https://api.muzekit.com/v1/templates/product-card/duplicate \
  -H "Authorization: Bearer $MUZEKIT_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "name": "Product card (holiday)", "external_id": "product-card-holiday" }'

{id} is the template's tpl_… id or its key.

Body

namestring

The copy's name. The original's name with "copy" when left out.

external_idstring

The copy's key. Made from the name when left out (workspace templates only).

userusr_…

Make the copy one of this end user's designs instead of a workspace template.

The copy starts with one version, the original's current one, and keeps its description and tags. Without user it is a workspace template, even when the original is a user's design. With user it is that user's design: it has no key unless you send external_id, and it lists under GET /v1/templates?user=usr_…. A template.created webhook goes out with source: "duplicate" and the user (or null).

A user that isn't a usr_… id answers 400; one that isn't in this key's environment answers 404 user_not_found. To let a user start from your template in the editor instead, open a fill session on it: their first change saves their own copy.

Examples

Make a variant under its own key

Copy a template for a season or a client, then render the copy by its new key. The original stays as it was.

curl -X POST https://api.muzekit.com/v1/templates/product-card/duplicate \
  -H "Authorization: Bearer $MUZEKIT_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "name": "Product card (Acme)", "external_id": "product-card-acme" }'

# Later renders name the copy by its key
curl https://api.muzekit.com/v1/renders \
  -H "Authorization: Bearer $MUZEKIT_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "template": "product-card-acme", "modifications": { "headline": "Hi" } }'

A key that another template in this environment already has returns 409 external_id_taken.

Keep a copy before you change a document

Update a document saves over the current version in place. Duplicate the template first when you want to keep the old design.

curl -X POST https://api.muzekit.com/v1/templates/tpl_Vk1t4l9xvQv/duplicate \
  -H "Authorization: Bearer $MUZEKIT_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "name": "Product card (backup 2026-11-29)" }'

Give a user their own copy of your template

Copy a starter template into a user's designs before they first open the editor, so it waits in their "My designs" list. Open it later with a design session on the copy's id.

curl -X POST https://api.muzekit.com/v1/templates/product-card/duplicate \
  -H "Authorization: Bearer $MUZEKIT_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "user": "usr_8fK2mQ1xZpR", "name": "My product card" }'

Turn a user's design into a workspace template

A user made something you want everyone to start from. Duplicate their template by its id: the copy is a workspace template with a key, listed by GET /v1/templates, and the user's design doesn't change.

curl -X POST https://api.muzekit.com/v1/templates/tpl_G2l2bmhk8Pq/duplicate \
  -H "Authorization: Bearer $MUZEKIT_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "name": "Spring launch post", "external_id": "spring-launch-post" }'

List one user's designs with GET /v1/templates?user=usr_8fK2mQ1xZpR to find the id.

Response

201 with the new template.

JSON
{
  "object": "template",
  "id": "tpl_Hn4cW2rTq8z",
  "name": "Product card (holiday)",
  "description": null,
  "tags": ["shop"],
  "external_id": "product-card-holiday",
  "user": null,
  "source": "duplicate",
  "version": { "id": "ver_Lp0sQ7dXk2m", "number": 1, "revision": 1 },
  "width": 1080,
  "height": 1080,
  "page_count": 1,
  "thumbnail_url": null,
  "created_at": "2026-11-29T09:12:04.511Z",
  "updated_at": "2026-11-29T09:12:04.511Z"
}