Create or update a diagram
Creates a diagram entity from either a raw tldraw snapshot or structured input, and optionally links it to a host entity. Typical draw.io import flow: (1) convert XML via POST /convert/drawio-to-tldraw, (2) call this endpoint with the returned snapshot plus a hostEntityId, (3) optionally embed the diagram in the host’s rich-text field (e.g. description) by appending a node of the form {"type": "tldraw", "diagramId": "<id>", "children": [{"text": ""}]} via PUT /project//entities//values — embeds only resolve diagrams linked to the entity that owns the field. Upsert semantics: re-POSTing with the same id replaces that diagram’s name and snapshot in place (e.g. re-importing an updated source file); an id belonging to a non-diagram entity is rejected with 409.
Authorizations
Headers
Workspace identifier
Path Parameters
Body
Diagram title
Freestanding text annotations (titles, section labels)
Branch to write to. Omit or pass "master" for the base branch.
Directed arrows between entity/node IDs
Flow platform entities to render as data-shape cards (entity relationship diagrams). For generic shapes use nodes instead.
Entity to link the diagram to. The diagram appears in this entity's Diagrams section, and rich-text embeds ({"type": "tldraw", ...} nodes) only resolve diagrams linked to the entity that owns the field — pass this whenever the diagram should be visible from an existing entity.
Diagram entity ID (UUID). Auto-generated if omitted. If an existing diagram entity has this ID, its name and snapshot are replaced (upsert); if a non-diagram entity has this ID the request fails with 409.
Standalone geometric nodes not backed by Flow entities (state machines, flowcharts). Provide x/y on every node for a controlled layout.
Pre-built tldraw snapshot to persist verbatim — exactly the snapshot object returned by POST /convert/drawio-to-tldraw. Mutually exclusive with entities/nodes/connections/annotations.