Product and API guide

Response

What comes back

Every successful render answers with the same object. Two of its fields are worth keeping: documentId identifies the file for as long as it is retained, and pageCount is what the month is billed by.

Response
{
  "documentId": "doc_5bd26de32c324a4bb8cffad2c80edd01",
  "jobId": "job_00b96f006b034258b00b650d724d0207",
  "fileName": "invoice-doc_5bd26de32c324a4bb8cffad2c80edd01.pdf",
  "format": "pdf",
  "templateCode": "invoice",
  "templateVersion": 5,
  "templateVersionSource": "published",
  "downloadUrl": "/api/v1/documents/doc_5bd2.../download/pdf",
  "previewUrl": null,
  "pageCount": 1,
  "quotaRemaining": 4999,
  "meteringBasis": "pdf-equivalent",
  "createdAt": "2026-08-28T13:23:32+00:00"
}

A render stays private and its download requires your API key. Use the preview endpoint only when you intentionally need an expiring customer link.

Response headers

Every render response repeats the metering figures in its headers, so you can track the quota without a second call.

X-PDFgine-PagesPage count of this document
X-PDFgine-JobIdentifier of the render job
X-PDFgine-Quota-RemainingPages left after the operation
X-PDFgine-Metering-BasisMetering unit

Field by field

The same fields come back for pdf, docx and html; only fileName changes.

Field What it means
documentIdThe identifier of the produced file. Downloads, status and sharing all go through it, so this is the one value worth storing.
downloadUrlRelative to the API address and fetched with the same key. It is a path, not a public link.
templateVersionWhich version of the template produced this file. Keep it and a reprint months later can be explained.
templateVersionSourcepublished for a production render, draft when purpose was editor-test.
pageCountHow many pages were produced; this is what the quota counts.
quotaRemainingPages left in the current month, as of this response.
meteringBasisWhat a page means for billing. pdf-equivalent counts a docx or html output as the same number of pages the PDF would have.
previewUrlFilled only when the document was shared; null otherwise.

What usually goes wrong

  • downloadUrl is a path. Pasting it into a browser without the API address and the key gives a 404 or a 401, not the file.
  • Store documentId, not the whole response. Retention removes files after the period your plan keeps them, and a stored URL then points at nothing.
  • quotaRemaining is a snapshot of that moment, not a live counter. Two calls at once can both read the same number.
  • pageCount is the billing unit, not the number of files. A ten-page document costs ten pages whether you ask for pdf or docx.
  • previewUrl being null does not mean sharing failed; it means this render was not shared. Sharing is a separate call.