POST

Render a template

PNG, JPG, WEBP, AVIF, PDF or video of a template, with your values filled in.

View as Markdown
POSThttps://api.muzekit.com/v1/renders
curl https://api.muzekit.com/v1/renders \
  -H "Authorization: Bearer $MUZEKIT_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "template": "tpl_Vk1t4l9xvQv", "format": "png", "modifications": { "headline": "Summer sale" } }'
Field
templateThe template's tpl_… id or its key; its current document is rendered
formatpng (default), jpg, webp, avif, pdf, or video: mp4, webm, gif, mov, mkv
pagesPage numbers, e.g. [1, 3]; every page when left out. An image or video render makes one file per page, a PDF one file
scale1 (default) to 4: 2 makes a 1080 px page 2160 px
quality1 to 100 for jpg, webp and avif
modificationsValues for the template's parameters. A single-page template takes bare keys ("headline"). A multi-page template needs the page on every key, page 1 included ("page1@headline", "page2@headline"): a bare key there changes nothing. Sub-properties follow a dot ("headline.color"); without a page they apply on every page that has the parameter
pdfPDF only: margin (or marginTop …) as pixels or a length (24, "24px", "10mm", "1cm", "0.5in", "12pt"), title, colorMode (rgb or cmyk), imageFormat, imageQuality, maxImageDpi
videoVideo only, see Video
langLanguage tag for the document ("ar" sets right-to-left text)
sizeRender at another size: a preset ("instagram-story", "youtube-thumbnail", …), "WIDTHxHEIGHT" or { "width": 1080, "height": 1920 }. See Sizes
extraSizesExtra copies at other sizes, up to 10: ["1080x1920", "1200x628"], or named, { "story": "1080x1920" }

Renders use the same engine as the editor's downloads, so the files match what your users see. An image or PDF render answers 201 once its files are stored. If it takes more than a minute, or renders more than 20 pages (each extra size counts its pages again), it answers 202 with status: "queued" instead, like a video; get the render until it is succeeded. Each file stays for your plan's days (expires_at); copy it if you need it longer. Test and Live render the same way. Live renders use your plan's API credits; Test renders are free, carry a TEST watermark and are kept 7 days (livemode is false).

Keys that match no parameter don't stop the render; they come back in warnings.

A page with flow layers (text or tables that continue on new pages) renders as many files as its content needs: its outputs carry part 1, 2, and so on.

Sizes

One design renders at any size: the layout is solved again for the new shape, and a size your team set up with Smart resize in the editor uses that saved layout. size replaces the template's own size; extraSizes adds copies beside it. Each copy is an output with a size (its name, or WIDTHxHEIGHT) and counts like any other file. See Render several sizes at once.

Presets: instagram-post, instagram-post-portrait, instagram-post-landscape, instagram-story, facebook-post, facebook-story, facebook-cover, twitter-post, twitter-header, linkedin-post, linkedin-banner, youtube-thumbnail, youtube-short, tiktok-video, pinterest-pin, whatsapp-status, og-image, blog-header, email-header, website-banner, presentation-16-9, a4-document, us-letter, business-card, zoom-background, leaderboard-ad, medium-rectangle-ad.

A size can also differ by page: { "page1": "1080x1920", "page2": "1080x1350" } as one entry of extraSizes.

AI values

A text or image parameter can be written by AI at render: send a prompt as "<parameter>.prompt". A text layer gets the words, an image layer a new picture. Add "<parameter>.promptMode": "update" to have the prompt edit the layer's value instead of replacing it, and "<parameter>.promptReferences" (image URLs) to guide a picture.

JSON
{
  "modifications": {
    "headline.prompt": "A five-word summer sale headline",
    "hero.prompt": "A beach at golden hour, wide"
  }
}

