insertDiagramInDocument
Insert a new diagram into a document. Call listDiagramTypes to find your type, then getDiagramTypeGuide for DSL syntax before writing diagramCode. The diagramCode is COMPILE-CHECKED BY RENDERING at write time: broken DSL is rejected with the renderer's error (fix and retry), and valid DSL is rendered + thumbnailed immediately so the document displays instantly everywhere. The response tells you what happened: diagram.renderStatus ('rendered' | 'pending_render' with renderError when the renderer was unavailable), plus fresh optimistic-lock tokens — document.versionTimestamp and diagram.versionTimestamp — so you can keep editing without re-reading. Always set prompt (and ideally nlDescription) to describe what the diagram shows. To SEE the result inline set returnImage:true, or call getDiagramImage afterwards; if it is wrong or ugly, correct it with updateDiagramInDocument (provide the full updated diagramCode).
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/insertDiagramInDocument
- Auth: HTTP bearer
Request body
Response
Tool result (shape varies per tool — refer to the tool's docs for the exact return value).
Changes
No recorded changes to this operation across all 1 revision of this API.