GET

Get a version's document

The document of any version of a template, the current one or an older one.

View as Markdown
GEThttps://api.muzekit.com/v1/templates/{id}/versions/{version}/document
curl https://api.muzekit.com/v1/templates/product-card/versions/2/document \
  -H "Authorization: Bearer $MUZEKIT_SECRET_KEY"

{id} is the template's tpl_… id or its key. {version} is a version's ver_… id or its number, both from List versions. A version of another template, or a number the template doesn't have, answers 404 version_not_found.

Reading a version changes nothing. current says whether it is the version saves update; for that one, Get a document gives the same document with the ETag to save against.

Examples

Put an older design back

Read the older version's document, then save it over the current one with the current revision. The version you replaced stays in the history only if it was named; duplicate the template first to keep it.

API=https://api.muzekit.com/v1/templates/product-card
AUTH="Authorization: Bearer $MUZEKIT_SECRET_KEY"

REV=$(curl -s "$API/document" -H "$AUTH" | jq '.revision')
curl -s "$API/versions/2/document" -H "$AUTH" \
  | jq --argjson rev "$REV" '{ revision: $rev, document }' \
  | curl -X PUT "$API/document" -H "$AUTH" \
      -H "Content-Type: application/json" -d @-

Compare a named version with the current one

Find a named version in the list by its label, then read both documents, for example to show what changed before a launch.

API=https://api.muzekit.com/v1/templates/product-card
AUTH="Authorization: Bearer $MUZEKIT_SECRET_KEY"

VER=$(curl -s "$API/versions" -H "$AUTH" \
  | jq -r '.data[] | select(.label == "Launch") | .id')
diff <(curl -s "$API/versions/$VER/document" -H "$AUTH" | jq .document) \
     <(curl -s "$API/document" -H "$AUTH" | jq .document)

Response

JSON
{
  "object": "document",
  "template": "tpl_Vk1t4l9xvQv",
  "version": "ver_Lp0sQ7dXk2m",
  "number": 2,
  "label": "Launch",
  "current": false,
  "revision": 4,
  "created_at": "2026-11-12T10:02:11.000Z",
  "updated_at": "2026-11-12T10:02:11.000Z",
  "document": {
    "pages": [
      {
        "canvas": { "width": 1080, "height": 1080 },
        "elements": []
      }
    ]
  }
}