Each prompt uses AI credits: 1 for text, 2 for an image. A render checks that its credits are there before it starts (402 ai_credits_exhausted if not). A prompt that fails leaves the layer as the template has it and adds a line to warnings. AI video clips and flowing-text layers don't take prompts yet; they warn.

Video

Videos are queued: the answer is 202 with status: "queued", and the files are ready when the render's status is succeeded (get the render, or listen for render.succeeded). Send Prefer: wait to wait up to a minute for the finished render in the answer instead, or Prefer: wait=30 to wait at most 30 seconds and then get the render as it stands. A page's length comes from its videos, animations and audio, or from video.duration.

video field
durationSeconds, when the page has nothing that sets its length
fpsFrames per second, up to 30 (GIF: 15)
quality1 to 100
mutedtrue renders without sound
trimStart, trimEndSeconds to keep from the page's video
audioSourceAn audio URL for every page, or [{ "page": 1, "track": 0, "url": "…" }] to replace one page's track
subtitleSourceAudio (or a .srt / .vtt file) to caption. Audio is transcribed; no credits
subtitleSegmentsCaptions: [{ "start": 0, "end": 2.5, "text": "…" }]
captionPresetA caption style by name; subtitleColor, subtitleFontSize and the other subtitle… options set one by one
combinePagesJoin the pages into one video (not GIF)
pageTransition, pageTransitionDurationThe transition between joined pages (fade, dissolve, wipeleft, …) and its length, 0.1 to 2 s

Every Live render spends API credits: an image 1 a page, a PDF 1, a video 1 a second of its length, rounded up (video_seconds). A video can be as long as your plan allows (limits.video_length, in seconds), with up to limits.audio_tracks audio tracks a page.

Examples

Personalize an image for one person

Fill text and image parameters with one person's values. An image parameter takes a public URL; a dot key changes one property of a layer, here the headline's color.

curl https://api.muzekit.com/v1/renders \
  -H "Authorization: Bearer $MUZEKIT_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "template": "product-card",
    "format": "jpg",
    "quality": 90,
    "modifications": {
      "headline": "Happy birthday, Maya",
      "photo": "https://example.com/photos/maya.jpg",
      "headline.color": "#0B5FFF"
    }
  }'

Check warnings in the answer: a misspelled key is listed there and the layer keeps the template's value.

Render a user's design after they save

When a user saves in the editor, a template.updated webhook names their template (a design's first save sends template.created). Render it from your webhook handler, and send the event's id as Idempotency-Key so a retried delivery doesn't render twice.

# data.template and the event id come from the webhook
curl https://api.muzekit.com/v1/renders \
  -H "Authorization: Bearer $MUZEKIT_SECRET_KEY" \
  -H "Idempotency-Key: evt_8gK2mQ1xZpRt" \
  -H "Content-Type: application/json" \
  -d '{ "template": "tpl_G2l2bmhk8Pq", "format": "png" }'

Answer the webhook quickly (within five seconds); if your renders take longer, queue them and render after you reply. Without any code, render on save does the same and sends the files in render.succeeded.

Render several sizes at once

One request makes the template's own size plus named copies. Sizes can be presets or WIDTHxHEIGHT.

curl https://api.muzekit.com/v1/renders \
  -H "Authorization: Bearer $MUZEKIT_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "template": "summer-sale",
    "format": "png",
    "modifications": { "headline": "Summer sale" },
    "extraSizes": { "story": "instagram-story", "og": "1200x628" }
  }'

The template's own size has no size; each copy carries its name:

JSON
"outputs": [
  {
    "page": 1,
    "part": null,
    "url": "https://storage.muzekit.com/r/…/1.png",
    "content_type": "image/png"
  },
  {
    "page": 1,
    "part": null,
    "size": "story",
    "url": "https://storage.muzekit.com/r/…/1.story.png",
    "content_type": "image/png"
  },
  {
    "page": 1,
    "part": null,
    "size": "og",
    "url": "https://storage.muzekit.com/r/…/1.og.png",
    "content_type": "image/png"
  }
]

