---
title: "API Operation"
description: "Developer documentation for Topol's embeddable white-label email editor and landing page editor (beta). Get practical insights and guidance for integration and optimized user experiences."
url: https://docs.topol.io/landing-page-editor/guide/operations/convertPageJson2Html.html
---

## JSON to HTML (secret key)

Convert a landing page JSON template definition to rendered HTML from your own backend. Authenticate with the `X-Secret-Key` header (the secret key of your Topol API token); no hostname check applies, so this is the endpoint for server-to-server rendering. The rendering is identical to what the editor produces on save.

If the template contains synced sections (any section node with a `syncedId` property), pass their current content through the optional `syncedSections` request field. The endpoint looks up each `syncedId` in the supplied array and splices the section's full definition into the template before rendering, regenerating child block UIDs to avoid collisions. Without this field the page renders with the section content embedded in the template definition, which may be stale.

Fonts used by the page that are neither in `options.fonts` nor in the built-in font set are reported in `warnings`; the HTML is still rendered.

### Endpoint

`POST https://api.topol.io/landing-page/v1/json2html`

### Authentication

- **SecretKeyAuth** (header `X-Secret-Key`) — Secret key from your Topol account, for server-to-server calls. Not needed on /landing-page/get-html, which authenticates through the request body.

### Request body (required)

Template conversion request

Content-Type: `application/json`

- `definition` _string_ **required** — The landing page template definition as a JSON string - the same JSON the editor's onSave callback delivers, serialized with JSON.stringify()
- `options` _object_ **required** — Template conversion options
  - `minify` _boolean_ — Whether to minify the output HTML
  - `fonts` _string_ **required** — JSON string containing an array of font objects with label, style, and url properties. Pass "[]" when the page uses only the built-in font set.
- `syncedSections` _object[]_ — Resolved content for every synced section referenced by the template. A section in the template JSON that carries a `syncedId` is stored as a lightweight reference only; supply the matching content here so the endpoint renders the latest version of each section instead of the copy embedded in the template definition. Sections whose `syncedId` has no match in this array keep the content embedded in the definition.
  - `id` _number_ **required** — ID of the synced section. Must match the `syncedId` on a section node in the template JSON.
  - `definition` _string_ **required** — JSON-encoded definition of the synced section (string, not a nested object) - the `definition` your `api.SAVED_SECTIONS` endpoint returns for the section.

### Responses

#### 200 — Template converted successfully

Content-Type: `application/json`

- `html` _string_ **required** — Rendered HTML output
- `warnings` _object[]_ — Optional warnings about the conversion (present only when there is at least one)
  - `type` _"missing_fonts"_ **required** — Type of warning
  - `message` _string_ **required** — Warning message
  - `missing_fonts` _string[]_ — List of missing font names

#### 401 — Unauthorized - missing, invalid or expired X-Secret-Key header

Content-Type: `application/json`

- `message` _string_ **required** — Error message
- `error` _string_ — Underlying error message (present on conversion failures)

#### 422 — Validation error - request fields missing or malformed, or the definition / fonts are not valid JSON

Content-Type: `application/json`

#### 500 — Internal server error while converting the template

Content-Type: `application/json`

- `message` _string_ **required** — Error message
- `error` _string_ — Underlying error message (present on conversion failures)
