Skip to content
Pixmato
Esc
↑↓navigate↵open⌘Jpreview
On this page

Create Render

Generate one PNG, JPEG, WebP, or PDF from a Pixmato template.

Generate one render from a template and return the output URL when the render completes.

Endpoint

POST https://api.pixmato.com/v1/renders

Request

curl -X POST "https://api.pixmato.com/v1/renders" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "template": "YOUR_TEMPLATE_ID",
    "modifications": {
      "headline": "Spring drop",
      "photo": "https://cdn.example.com/product.png",
      "accent.color": "#e85d45"
    },
    "output": {
      "format": "png",
      "scale": 2
    }
  }'

Body

Field Type Required Description
template string Yes Template ID from the authenticated workspace.
modifications object No Parameter values using object or dot notation.
output.format png, jpeg, webp, pdf No Output format. Defaults to png. PDF output uses the template canvas size.
output.scale number No Raster scale from 0.5 to 4 for PNG/JPEG. Defaults to 2.
output.quality number No JPEG and WebP quality from 1 to 100. Defaults to 90.

Generate a PDF

curl -X POST "https://api.pixmato.com/v1/renders" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "template": "YOUR_TEMPLATE_ID",
    "modifications": {
      "headline": "Q2 partner certificate",
      "recipient": "Avery Stone"
    },
    "output": {
      "format": "pdf"
    }
  }'

Modifications

Plain keys update the parameter’s configured target.

{
  "headline": "Spring drop",
  "photo": "https://cdn.example.com/product.png"
}

Dot notation updates a specific property of an exposed parameter.

{
  "headline.text": "Spring drop",
  "headline.color": "#17162f",
  "photo.src": "https://cdn.example.com/product.png",
  "photo.objectFit": "cover",
  "check_in_url.qr": "https://example.com/checkin/ticket_123",
  "check_in_url.foregroundColor": "#151426"
}

Text parameters

Text fields take a string in any supported language. Text in Hindi, Arabic, Hebrew, Chinese, Japanese, Korean and Thai is shown in a matching Noto font without any extra fields.

{
  "headline": "خصم 25%",
  "headline.direction": "rtl",
  "headline.text_align": "right"
}

Supported text dot properties:

Property Description
.text or .content Replace the text.
.color Set the text color.
.direction Reading direction: ltr or rtl.
.text_align or .textAlign left, center, right, or justify.
.font_family or .fontFamily Change the font, for example Noto Sans TC for Traditional Chinese.
.font_size or .fontSize Change the font size.
.letter_spacing or .letterSpacing Change the space between letters.
.text_fit or .textFitMode fixed, shrink-to-fit, truncate, or auto-height.
.min_font_size or .minFontSize Smallest size for shrink-to-fit text.
.max_lines or .maxLines Line count for truncate text.

Sending "direction": "rtl" for a left-aligned field also aligns it to the right, unless the request sends .text_align for the same field. A value outside the lists above returns 400 with the code invalid_template_parameters.

See Languages and right-to-left text for the languages and fonts.

QR code parameters

QR layers expose the encoded value as a text parameter. Use the plain key for most renders.

{
  "attendee_name": "Daniel Kim",
  "check_in_url": "https://example.com/checkin/growth-summit/daniel-kim"
}

Supported QR dot properties:

Property Description
.qr or .value Replace the encoded QR value.
.foregroundColor Set the QR foreground color.
.backgroundColor Set the QR background color.
.errorCorrection low, medium, quartile, or high.
.margin Quiet-zone padding from 0 to 8.

Response

Each successful image or PDF output uses 1 render credit. Failed renders, including renders that fail because an image could not be loaded, do not consume credits. A synchronous request waits for completion; if it returns 504, the job continues processing. Follow the jobId and polling URL in the error response instead of submitting a duplicate request.

For an opt-in durable async response, send Prefer: respond-async:

curl -X POST "https://api.pixmato.com/v1/renders" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Prefer: respond-async" \
  -d '{"template":"YOUR_TEMPLATE_ID"}'

The API returns 202 Accepted, Preference-Applied: respond-async, and Location: /v1/renders/{id}:

{
  "id": "rnd_01JY7R8Q7S2K3B4A5C6D7E8F9G",
  "status": "pending",
  "template": "YOUR_TEMPLATE_ID",
  "poll_url": "/v1/renders/rnd_01JY7R8Q7S2K3B4A5C6D7E8F9G"
}
{
  "id": "rnd_01JY7R8Q7S2K3B4A5C6D7E8F9G",
  "status": "completed",
  "output_url": "https://storage.pixmato.com/workspaces/ws_01/renders/rnd_01JY7R8Q7S2K3B4A5C6D7E8F9G.png",
  "duration_ms": 842,
  "template": "YOUR_TEMPLATE_ID"
}

Errors

Status Codes Meaning
400 invalid_json, invalid_request, invalid_template_parameters, plan_limit, asset_url_blocked, asset_unavailable The body, a field value, or an image URL needs fixing. No credit is used.
401 unauthorized API key is missing, invalid or revoked.
404 template_not_found Template was not found in the authenticated workspace.
429 credits_unavailable, rate_limited, too_many_in_progress Out of credits, or too many renders right now. See Too many requests.
500 render_failed, render_timeout The renderer failed or took too long. No credit is used.
503 queue_unavailable The render was accepted and will be queued automatically. Poll it; do not resend.

See Errors for each code.

Sync, async and timeouts

The default request waits for the completed render and returns 200 with its output URL. Add Prefer: respond-async to receive 202 immediately with a job ID and poll_url instead. Both modes use the same durable queue and worker.

The API’s synchronous wait timeout is configured separately from renderer readiness timeouts. Its default is 30 seconds (RENDER_SYNC_WAIT_TIMEOUT_MS). A render that outlasts it returns 202 with a job ID and poll_url, the same body as an asynchronous request. The job keeps running; follow poll_url rather than submitting a duplicate render.

Was this page helpful?