Rendering

In the Editor you can configure a renderer that takes a template content and a data context, evaluates all expressions in the template against that data, and returns the rendered document as HTML.

Default engine

The default engine is available at https://engine.jsontemplates.io/api/render. It implements the full rendering pipeline and returns the HTML output.

The Editor is pre-configured to use it. You can trigger a live preview directly from the editor by providing your data context and clicking Preview.

The rendering API contract

Any custom renderer must implement a single HTTP endpoint with the following contract:

Request

POST /your/render/endpoint
Content-Type: application/json
{
    "template": { ... },
    "data": "{ \"invoice_number\": \"001\", \"total\": 1500 }"
}
Field Type Description
template object The parsed template.json object
data string The data context as a raw string (JSON, YAML, or XML)

The data field is a raw string — your renderer is responsible for parsing it into the appropriate data context before evaluating the template variables.

Success response

HTTP 200 OK
Content-Type: application/json
{
    "data": "<html>...</html>"
}

The data field must contain the full rendered HTML string.

Error response

When the rendering fails, return a non-2xx status code. You may include a detail field to provide a human-readable error message that will be displayed in the editor:

{
    "detail": "Variable 'invoice_number' is not defined."
}

Configuring a custom renderer in the editor

The Editor exposes a “Engine Render URL” input in the preview panel. Enter the URL of your endpoint there and the editor will use it instead of the default engine.

The URL is persisted automatically in localStorage, so it survives page reloads.

On this page

Last updated on 06/04/2026 by Anonymous