Send extraSizes as a list (["instagram-story", "1200x628"]) and each copy's size is its WIDTHxHEIGHT. To get only the other size, send size instead.

Make a PDF

A PDF render puts the pages you choose into one file, so it has one output with page: null.

curl https://api.muzekit.com/v1/renders \
  -H "Authorization: Bearer $MUZEKIT_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "template": "certificate",
    "format": "pdf",
    "modifications": { "name": "Maya Patel", "course": "Data basics" },
    "pdf": { "title": "Certificate for Maya Patel", "margin": "10mm" }
  }'

Add "pages": [1, 3] for some pages only, and "colorMode": "cmyk" in pdf for print.

Render a video and wait for it

A video answers 202 with status: "queued" and the render's id. Get the render every few seconds until it is succeeded or failed, or listen for the render.succeeded webhook with the same id. For short videos, Prefer: wait returns the finished render instead.

curl https://api.muzekit.com/v1/renders \
  -H "Authorization: Bearer $MUZEKIT_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "template": "promo-video",
    "format": "mp4",
    "modifications": { "headline": "New in store" },
    "video": { "duration": 8 }
  }'

# Then, with the id from the answer, until status is succeeded or failed
curl https://api.muzekit.com/v1/renders/rnd_vQ8VEOnjY5H \
  -H "Authorization: Bearer $MUZEKIT_SECRET_KEY"

video.duration sets the length only when nothing on the page does (a video layer, animations or audio). A Live video spends 1 API credit a second.

Response

JSON
{
  "object": "render",
  "id": "rnd_vQ8VEOnjY5H",
  "status": "succeeded",
  "template": "tpl_Vk1t4l9xvQv",
  "revision": 4,
  "trigger": "api",
  "livemode": true,
  "format": "png",
  "pages": [ 1, 2 ],
  "outputs": [
    {
      "page": 1,
      "part": null,
      "url": "https://storage.muzekit.com/r/d90/…/1.png",
      "content_type": "image/png",
      "size": null,
      "width": 1080,
      "height": 1080
    },
    {
      "page": 2,
      "part": null,
      "url": "https://storage.muzekit.com/r/d90/…/2.png",
      "content_type": "image/png",
      "size": null,
      "width": 1080,
      "height": 1080
    }
  ],
  "warnings": [],
  "error": null,
  "duration_ms": 2410,
  "created_at": "2026-10-17T10:52:43.248Z",
  "completed_at": "2026-10-17T10:52:45.658Z",
  "expires_at": "2027-01-15T10:52:45.658Z"
}

Each output has the size it was rendered at (null for the template's own size) and its width and height in pixels. Every file URL has a random part, so a URL can't be guessed from another.

A field the API doesn't know answers 400 invalid_request with Unknown field '<name>', so a typo never renders the template as it is. A render takes no user: to render an end user's design, send that design's tpl_… id as template.

ErrorWhen
400 invalid_pageA page number the template doesn't have
400 invalid_optionvideo options with an image or PDF format
400 invalid_sizeA size that isn't a preset or WIDTHxHEIGHT, a side outside 16 to 8,000 px, or more than 10 extra sizes
402 api_credits_exhaustedThis period's Live API credits are used
402 ai_credits_exhaustedThe .prompt values need more AI credits than are left
402 plan_requiredThe editor has no plan, or its plan is paused or unpaid
404 template_not_foundNo template with this id or key in this environment
422 video_limitA video longer than your plan allows, or a page with too many audio tracks
422 render_failedThe engine couldn't render the page; message says why
429 rate_limitedMore than 60 renders a minute with this key
429 test_renders_exhaustedA Test environment reached its daily cap of free renders; render with your Live key
503 render_unavailableRenders can't be queued for a moment; try again shortly. Nothing is charged

A render that answered 202 and fails later turns failed, with one of these codes in error, and sends render.failed.