preview_rendering
readSince v1.0Render one rendering against one element and get the resulting page back, together with a report on what worked. You don't need a publication for this — it's the tool to use while writing a rendering, because create_rendering and update_rendering write the document blind.
The diagnostics are the real point. They tell you when a query block failed to parse, when a section matched nothing (and why — for example that no relationship type is spelled the way you spelled it), when a block refers to a section you never declared, and when an interpolation can never resolve. A section that silently finds nothing is the most common authoring mistake and it is invisible in the rendered page, so read the diagnostics before trusting the output.
Pass a locale to see the page as a reader of that language sees it.
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
rendering | String | ✓ | The rendering to preview, by ID or name. Use list_renderings to find it. | |
format | String | — | markdown | How to return the page: 'markdown' is the readable, diffable version; 'html' is what the in-app viewer shows. |
subject | String | — | The element to render the page about — an ID, an auto-ID such as 'SRV-12', or a label. Leave it out only for a document that isn't about any one element, such as a publication homepage. It should be of the type the rendering targets; a mismatch still renders but is reported as a warning. | |
locale | String | — | Render the page as a reader of this language sees it (for example 'de'). |
Example Request
{"rendering": "Service page", "subject": "SRV-12", "format": "markdown"}Example Response
{"content": "# Payment Capture\n\n...", "format": "markdown", "sections": [{"name": "roles", "kind": "collect", "item_count": 0, "displayed": true}], "diagnostics": [{"severity": "warning", "message": "Section 'roles' resolved to 0 items: no relationship type matches 'composed of'"}]}This content was written collaboratively with AI.