List templates
Workspace templates, or one user’s templates, newest first.
curl "https://api.muzekit.com/v1/templates?limit=20" \
-H "Authorization: Bearer $MUZEKIT_SECRET_KEY"const res = await fetch("https://api.muzekit.com/v1/templates?limit=20", {
headers: { Authorization: `Bearer ${process.env.MUZEKIT_SECRET_KEY}` },
});
const templates = await res.json();import os
import requests
templates = requests.get(
"https://api.muzekit.com/v1/templates",
params={"limit": 20},
headers={"Authorization": f"Bearer {os.environ['MUZEKIT_SECRET_KEY']}"},
).json()Query
userusr_…List this user’s templates instead of the workspace’s.
tagstringOnly templates with this exact tag (case matters), up to 50 characters.
qstringOnly templates whose name or key contains this text, in any case. Up to 100 characters.
limitnumber1 to 100, default 20.
aftertpl_…next_cursor from the previous page.
Without user, the list has workspace templates only, never end users' designs. tag, q and user combine: every filter you send must match. q matches its text as typed, so % and _ are plain characters.
Examples
List one end user's designs
Pass user to show a user the designs they made, for example on a "My designs" page in your app. Their templates carry user, and usually no key (external_id is null). thumbnail_url is null until the editor saves the template once.
curl "https://api.muzekit.com/v1/templates?user=usr_8fK2mQ1xZpR" \
-H "Authorization: Bearer $MUZEKIT_SECRET_KEY"const res = await fetch(
"https://api.muzekit.com/v1/templates?user=usr_8fK2mQ1xZpR",
{ headers: { Authorization: `Bearer ${process.env.MUZEKIT_SECRET_KEY}` } },
);
const { data: designs } = await res.json();import os
import requests
designs = requests.get(
"https://api.muzekit.com/v1/templates",
params={"user": "usr_8fK2mQ1xZpR"},
headers={"Authorization": f"Bearer {os.environ['MUZEKIT_SECRET_KEY']}"},
).json()["data"]Find templates by tag or name
Send tag for templates you tagged, for example holiday, and q to narrow them by name or key. Here: holiday templates whose name or key has "card" in it.
curl -G https://api.muzekit.com/v1/templates \
--data-urlencode "tag=holiday" \
--data-urlencode "q=card" \
-H "Authorization: Bearer $MUZEKIT_SECRET_KEY"const params = new URLSearchParams({ tag: "holiday", q: "card" });
const res = await fetch(`https://api.muzekit.com/v1/templates?${params}`, {
headers: { Authorization: `Bearer ${process.env.MUZEKIT_SECRET_KEY}` },
});
const { data: cards } = await res.json();import os
import requests
cards = requests.get(
"https://api.muzekit.com/v1/templates",
params={"tag": "holiday", "q": "card"},
headers={"Authorization": f"Bearer {os.environ['MUZEKIT_SECRET_KEY']}"},
).json()["data"]A tag is matched whole: tag=holiday doesn't find holiday-2026. Set tags with Update a template.
Page through every template
While has_more is true, send next_cursor as after to get the next page.
AFTER=""
while : ; do
PAGE=$(curl -s "https://api.muzekit.com/v1/templates?limit=100&after=$AFTER" \
-H "Authorization: Bearer $MUZEKIT_SECRET_KEY")
echo "$PAGE" | jq -r '.data[] | "\(.id) \(.name)"'
AFTER=$(echo "$PAGE" | jq -r '.next_cursor // empty')
[ -z "$AFTER" ] && break
doneconst all = [];
let after = null;
do {
const params = new URLSearchParams({ limit: "100" });
if (after) params.set("after", after);
const res = await fetch(`https://api.muzekit.com/v1/templates?${params}`, {
headers: { Authorization: `Bearer ${process.env.MUZEKIT_SECRET_KEY}` },
});
const page = await res.json();
all.push(...page.data);
after = page.next_cursor;
} while (after);import os
import requests
templates, after = [], None
while True:
params = {"limit": 100}
if after:
params["after"] = after
page = requests.get(
"https://api.muzekit.com/v1/templates",
params=params,
headers={"Authorization": f"Bearer {os.environ['MUZEKIT_SECRET_KEY']}"},
).json()
templates += page["data"]
after = page["next_cursor"]
if not after:
breakResponse
{
"object": "list",
"data": [
{
"object": "template",
"id": "tpl_Vk1t4l9xvQv",
"name": "Product card",
"description": null,
"tags": [],
"external_id": "product-card",
"user": null,
"source": "api",
"version": { "id": "ver_…", "number": 1, "revision": 1 },
"width": 1080,
"height": 1080,
"page_count": 1,
"thumbnail_url": "https://storage.muzekit.com/…/r1.png",
"created_at": "…",
"updated_at": "…"
}
],
"has_more": false,
"next_cursor": null
}