zpl.tools
Compatibility LayersLabelary Compatibility

Endpoints

Complete list of all API endpoints

The Official Labelary API Documentation can be found here. The Following is a documentation of the compatibility layer provided by Zpl Tools.

Available Endpoints

  • GET /compatibility/labelary/v1/printers/{dpmm}/labels/{width}x{height}/{index}/{zpl}
    • Avoid using the GET endpoint variant, if possible. The url length might be limited to 16 KB.
  • POST /compatibility/labelary/v1/printers/{dpmm}/labels/{width}x{height}/{index}
    • Extract single label by index.
  • POST /compatibility/labelary/v1/printers/{dpmm}/labels/{width}x{height}/
    • Render all labels (PDF only).

Path Parameters

ParameterTypeDescription
dpmmstringPrinter resolution: 6dpmm (152 DPI), 8dpmm (203 DPI), 12dpmm (300 DPI), or 24dpmm (600 DPI). The dpmm suffix is optional — a bare number (8) is also accepted; anything that isn't one of the four valid densities gets a 400 Unknown print density, not a 404.
widthnumberLabel width in inches (0.00115)
heightnumberLabel height in inches (0.00115)
indexnumberLabel index in document (0-based). Required for PNG output — PNG requested on the all-labels endpoint (no index) returns 404.
zplstringZPL code (sent in POST body as raw data)

Headers

Required Headers

HeaderDescription
X-API-KeyYour API key for authentication

Optional Headers

HeaderValuesPurposeSupported
Acceptapplication/pdf, image/pngSpecify output format (default: image/png)✅ Yes — any other value (including Labelary-supported formats we don't generate, like application/json or application/epl) returns 406
X-Rotation0, 90, 180, 270Rotate output clockwise⚠️ PNG only — applied for PNG; PDF output isn't rotated yet. Any other value returns 400.
X-QualityGrayscale (default), BitonalPNG color depth✅ Yes — PNG only, ignored for PDF
X-LinterOn, Off (default)Opt-in ZPL linting✅ Yes — see the Linting reference
X-Page-SizeLetter, Legal, A4, A5, A6PDF page size⚠️ Validated only — accepted/rejected exactly like Labelary and checked for "does the label fit", but not yet used to size or compose the PDF page. PDF only; ignored for PNG.
X-Page-OrientationPortrait, LandscapePDF page orientation⚠️ Validated only (see above)
X-Page-Layout{cols}x{rows}, e.g. 2x3Labels per PDF page, in a grid⚠️ Validated only (see above) — checked for row count fitting the page height, not yet arranged into an actual grid
X-Page-AlignLeft, Right, Center, Justify (default)Horizontal placement on the PDF page⚠️ Validated only (see above)
X-Page-Vertical-AlignTop, Bottom, Center, Justify (default)Vertical placement on the PDF page⚠️ Validated only (see above)
X-Label-BorderDashed (default), Solid, NoneBorder drawn around each label⚠️ Validated only (see above)

See Behavioral notes for what "validated only" means in practice.

Response Headers

HeaderDescription
Content-TypeMIME type of response
X-Total-CountTotal number of labels in document

Status Codes

CodeMeaning
200Success
400Bad request (invalid parameters)
404Not found
406Not Acceptable (unsupported format)
500Server error

Next Steps