Appearance
JSON to HTML (secret key)
POST
/landing-page/v1/json2html
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.
Authorizations
SecretKeyAuth
Secret key from your Topol account, for server-to-server calls. Not needed on /landing-page/get-html, which authenticates through the request body.
Type
API Key (header: X-Secret-Key)
Request Body
application/json
JSON "definition": "{"tagName":"mj-global-style","metadata":{"title":"Spring sale","description":"","image":""},"children":[{"tagName":"mj-body","attributes":{"background-color":"#ffffff"},"children":[{"tagName":"mj-section","uid":"section-1","attributes":{"padding":"10px"},"mdAttributes":{},"smAttributes":{},"xsAttributes":{},"container":{"tagName":"mj-container","attributes":{"display":"flex","width":"85%","max-width":"1200px","margin":"0 auto"},"mdAttributes":{"width":"100%","max-width":"810px"},"smAttributes":{},"xsAttributes":{}},"children":[{"tagName":"mj-column","uid":"column-1","attributes":{"flex-basis":"100%"},"mdAttributes":{},"smAttributes":{},"xsAttributes":{},"children":[{"tagName":"mj-text","uid":"text-1","customKey":null,"attributes":{},"mdAttributes":{},"smAttributes":{},"xsAttributes":{},"content":"<p>Hello from your landing page.</p>"}]}]}]}],"fonts":[],"style":{"body":{"font-family":"Helvetica, Arial, sans-serif"},"h1":{"font-size":"32px","font-weight":"bold"},"p":{"font-size":"16px"}},"settings":{}}", "options": { "minify": true, "fonts": "[{"label":"Open Sans","style":"Open Sans, sans-serif","url":"https://fonts.googleapis.com/css?family=Open+Sans:400,700"}]" }, "syncedSections": [ { "id": 1, "definition": "{"tagName":"mj-section","uid":"synced-1","attributes":{},"mdAttributes":{},"smAttributes":{},"xsAttributes":{},"container":{"tagName":"mj-container","attributes":{},"mdAttributes":{},"smAttributes":{},"xsAttributes":{}},"children":[]}" } ]
{
}
Responses
Template converted successfully
application/json
JSON "html": "<!doctype html><html><body>Hello World</body></html>", "warnings": [ { "type": "missing_fonts", "message": "Template contains fonts that are not available in either the provided fonts or default font set", "missing_fonts": [ [ "Montserrat" ] ] } ]
{
}