diagrams

getDiagramImage

Render a diagram that ALREADY exists in a document to an IMAGE (svg/png/jpeg @1x/2x/3x) and return it — a temporary imageUrl available for 1 hour plus, for png/jpeg, the image inline so you can see it, and title/url citing the document the diagram lives in. Pass the diagramId (from getDocument's DIAGRAM markers or getDiagramInDocument). Reuses the diagram's cached server render when available (pixel-identical to the editor), otherwise renders from the diagram's source on the fly. Read-only: nothing in the document or the diagram is changed; the image is a temporary artefact that expires after 1 hour. Use renderDiagram instead to generate from raw DSL without an existing diagram.

post/tools/getDiagramImage

Request

  • Base URL: https://api.stablebaseline.io/functions/v1/cloud-serve/api/v1
  • URL: https://api.stablebaseline.io/functions/v1/cloud-serve/api/v1/tools/getDiagramImage
  • Auth: HTTP bearer

Request body

diagramIdstring required

The diagram's id (from getDocument markers / getDiagramInDocument).

format'png' | 'jpeg' | 'svg'

png (default) or jpeg = raster; svg is scalable. A platform default diagram's SVG contains a browser foreignObject scene, so use PNG/JPEG where foreignObject SVG is unsupported.

scale1 | 2 | 3

Raster resolution multiplier 1x/2x/3x (default 2). Ignored for svg.

backgroundstring

Background for png/jpeg, e.g. '#ffffff' or 'transparent' (png only).

Response

Tool result (shape varies per tool — refer to the tool's docs for the exact return value).

object required

Changes

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