Convert
Convert a diagram XML document to a tldraw snapshot
Accepts either format and auto-detects which one was sent:
- draw.io — raw
<mxGraphModel>, inline<mxfile>, or compressed<mxfile>/.drawio. Mapping is best-effort: shapes without a tldraw equivalent fall back to rectangles, and colors are quantized to the closest of tldraw’s 13 default colors. Only the first page is converted. Arrow waypoints and external images are dropped. - Flow’s own
<diagram>XML — the output of/convert/tldraw-to-xml.<entity>becomes a data-shape card,<group>a frame,<shape>a geo shape, and<connection>a bound arrow. Connection endpoints resolve by id, falling back to the exported name for files produced before shapes carried ids; connections whose endpoints can’t be resolved are dropped.
Returns a tldraw StoreSnapshot JSON that can be loaded directly into the diagram editor via loadSnapshot(editor.store, snapshot).
POST
Convert a diagram XML document to a tldraw snapshot
Authorizations
Headers
Workspace identifier
Body
application/json
Diagram XML in either supported format — the endpoint detects which:
- draw.io: a raw , an wrapper with an inline , or an whose body is the draw.io compressed form (base64 + raw-deflate + URI-encoded XML).
- Flow: a document as produced by /convert/tldraw-to-xml.
Response
200 - application/json
tldraw StoreSnapshot — { store, schema } consumable by loadSnapshot