Skip to content

Render API ​

The render API turns a published template and your data into a PDF. Your software sends the template's ID and a JSON object; the answer is the PDF. It renders exactly what the editor's preview shows for that version and data.

  • Base URL: https://app.templo.at/api/v1
  • Machine-readable: the OpenAPI 3.1 description of this page, for code generators, API clients and agent tools.
  • Templates: how a template is built is in the template format reference. The API renders only published versions: publish a template in the editor first; its draft is never rendered.

Authentication ​

Every request signs in with an API key of your workspace, sent as a bearer token:

Authorization: Bearer templo_…

Owners and admins create keys on the API keys page. A key is shown once: store it in your server's secrets, never in a browser, an app or a repository. Keys start with templo_, so secret scanners can find a leaked one; revoke it there and it stops working with the next request. A key renders the templates of its own workspace only. A missing, unknown or revoked key is a 401 E_UNAUTHORIZED, without saying which.

The API is for servers: it sets no cookies and answers no cross-origin browser requests.

Responses ​

Successful JSON answers wrap their content in data. Every error is JSON with a stable code to react to and an English message:

json
{ "error": { "code": "E_TEMPLATE_NOT_PUBLISHED", "message": "The template has no published version yet. Publish it in the Templo editor: the API renders published versions only, never the draft." } }

Codes and field names only change in a compatible way within /api/v1: new fields and codes may be added, none is renamed or removed. Messages may change; don't parse them.

Check an API key ​

GET /api/v1/workspace · operation getWorkspace

The workspace the API key belongs to. Use it to check that a key works before you render; it counts against the request limit like every request.

Example ​

sh
curl 'https://app.templo.at/api/v1/workspace' \
  -H "Authorization: Bearer $TEMPLO_API_KEY"

Response ​

The workspace of the API key.

application/json:

json
{
  "data": {
    "id": "ws_01JDQ8XK2M4N6P8R0S2T4V6W8Y",
    "name": "Bergwerk Design"
  }
}

Errors: E_UNAUTHORIZED, E_RATE_LIMITED, E_INTERNAL_ERROR (what they mean).

Render a document ​

POST /api/v1/render · operation renderDocument

Renders a published version of a template with your data and answers the document: by default the template's latest published version as a PDF. The draft in the editor is never rendered, so your documents only change when the template is published.

The answer is the file itself (application/pdf), with the rendered version, the language and the number of warnings in headers. Send Accept: application/json to get JSON instead, with the file in base64 and every warning.

Neither your data nor the document is stored or logged.

Request ​

A JSON body (Content-Type: application/json):

FieldTypeRequiredDescription
templatestringyesThe template's ID (tpl_…), shown in the editor's publish area. The API renders a published version of it, never the draft.
versionintegernoThe published version to render. Default: the latest published version. Pin it so your documents only change when you change the number.
dataobjectyesThe data the template's placeholders are filled from: a JSON object, sent as it is (strings aren't trimmed). Required; send {} for a template without placeholders.
languagestringnoThe language to render in, a language tag with an optional region (de, de-AT). A text without that language falls back to the language without its region, then another region of it, then the template's default language. Default: the template's default language.
formatstringnoThe output format. Supported: pdf. Default: pdf. Any other value is answered with E_RENDER_UNSUPPORTED.

Example ​

