Duplicate a template
Copy a template's current version into a new template with its own key, or into one end user's designs.
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" }'const res = await fetch(
"https://api.muzekit.com/v1/templates/product-card/duplicate",
{
method: "POST",
headers: {
Authorization: `Bearer ${process.env.MUZEKIT_SECRET_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
name: "Product card (holiday)",
external_id: "product-card-holiday",
}),
},
);
const copy = await res.json();import os
import requests
copy = requests.post(
"https://api.muzekit.com/v1/templates/product-card/duplicate",
headers={"Authorization": f"Bearer {os.environ['MUZEKIT_SECRET_KEY']}"},
json={"name": "Product card (holiday)", "external_id": "product-card-holiday"},
).json(){id} is the template's tpl_… id or its key.
Body
namestringThe copy's name. The original's name with "copy" when left out.
external_idstringThe 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" } }'const headers = {
Authorization: `Bearer ${process.env.MUZEKIT_SECRET_KEY}`,
"Content-Type": "application/json",
};
await fetch("https://api.muzekit.com/v1/templates/product-card/duplicate", {
method: "POST",
headers,
body: JSON.stringify({
name: "Product card (Acme)",
external_id: "product-card-acme",
}),
});
// Later renders name the copy by its key
await fetch("https://api.muzekit.com/v1/renders", {
method: "POST",
headers,
body: JSON.stringify({
template: "product-card-acme",
modifications: { headline: "Hi" },
}),
});import os
import requests
API = "https://api.muzekit.com/v1"
headers = {"Authorization": f"Bearer {os.environ['MUZEKIT_SECRET_KEY']}"}
requests.post(
f"{API}/templates/product-card/duplicate",
headers=headers,
json={"name": "Product card (Acme)", "external_id": "product-card-acme"},
)
# Later renders name the copy by its key
requests.post(
f"{API}/renders",
headers=headers,
json={"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)" }'const res = await fetch(
"https://api.muzekit.com/v1/templates/tpl_Vk1t4l9xvQv/duplicate",
{
method: "POST",
headers: {
Authorization: `Bearer ${process.env.MUZEKIT_SECRET_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({ name: "Product card (backup 2026-11-29)" }),
},
);
const backup = await res.json(); // backup.id is the copy's tpl_… idimport os
import requests
backup = requests.post(
"https://api.muzekit.com/v1/templates/tpl_Vk1t4l9xvQv/duplicate",
headers={"Authorization": f"Bearer {os.environ['MUZEKIT_SECRET_KEY']}"},
json={"name": "Product card (backup 2026-11-29)"},
).json()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" }'const res = await fetch(
"https://api.muzekit.com/v1/templates/product-card/duplicate",
{
method: "POST",
headers: {
Authorization: `Bearer ${process.env.MUZEKIT_SECRET_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({ user: "usr_8fK2mQ1xZpR", name: "My product card" }),
},
);
const design = await res.json(); // design.user is "usr_8fK2mQ1xZpR"import os
import requests
design = requests.post(
"https://api.muzekit.com/v1/templates/product-card/duplicate",
headers={"Authorization": f"Bearer {os.environ['MUZEKIT_SECRET_KEY']}"},
json={"user": "usr_8fK2mQ1xZpR", "name": "My product card"},
).json()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" }'const res = await fetch(
"https://api.muzekit.com/v1/templates/tpl_G2l2bmhk8Pq/duplicate",
{
method: "POST",
headers: {
Authorization: `Bearer ${process.env.MUZEKIT_SECRET_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
name: "Spring launch post",
external_id: "spring-launch-post",
}),
},
);
const template = await res.json(); // template.user is nullimport os
import requests
template = requests.post(
"https://api.muzekit.com/v1/templates/tpl_G2l2bmhk8Pq/duplicate",
headers={"Authorization": f"Bearer {os.environ['MUZEKIT_SECRET_KEY']}"},
json={"name": "Spring launch post", "external_id": "spring-launch-post"},
).json()List one user's designs with GET /v1/templates?user=usr_8fK2mQ1xZpR to find the id.
Response
201 with the new template.
{
"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"
}