Diagrams

Render a diagram without saving (public)

Draws a DSP scene or Mermaid text as SVG or PNG without saving it, and needs no key. Counts against the per-IP rate limit, and the ceiling shared by callers without a key, even when a key is sent. An API key, or the site's signed-in session, raises the drawing budget from 5 s to 20 s.

post/v1/diagrams/preview

Request

  • Base URL: https://api.zindex.ai
  • URL: https://api.zindex.ai/v1/diagrams/preview
  • Auth: none required

Query parameters

theme'clean' | 'dark' | 'blueprint' | 'sketch'

Same as the body's theme

format'svg' | 'png'

Same as the body's format

Request body

format'svg' | 'png'
mermaidstring

Mermaid text, instead of scene: an erDiagram or a flowchart (graph). Converted deterministically: element IDs come from the Mermaid IDs and the same text always gives the same diagram. Subgraphs, edges to them and styles are left out for now and listed in warnings; other diagram types are refused with UNSUPPORTED_DIAGRAM_TYPE, and syntax errors return PARSE_ERROR with line and column.

theme'clean' | 'dark' | 'blueprint' | 'sketch'

Draw the preview in this theme. Without one, the preview uses the default style (not clean), or dark when the canvas background is dark, as saved versions always do.

Response

The image

Changes

No recorded changes to this operation across all 1 revision of this API.