sh
curl -X POST 'https://app.templo.at/api/v1/render' \
  -H "Authorization: Bearer $TEMPLO_API_KEY" \
  -H 'Content-Type: application/json' \
  --data '{
  "template": "tpl_01JDQ8Z3V6K9W2X4Y5A7B8C9D0",
  "version": 3,
  "data": {
    "company": {
      "name": "Bergwerk Design OG",
      "street": "Museumstraße 4",
      "city": "6020 Innsbruck",
      "country": "Austria",
      "iban": "AT61 1904 3002 3457 3201"
    },
    "customer": {
      "name": "Muster GmbH",
      "vat_id": "ATU12345678",
      "address": {
        "street": "Kärntner Straße 21",
        "city": "1010 Wien",
        "country": "Austria"
      }
    },
    "invoice": {
      "number": "INV-2026-0142",
      "date": "26 Nov 2026",
      "due": "10 Dec 2026"
    },
    "items": [
      {
        "description": "Template design workshop",
        "qty": 1,
        "price": "€1,200.00",
        "amount": "€1,200.00"
      },
      {
        "description": "PDF generation, 12,000 documents",
        "qty": 12,
        "price": "€45.00",
        "amount": "€540.00"
      },
      {
        "description": "Priority support, monthly",
        "qty": 1,
        "price": "€150.00",
        "amount": "€150.00"
      }
    ],
    "totals": {
      "subtotal": "€1,890.00",
      "vat": "€378.00",
      "total": "€2,268.00"
    }
  }
}' \
  -o document.pdf

Response ​

The document. With Accept: application/json, JSON with the document in base64 and its warnings.

application/json:

json
{
  "data": {
    "template": "tpl_01JDQ8Z3V6K9W2X4Y5A7B8C9D0",
    "version": 3,
    "format": "pdf",
    "language": "en",
    "pages": 1,
    "contentType": "application/pdf",
    "content": "JVBERi0xLjcKJcfsj6IK",
    "warnings": [
      {
        "code": "missing-data",
        "elementId": "order-reference",
        "pageId": "page-1",
        "path": "customer.order_reference",
        "message": "Element \"order-reference\": no data at \"customer.order_reference\", left empty"
      }
    ]
  }
}

With the file, these headers describe it:

  • Content-Language
  • Templo-Template-Version
  • Templo-Warnings
  • Content-Disposition

Errors: E_BAD_REQUEST, E_UNAUTHORIZED, E_PAYLOAD_TOO_LARGE, E_UNSUPPORTED_MEDIA_TYPE, E_VALIDATION_ERROR, E_RATE_LIMITED, E_INTERNAL_ERROR, E_TEMPLATE_NOT_FOUND, E_TEMPLATE_NOT_PUBLISHED, E_VERSION_NOT_FOUND, E_TEMPLATE_DOCUMENT_UNREADABLE, E_RENDER_INVALID_TEMPLATE, E_RENDER_INVALID_INPUT, E_RENDER_UNSUPPORTED, E_RENDER_TOO_LARGE, E_RENDER_BUSY, E_RENDER_TIMEOUT, E_RENDER_FAILED (what they mean).

Limits ​

The limits apply per workspace. A 429 or 503 answer carries Retry-After: wait that many seconds, then send the request again.

  • Requests: 60 per minute and workspace, all its API keys together; every request counts. Over it: 429 E_RATE_LIMITED with Retry-After. Every answer except a 401 carries RateLimit-Limit, RateLimit-Remaining, RateLimit-Reset and RateLimit-Policy.
  • Renders at once: 2 of a workspace's renders run at the same time and 8 more wait their turn. More than that: 429 E_RATE_LIMITED with Retry-After: 2. When the whole server is busy: 503 E_RENDER_BUSY.
  • Time: a render may take 10 seconds; then it is stopped (503 E_RENDER_TIMEOUT).
  • Size: data at most 1 MB as JSON (413 E_RENDER_TOO_LARGE); a body over 2.1 MB is refused before it is read (413 E_PAYLOAD_TOO_LARGE). The document at most 50 MB (422 E_RENDER_TOO_LARGE).

Errors ​

Every code the API answers with. React to the code: it stays the same, the message may change. E_VALIDATION_ERROR also lists each failing field in error.fields.

