Diagrams

Read a diagram

Returns the outline by default: a header (id, title, revision, time, short hash), key, brief and recent versions, then one element per line nested by container and edges as 'id: from -> to "label"'. view=dsp returns the scene document as written instead: values the engine infers while drawing, such as an ER edge end's cardinality from its column, aren't in it. revision or asOf reads an earlier version. knownRevision returns { unchanged: true } or only the changes since that revision. elements (comma-separated IDs) limits the outline to those elements and their neighbors.

get/v1/diagrams/{id}

Request

  • Base URL: https://api.zindex.ai
  • URL: https://api.zindex.ai/v1/diagrams/{id}
  • Auth: one of:
    • HTTP bearer
    • API key in header X-API-Key

Path parameters

idstring required

The diagram's ID or key

Query parameters

view'outline' | 'dsp' | 'mermaid'

outline (default) is a compact text outline; dsp is the scene document; mermaid is Mermaid text (erDiagram for entity-relationship diagrams, a flowchart otherwise; not available for sequence diagrams) that you can edit and send back as an edit.

revisioninteger

An earlier version by number; default the latest. Not with asOf.

asOfstring

A date (2026-06-30, the end of that day in UTC) or an ISO 8601 timestamp with an offset

knownRevisioninteger

The revision you last read, when reading the latest version: the latest itself answers { unchanged: true, id, revision, hash, chain }, and an older one returns only what changed since, as text.

elementsstring

Comma-separated element IDs

cursorstring

nextCursor from a long outline

Response

The outline ({ id, revision, text, nextCursor? }), the scene ({ id, key, revision, hash, chain, createdAt, visibility, madePublicAt?, scene }, with madePublicAt while the diagram is public), the Mermaid ({ id, revision, hash, chain, mermaid, notes? }, where notes say what Mermaid can't show), or { unchanged: true, id, revision, hash, chain }. hash and chain are the version's content and chain hashes, as in DiagramWrite.

object required

Changes

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