ZPLJetdocs

API Reference

POST/v1/convert

Render ZPL to PDF (default) or PNG. Default returns raw bytes and stores nothing; pass "output": "url" (paid plans) to host the file and get a public link back.

Body parameters

FieldTypeDefaultDescription
zplstringrequiredRaw ZPL (one or more ^XA…^XZ labels, up to 50 per request). Must start with ^XA (or a ~ device command) and end with ^XZ. Max 512 KB.
dpmm6 | 8 | 12 | 248Print density in dots/mm. 8 = 203 dpi, 12 = 300 dpi, 24 = 600 dpi.
widthMmnumber101.6Label width in millimeters (default 4 in).
heightMmnumber152.4Label height in millimeters (default 6 in).
formatpdf | pngpdfOutput format. PNG supports one label per request; use PDF for multi-label ZPL.
outputdata | urldataDelivery mode. "data" returns the raw file bytes and stores nothing (all plans). "url" hosts the file and returns a public link (paid plans only), kept for your account's retention window — set in the dashboard, up to your plan max (Starter 3, Pro 30, Scale 90 days).

Example request

curl -X POST https://api.zpljet.com/v1/convert \
  -H "X-API-Key: zpl_your_key" \
  -H "Content-Type: application/json" \
  -d '{
    "zpl": "^XA^FO50,50^A0N,50,50^FDHello^FS^XZ",
    "dpmm": 8,
    "widthMm": 101.6,
    "heightMm": 152.4,
    "format": "pdf"
  }' \
  --output label.pdf

The official SDKs wrap this endpoint with typed params, typed errors, and retries.

Response

With "output": "data" (default), response body is raw application/pdf or image/png bytes, with the conversion id in the X-Conversion-Id header.

With "output": "url", the response is JSON:

{
  "id": "7c9fc824-8d30-4bb9-ba36-03d3bcf574bf",
  "url": "https://files.zpljet.com/…/file.pdf",
  "pages": 1,
  "retentionDays": 7,
  "expiresAt": "2026-07-08T20:09:22.333Z"
}

url is a public link that works until expiresAt, when the file is deleted.

Status codes

Errors are JSON with structured error object — branch on the stable error.code. See Errors & Limits for every code and context fields.

Statuserror.codeDescription
200Success. The raw PDF/PNG bytes (output:"data", default), or JSON with a public URL (output:"url").
400invalid_requestInvalid request body — error.param names the offending field.
401missing_api_key · invalid_api_keyMissing or invalid API key.
402quota_exceededMonthly quota exceeded — error.resetsAt says when it resets (UTC).
403hosting_not_allowed · no_retention_enforcedHosting not permitted — plan is data-only, or no-retention mode is enforced.
413payload_too_largeRequest body exceeded the 1 MiB transport limit.
429rate_limit_exceededRate limit exceeded — error.retryAfter (seconds) and error.retryAt (UTC timestamp) say when to retry; the Retry-After header carries the seconds.
502conversion_failedThe rendering engine failed to process the ZPL — error.conversionId identifies the attempt for support.
503service_unavailableRender engine temporarily unavailable; the request was not charged against quota. Retry after the retry-after interval.

Full machine-readable spec: OpenAPI 3.1.