StatusCodeMeaningWhat to do
400E_BAD_REQUESTThe request could not be read.Send the body as valid JSON.
401E_UNAUTHORIZEDMissing or invalid API key. Send it as "Authorization: Bearer <key>".Send an API key of the workspace as Authorization: Bearer <key>; a revoked key needs a new one from the API keys page.
403E_FORBIDDENNot allowed.Check that this request is one the API offers; this reference lists them.
404E_NOT_FOUNDNot found.Check the method and path against this reference; every path starts with /api/v1/.
405E_METHOD_NOT_ALLOWEDMethod not allowed.Use the method this reference names for the path.
413E_PAYLOAD_TOO_LARGEThe request body is too large.Send less data: see the limits in this reference.
415E_UNSUPPORTED_MEDIA_TYPEUnsupported content type.Send the body as JSON with Content-Type: application/json.
422E_VALIDATION_ERRORThe request is invalid.Fix the fields listed in error.fields, then send the request again.
429E_TOO_MANY_REQUESTSToo many requests.Wait a moment, then try again.
429E_RATE_LIMITEDToo many requests for this workspace. Wait for the seconds in Retry-After, then try again.Wait for the seconds in Retry-After, then retry; send fewer requests at once.
400, other 4xxE_REQUEST_FAILEDThe request failed.Check the request against this reference.
500E_INTERNAL_ERRORSomething went wrong on our side.Try again later; if it keeps failing, report it with the time of the request.
404E_TEMPLATE_NOT_FOUNDNo template with this ID in the workspace of this API key.Check the template ID, and that the API key belongs to the template's workspace.
409E_TEMPLATE_NOT_PUBLISHEDThe template has no published version yet. Publish it in the Templo editor: the API renders published versions only, never the draft.Publish the template in the editor, then send the request again.
404E_VERSION_NOT_FOUNDThe template has no published version with this number.Pin a version that is published, or leave out version to get the latest.
409E_TEMPLATE_DOCUMENT_UNREADABLEThis version of the template can't be read by the server right now.Try again later; if it keeps failing, publish the template again in the editor.
422E_RENDER_INVALID_TEMPLATEThe template version is invalid and can't be rendered.Open the template in the editor, fix it and publish a new version.
422E_RENDER_INVALID_INPUTThe data can't be rendered.Send data as a JSON object.
422E_RENDER_UNSUPPORTEDThis format isn't supported for this template.Use a format the message names, or leave out format for a PDF.
413, 422E_RENDER_TOO_LARGEThe data is larger than the limit.Send less data, or make the document shorter.
503E_RENDER_BUSYToo many documents are being rendered right now. Try again in a moment.Wait for the seconds in Retry-After, then try again.
503E_RENDER_TIMEOUTThe render took too long and was stopped.Send less data or simplify the template, then try again.
422E_RENDER_FAILEDThe template couldn't be rendered with this data.Check the data against the template in the editor's preview; if it renders there, report it.

Any request can also get E_NOT_FOUND, E_METHOD_NOT_ALLOWED, E_FORBIDDEN, E_TOO_MANY_REQUESTS, E_REQUEST_FAILED: an unknown path, or a request refused before it reaches an operation. E_REQUEST_FAILED keeps the status of whatever refused it.

Warnings ​

A warning means the document was rendered, but something in it may not look as intended. The API answers 200 either way: the PDF answer counts them in Templo-Warnings, the JSON answer (Accept: application/json) lists each one with the element it concerns and a message. The editor shows the same warnings.

CodeWhenWhat to do
missing-dataA placeholder's path has no value in the data. The placeholder is left empty.Send a value at that path, or fix the path in the template.
unsupported-valueThe value at a placeholder's path is an object or a list, not a single value. The placeholder is left empty.Point the placeholder at a single value inside it (items.0.name), or send a string.
overflowA text with a fixed size is taller than its box: it runs past the bottom of the box. With shrink to fit, it still does not fit at its smallest font size (atMinFontSize is true).Shorten the text, make the box larger, lower the smallest font size, or let the box grow with the text (auto height) in the template.
unknown-fontA text's font isn't one of Templo's fonts. It is drawn in the default font.Pick one of the fonts the editor offers.