DELETE

Delete a template

Delete a template. It can be restored by support for 30 days.

View as Markdown
DELETEhttps://api.muzekit.com/v1/templates/{id}
curl -X DELETE https://api.muzekit.com/v1/templates/tpl_Vk1t4l9xvQv \
  -H "Authorization: Bearer $MUZEKIT_SECRET_KEY"

{id} is the template's tpl_… id or its key. The template leaves every list at once, and a template.deleted webhook goes out. Files it uses stay in the library, and still count as in use while the template can be restored.

Examples

Delete a template by its key

Use the key to delete the same template in Test and in Live. Each environment has its own copy, so send the request with each key.

curl -X DELETE https://api.muzekit.com/v1/templates/product-card \
  -H "Authorization: Bearer $MUZEKIT_SECRET_KEY"

Delete all of an end user's designs

When a user leaves your product, list their designs with user and delete each one. Keep listing until the list comes back empty.

for ID in $(curl -s "https://api.muzekit.com/v1/templates?user=usr_8fK2mQ1xZpR&limit=100" \
  -H "Authorization: Bearer $MUZEKIT_SECRET_KEY" | jq -r '.data[].id'); do
  curl -s -X DELETE "https://api.muzekit.com/v1/templates/$ID" \
    -H "Authorization: Bearer $MUZEKIT_SECRET_KEY"
done

An id or key that doesn't exist, or a template already deleted, answers 404 template_not_found.

Response

JSON
{ "object": "template", "id": "tpl_Vk1t4l9xvQv", "deleted": true }