REST API
/v1/diagrams does the same work as the MCP tools, through the same code. The full contract, with every field and status code, is in the OpenAPI spec. The first version, /v1/scenes, is retired: every path answers 410 with code: "MOVED" and the method and path that replace it.
Authentication
Send an API key as Authorization: Bearer <key> (or in X-API-Key) on every call except these, which need none: POST /v1/diagrams/validate, POST /v1/diagrams/preview, GET /v1/public/diagrams/{ref} (a published diagram’s or a share link’s page and images) and its /changes, POST /v1/public/diagrams/{ref}/report, and the signed image links a render returns. Create keys under Dashboard → API keys once the account’s email is verified; sign-up makes no key. A key starts with dsp_sk_ and is shown once, when it is created. It acts in the workspace selected when it was made.
The MCP server also signs people in with their Zindex account (OAuth 2.1) as their client connects (MCP tools). Those sign-in tokens work only on /mcp.
- Key errors. A key that isn’t accepted gets
401with acode:API_KEY_INVALID(unknown, or its account was closed),API_KEY_REVOKED(revoked, or its person is no longer in its workspace) orAPI_KEY_EXPIRED. A request with no key at all getsAUTH_REQUIRED. Retrying the same key won’t help; use another. - Workspaces. A diagram belongs to a workspace: your personal one, or a team workspace you are in. Each key acts in exactly one workspace, and any key of anyone in that workspace can read its diagrams. A diagram in another workspace answers 404
NOT_FOUND, the same as one that doesn’t exist. No endpoint takes a workspace parameter; to work in two workspaces, use a key for each (Workspaces). A diagram moves from your personal workspace into a team workspace only from the signed-in dashboard (Moving a diagram in). - Write and read keys. A key has
scopewriteorread. A read key finds, reads, renders, compares and exports one diagram, and stars diagrams for its person. Anything that changes or shares a diagram, or reports a problem with one, answers403withcode: "READ_ONLY"andreason:credentialfor a read key,rolewhen the key’s person is a viewer in the workspace, whose keys act read-only whatever their scope. - Email verification. Until the account has verified its email, saving, editing, deleting, restoring, sharing and reporting a diagram, sending feedback, creating a key (
POST /v1/auth/keys) and allowing an app to connect return403withcode: "EMAIL_NOT_VERIFIED"; send the person to https://zindex.ai/verify-email/. Reads, renders and the endpoints that need no key are never held back. GitHub and Google sign-ups are verified at once.
To create another key with an existing one:
curl -s https://api.zindex.ai/v1/auth/keys \
-H "Authorization: Bearer $ZINDEX_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "name": "Production Key" }'
The response holds the new key, which can’t be retrieved again, with its scope and workspaceId. The new key acts in the same workspace as the key that made it. Add "scope": "read" for a read key; the default is write when the caller can write, and read otherwise. Asking for write with a read key, or as a viewer, answers 403 with code: "READ_ONLY". Add "expiresInDays" (a whole number from 1 to 366) for a key that expires; leave it out, or send null, for one that doesn’t. Any other value returns 400 with code: "INVALID_EXPIRES_IN_DAYS". The number of keys a workspace can have depends on its plan (Limits); a viewer can hold 3 in a workspace.
Endpoints
| Method and path | Does |
|---|---|
POST /v1/diagrams | Save a diagram: { scene or mermaid, key?, brief?, message?, project? } |
GET /v1/diagrams | Find diagrams, latest version first: query, key, limit, cursor, and the filters below; each item as diagram_find answers it |
GET /v1/diagrams/{id} | Read: view (outline, dsp or mermaid), revision, asOf, knownRevision, elements, cursor |
POST /v1/diagrams/{id}/revisions | Change it with ops or edited mermaid, making the next revision |
GET /v1/diagrams/{id}/revisions | History: limit, cursor, asOf |
GET /v1/diagrams/{id}/compare | What changed between from and to (revision numbers or dates) |
GET /v1/diagrams/{id}/render | SVG and PNG links to one version (revision or asOf): permanent for a published diagram until it’s made private or deleted, otherwise signed and valid for 7 days |
GET /v1/diagrams/{id}/export | The whole history as JSON Lines, oldest first (see Export) |
GET /v1/workspace/export | Every diagram in the workspace, each with its whole history, in one file (see Export); also at GET /v1/account/export |
GET /v1/images/{id}@{revision}.svg or .png | One version’s image |
GET /v1/images/{id}@{revision}.thumbnail.png | A 640 x 360 thumbnail of one version, as the dashboard’s list shows it: the whole diagram on its canvas color, or the top of one more than about 1.1 times as tall as it is wide across its full width, without its address line. Can be cached for a year |
POST /v1/diagrams/validate | Check without saving: { scene }, { mermaid }, or the scene document itself as the body (no key needed) |
POST /v1/diagrams/preview | The image of a scene or Mermaid without saving it, in the scene’s theme, or the one the Mermaid config maps to: SVG, or PNG with format: "png" (no key needed) |
DELETE /v1/diagrams/{id}?confirm=true | Delete, with a 24-hour undo |
POST /v1/diagrams/{id}/undelete | Undo a delete |
PUT /v1/diagrams/{id}/star and DELETE | Star a diagram for yourself, or unstar it. Stars are yours alone; anyone who can read the diagram can star it |
PUT /v1/diagrams/{id}/sharing | { "visibility": "public" } or "private"; publishing returns the public link and madePublicAt |
POST /v1/diagrams/{id}/links | Create a share link (see Share links) |
GET /v1/diagrams/{id}/links | The diagram’s live share links, newest first, each with who made it (createdBy); state=ended or all for the record of links that ended or were revoked |
DELETE /v1/diagrams/{id}/links/{linkId} | Revoke a share link; its record stays |
POST /v1/diagrams/{id}/reports/preview | Preview a problem report (see Report a problem) |
POST /v1/diagrams/{id}/reports | Report a problem with one version |
GET /v1/diagrams/{id}/reports | Your reports on the diagram, newest first |
GET /v1/diagrams/{id}/reports/{reportId} | One report, drawn as Zindex support sees it |
DELETE /v1/diagrams/{id}/reports/{reportId} | Withdraw a report |
POST /v1/feedback | Send Zindex feedback, with or without a diagram (see Feedback) |
GET /v1/feedback | Your feedback, newest first, with its status |
GET /v1/public/diagrams/{ref} | What a published diagram’s or a share link’s page shows; add .svg or .png for the image (no key needed) |
GET /v1/public/diagrams/{ref}@{revision}/changes?from={revision} | How many elements a version added, changed, removed and moved since another version the link shows, for a published diagram or an every-version link (no key needed) |
POST /v1/public/diagrams/{ref}/report | Report a diagram seen at its page, published or shared with a link, that breaks the content policy (no key needed) |
Wherever {id} appears, the diagram’s ID or your key for it works, except under /v1/public, which takes the ID, or a share link’s token, but never a key.
The list’s filters: diagramFamily lists one family (none for diagrams without one), starred=true only the ones you starred, and project one project’s diagrams (none for diagrams in no project). deleted=true lists the ones deleted in the last 24 hours, which can still be restored. key and deleted=true ignore the other filters.
Save
curl -s https://api.zindex.ai/v1/diagrams \
-H "Authorization: Bearer $ZINDEX_API_KEY" -H "Content-Type: application/json" \
-d '{
"key": "payments-architecture",
"brief": "Checkout payment services, left to right.",
"scene": {
"schemaVersion": "0.1",
"scene": { "title": "Payments" },
"layoutStrategy": { "direction": "LR" },
"elements": [
{ "id": "api", "kind": "node", "nodeType": "service", "label": "API" },
{ "id": "db", "kind": "node", "nodeType": "database", "label": "Ledger" },
{ "id": "e1", "kind": "edge", "from": { "elementId": "api" }, "to": { "elementId": "db" }, "label": "writes" }
]
}
}'
{"id":"dgm_7Q2kD9a1B2c3","key":"payments-architecture","revision":1,"hash":"sha256:3f9a…","chain":"sha256:fdac…","warnings":[],"created":true}
Instead of scene you can send Mermaid text as mermaid, for an erDiagram, a flowchart (graph) or a sequenceDiagram. Element IDs come from the Mermaid IDs (in a sequence diagram, only participants’ do), and the same text always gives the same diagram. What Mermaid leaves out is listed in warnings, and other Mermaid types are refused: see Mermaid scope.
warnings lists what checking the scene and drawing it noticed, each with the element when there is one and a one-line fix. For example:
TEXT_OVERFLOW: text doesn’t fit its element.NODE_OVERLAP_DETECTED: two nodes sit on top of each other.CHARACTER_NOT_DRAWN: text holds characters drawn as empty boxes (Text and scripts).
The diagram is saved either way; an edit fixes it. POST /v1/diagrams/validate reports the same warnings without saving.
A create, a saved edit, a restore or a render that leaves the workspace at 80% or more of a plan limit also carries LIMIT_NEAR, with the count and the limit. No edit clears it, and validate doesn’t return it (Limits: Before a limit).
Zindex mints the ID; any scene.id you send is ignored. The key is your own name for the diagram, unique among the workspace’s live diagrams. Sending the same create again, with the same key and content, returns the existing diagram with created: false and status 200 (a new diagram answers 201), so retries are safe. The same key with different content, including after an edit, is a 409, KEY_EXISTS, and so is a teammate’s create with a key the team workspace already has, whatever its content: read and edit that diagram instead. Without a key, every create makes a new diagram.
project files the new diagram under a project, by name: 1 to 40 characters, matched ignoring case, and not none or all. A name no project has makes a new project, so a typo makes a stray one; leave project out for a diagram in no project. A create repeated with the same key and content leaves the project as it was. The answer doesn’t say whether the create made the project, so list the diagrams and read their project to see the names in use first.
hash is the version’s content hash, the SHA-256 of the scene that view=dsp returns, in RFC 8785 canonical form. chain is its chain hash. It also covers the version’s stored image and the chain hash of the version before it, so it changes if anything up to that version changes. chain is null until Zindex has computed it, normally when the version is saved; a render, an export or the next edit computes a missing one. Reads and the history never compute it. Verifying shows how to check a whole history with them.
Read
A read answers JSON: { id, revision, text }, with nextCursor when a long outline continues. GET /v1/diagrams/payments-architecture returns this outline as its text:
dgm_7Q2kD9a1B2c3 "Payments" r1 2026-10-05T09:12Z sha256:3f9a0c1d2e4b
key: payments-architecture
brief: Checkout payment services, left to right.
recent: r1 curl/8.7.1
outline: 2 nodes, 1 edges
api service "API"
db database "Ledger"
e1: api -> db "writes"
view=dspreturns{ id, key, revision, hash, chain, createdAt, visibility, scene }instead, wheresceneis the scene document with defaults filled in and withoutcomputed, the engine’s drawing output (element boxes, edge routes, label positions). The answer for the sample diagram Zindex made in a new account addssample: true. It holds what was written: what the engine infers while drawing, such as an ER edge end’s cardinality from its column or the arrowheads an edge’s type or an AWS or Google Cloud diagram gives, isn’t in it (an older version can still list its type’s arrowheads; they draw the same). Thesceneis valid input:POST /v1/diagramswith{ "scene": ... }saves a copy under a new ID. A version saved before 8.0.0 can hold sequence fragment operands with ay, which the schema refuses: replace each withstartsAt, the ID of the message or note it starts at, before sending it back. Each node’slayoutholds the position the engine placed it at, which is part of the content and itshash. Later edits keep it, andchanged.movedlists the nodes an edit only moves or saves at a new size. Thelayoutalso holds the size the node is drawn at, except for the nodes Element types: Node size and wrapped text lists. SendautoLayoutto have the engine place nodes again. The engine lays sequence diagrams out from their messages, so their nodes stay atx: 0, y: 0, which means not placed. An edit keeps a placed node where it is unless:- a node that grows needs the room
- a new node’s edge label needs more room than the column it joins
- an edit adds a line, or changes what its label needs, and the label has no room on its line, or
autoLayoutnames the line (Layout engine) - a new task in a pool needs room in its lane or a column of its own
- a node an edit inserts in a flowchart needs room along the flow
- a node an edit adds to a frame without a
layouthas no room there - an AWS diagram’s row or column grows for a node or a spanning frame’s header an edit adds, or for the room round a tier frame
- an edit moves an AWS diagram’s Region’s column right to keep a labeled line into the column clear
- a Google Cloud diagram’s row, zone column, Region or project’s box grows, a gap between two Regions, two projects or two zone columns opens, or a line crosses an item in a row, for what an edit adds
- a layer in a stack of layers grows for a card an edit adds to it or moves into it, or an edit adds a layer, and what lies after it moves along by the growth (the card stands in that layer’s row)
- an edit moves it to another lane
- a frame added or deleted around it would leave frames overlapping or a frame holding a node that isn’t its member
- an
orderconstraint you add finds its two nodes the wrong way around
view=mermaidreturns{ id, revision, hash, chain, mermaid, notes }: the diagram as Mermaid you can edit and send back (Edit as Mermaid). Entity-relationship diagrams come back as anerDiagram, sequence diagrams as asequenceDiagram, every other family as aflowchart, andnotessay what Mermaid can’t show.revision=3, orasOf=2026-09-26(the end of that day in UTC) or an ISO timestamp with an offset, reads an earlier version.knownRevision=1, on a read of the latest version, returns{ "unchanged": true }, or only what changed since revision 1, one line per element. Elements that only moved or were resized follow on onemoved:line, when there are any.elements=api,dblimits the outline to those elements and their neighbors.
Change
curl -s https://api.zindex.ai/v1/diagrams/payments-architecture/revisions \
-H "Authorization: Bearer $ZINDEX_API_KEY" -H "Content-Type: application/json" \
-d '{
"baseRevision": 1,
"message": "Add the job queue",
"requestId": "6f1c2e7a-4b0d-4c55-9a51-2f1f8f7c9d10",
"ops": [{ "op": "createNode", "id": "queue", "nodeType": "queue", "label": "Jobs" }]
}'
{"id":"dgm_7Q2kD9a1B2c3","revision":2,"hash":"sha256:9b1c…","chain":"sha256:e665…","warnings":[],"changed":{"added":["queue"],"updated":[],"removed":[],"moved":[]}}
Every edit needs baseRevision, the revision you planned it against. Send exactly one of ops (operations, up to 500), mermaid (below), restoreRevision (a revision number, or { "asOf": "2026-09-26" }), or brief on its own. brief may also go with ops or mermaid; null removes it.
- Every change appends a revision; nothing is overwritten.
- An edit that changes nothing returns
noop: trueand makes no revision. - An edit with an error saves nothing and returns a 422,
VALIDATION_FAILED, witherrors. That includes an op that can’t apply, such asmoveElementon an edge, and a result that breaks a rule the diagram didn’t. - A retry with the same
requestIdreturns the first result withreplayed: true. The samerequestIdwith a different edit is a 422,REQUEST_ID_REUSED. changedlists what the editadded,updatedin content andremoved, and what it onlymovedor resized, the engine’s moves included. It holds at most 20 IDs, andmorecounts the rest (diagram_edit has the details).- If the diagram moved on since
baseRevision, the answer is a 409,REVISION_CONFLICT, with the currentrevisionand, when your base is older than it,changes, the elements that changed since your base. A retry whose result is already the current content returnsnoop: trueinstead.
Edit as Mermaid
Send the whole diagram as mermaid instead of ops, usually text you read with view=mermaid and changed. Zindex compares it with the baseRevision version and applies only the differences, as operations, so everything you didn’t change keeps its ID. Nodes and edges missing from the text are deleted. Groups never change this way. Frames change only in a sequence diagram, as its blocks, box and rect lines (Mermaid scope: Sequence diagram edits). It works on architecture, flowchart, entity-relationship and sequence diagrams, and diagrams without a family; Mermaid scope has the rules.
Images
GET /v1/images/dgm_7Q2kD9a1B2c3@2.svg with your API key returns that version’s SVG; .png returns a PNG. Each version’s image is drawn once, when it is saved, and kept, so it never changes; add ?engine=current to draw it again with today’s engine instead (not stored). Versions and their images are in Zindex’s own storage by default, on every plan; a Pro or Team workspace whose owner connected its own GitHub repository keeps them there instead, and these endpoints answer the same (Bring your own storage). Add ?from=1 to draw that version with what changed since revision 1 colored: added in green, removed in red and changed in amber; what only moved is drawn as unchanged (from must be another revision of the diagram; anything else is a 400). GET /v1/diagrams/{id}/render, like the MCP tool diagram_render, returns links to the same images that a person can open from a chat without a key, with the image’s width and height in pixels, the version’s savedAt, the latest revision and the diagram’s title (left out when it has none): a published diagram’s links, which don’t expire but stop if the diagram is made private or deleted, with url for the version’s page; for any other diagram, signed links that work for 7 days, with expires. With knownRevision, a revision you already have, it answers only { id, revision, unchanged: true } when that is the version it would render, and doesn’t count it as a render. Render links draw the plain version, and diagram_render has no from. For a published diagram they are its page’s links, which take from with no key: add ?from= to the svg or png it returns (What changed, through a link), as you can to an every-version link’s. For a private diagram, an agent connected only through MCP sign-in gets changes as text from diagram_history with compare rather than as a colored image.
Links anyone can open
A published diagram, and a diagram shared with a link, has a page and an image that anyone can open without a key. Sharing says what each kind of share link shows and who it’s for.
| Link | Shows |
|---|---|
https://zindex.ai/d/{ref} | A published diagram or an every-version link: the latest version, its number and date, and the other versions. A version link or a latest link: its one picture |
https://zindex.ai/d/{ref}@{revision} | That version, which never changes. A version link or a latest link answers 404 |
The same with .svg or .png | The image itself |
{ref} is a published diagram’s ID, or a share link’s token. An image is the one Zindex kept for the version. A version link’s or latest link’s picture is that image with a stamp of its own in place of the version’s address (What a recipient sees). The website answers these links from GET /v1/public/diagrams/{ref}, which you can call directly; add .svg or .png for the image. Its answer gives the image’s size in pixels, width and height, the same for the SVG and the PNG. A share link’s answer never has the title.
Over MCP, diagram_render takes these links as id too, from any workspace (MCP tools).
A link’s page has what a viewer can do: Present shows the diagram alone on the screen, fitted and zoomable; Download saves the picture shown as PNG or SVG. A published diagram’s or every-version link’s page also steps through the versions the link shows, and Color what changed colors what changed since the version before. Nothing an owner does is on it: sharing, the embed links and the scene JSON stay on the diagram’s page in the dashboard.
Putting a diagram in a doc, issue or README
Embedding and linking says which link to use where, with the text to paste for each place. It also shows how a Claude artifact, which can’t load images from other sites, shows a diagram.
Scope:
- These links need a published diagram or a share link (Sharing says which plans make which). Neither can be made in a team workspace whose owners turned public sharing off.
- A share link in a public repository is as public as the repository: anyone reading the page can open it. Revoking the link breaks every image that uses it (Caching and taking links down covers what other caches keep).
- The signed links from
GET /v1/diagrams/{id}/renderstop working after 7 days. They suit sending an image to someone, never a page that stays up.
Share links
POST /v1/diagrams/{id}/links makes a share link: anyone who has it sees what it shows, never the scene JSON, the title or the description, and making it doesn’t publish the diagram. Sharing says which kind of link suits whom. The body is optional, and a field left out takes its default:
| Field | Meaning | Default |
|---|---|---|
shows | version: one version, which never changes. latest: the newest version each time the link is opened, without earlier ones. every: every version and what each changed, including versions saved later | version |
revision | The version a version link shows | The latest |
name | Who the link is for, up to 60 characters, with at least one visible. Anyone with the link sees it, and a version link or latest link prints it on its picture | None |
ends | The link’s last day, YYYY-MM-DD, today or later: it stops at 23:59:59 UTC that day. null for no end date | 90 days for a version link, 30 for an every-version link, none for a latest link; 7 days on Free |
- Plans. On Free, a link shows one version and ends within 7 days. A latest or every-version link, or a later end date or none, returns
403withcode: "FEATURE_UNAVAILABLE"and thefeatureit needs (Limits). Listing and revoking links work on every plan. - A public diagram. A version link or latest link would show less than its public page, so it returns
400INVALID_REQUEST: make the diagram private first. - Sharing off. In a team workspace whose owners turned public sharing off, creating a link, and publishing, return
403withcode: "SHARING_DISABLED"(Workspaces). - The address. A link’s token is 22 random characters, so it can’t be guessed, and it opens only its own diagram. Each call makes a new link.
- Reports. Anyone who has a link can report the diagram, and Zindex revokes a link whose diagram breaks the content policy.
A version link to version 2, for an auditor, until a date:
curl -s -X POST https://api.zindex.ai/v1/diagrams/payments-architecture/links \
-H "Authorization: Bearer $ZINDEX_API_KEY" \
-H "Content-Type: application/json" \
-d '{"revision": 2, "name": "Halden Assurance", "ends": "2027-02-25"}'
{"id":"dgm_7Q2kD9a1B2c3","linkId":"lnk_8sV2nQx7LpWe","url":"https://zindex.ai/d/4tYhB8mKqZ3wRc6NpDs2Jf","svg":"https://zindex.ai/d/4tYhB8mKqZ3wRc6NpDs2Jf.svg","png":"https://zindex.ai/d/4tYhB8mKqZ3wRc6NpDs2Jf.png","shows":"version","revision":2,"name":"Halden Assurance","ends":"2027-02-25","fingerprint":"sha256:9b1c…","createdAt":"2026-11-27T09:31:00.000Z","state":"live"}
fingerprint is the version’s content hash, which its picture prints the start of (Verifying a shared picture). The link’s url, svg and png show version 2 alone and take no @{revision}. Anyone with the link can read what its page shows:
curl -s https://api.zindex.ai/v1/public/diagrams/4tYhB8mKqZ3wRc6NpDs2Jf
{"access":"link","shows":"version","name":"Halden Assurance","at":"2026-10-08T09:14:00.000Z","sharedAt":"2026-11-27T09:31:00.000Z","ends":"2027-02-25T23:59:59.000Z","fingerprint":"sha256:9b1c…","width":717,"height":323}
It names no diagram, version number or other version, and gives ends as the moment the link stops. A latest link’s answer has the same fields, for the newest version.
An every-version link, with no end date:
curl -s -X POST https://api.zindex.ai/v1/diagrams/payments-architecture/links \
-H "Authorization: Bearer $ZINDEX_API_KEY" \
-H "Content-Type: application/json" \
-d '{"shows": "every", "ends": null}'
{"id":"dgm_7Q2kD9a1B2c3","linkId":"lnk_4kP9wXr2TmQa","url":"https://zindex.ai/d/9xWqTk4PmZr7Hb2NcVd8Ls","svg":"https://zindex.ai/d/9xWqTk4PmZr7Hb2NcVd8Ls.svg","png":"https://zindex.ai/d/9xWqTk4PmZr7Hb2NcVd8Ls.png","shows":"every","revision":null,"name":null,"ends":null,"fingerprint":null,"createdAt":"2026-10-08T09:31:00.000Z","state":"live"}
The link follows the latest version; add @2 for version 2. Its svg and png do the same, and so does its link preview in Slack, Teams or iMessage, though an app may keep a preview it already made. The page’s Download saves the version it shows. Anyone with the link can read what its page shows, every version’s number and date included:
curl -s https://api.zindex.ai/v1/public/diagrams/9xWqTk4PmZr7Hb2NcVd8Ls
{"id":"dgm_7Q2kD9a1B2c3","access":"link","revision":2,"latest":2,"at":"2026-10-08T09:14:00.000Z","shows":"every","name":null,"ends":null,"width":717,"height":323,"versions":[{"revision":2,"at":"2026-10-08T09:14:00.000Z"},{"revision":1,"at":"2026-10-08T09:12:00.000Z"}]}
GET /v1/diagrams/{id}/links lists the diagram’s live links, newest first, each with who made it. With ?state=ended it lists the links that ended or were revoked, which stay as the record of what was shared, and ?state=all lists both. DELETE /v1/diagrams/{id}/links/{linkId} revokes one:
curl -s -X DELETE https://api.zindex.ai/v1/diagrams/payments-architecture/links/lnk_4kP9wXr2TmQa \
-H "Authorization: Bearer $ZINDEX_API_KEY"
{"id":"dgm_7Q2kD9a1B2c3","linkId":"lnk_4kP9wXr2TmQa","revoked":true}
From then on the link opens nothing, the same as a link that ended:
curl -s https://api.zindex.ai/v1/public/diagrams/9xWqTk4PmZr7Hb2NcVd8Ls
{"error":"No public diagram or share link with that ID.","code":"NOT_FOUND"}
Published diagrams
PUT /v1/diagrams/{id}/sharing with { "visibility": "public" } publishes a diagram: anyone can then open its links by ID, its page also shows its title and description, and GET /v1/public/diagrams/{id} returns its scene JSON.
curl -s -X PUT https://api.zindex.ai/v1/diagrams/payments-architecture/sharing \
-H "Authorization: Bearer $ZINDEX_API_KEY" -H "Content-Type: application/json" \
-d '{ "visibility": "public" }'
{"id":"dgm_7Q2kD9a1B2c3","visibility":"public","url":"https://zindex.ai/d/dgm_7Q2kD9a1B2c3","madePublicAt":"2026-10-08T09:32:00.000Z"}
curl -s -o payments-v1.svg https://api.zindex.ai/v1/public/diagrams/dgm_7Q2kD9a1B2c3@1.svg
GET /v1/public/diagrams/{id} returns { id, access, title, description, revision, latest, at, width, height, madePublicAt, versions, scene, svg }: the version’s scene, its kept image and the image’s size. { "visibility": "private" } takes the diagram’s links by ID down again; its share links keep working until they end or are revoked.
What changed, through a link
Add ?from={revision} to a version’s image to draw it with what changed since that version colored, as the page does (Rendering: Visual diff); https://zindex.ai/d/{ref}@2.svg?from=1 is the same picture. GET /v1/public/diagrams/{ref}@{revision}/changes?from={revision} counts it. Neither needs a key:
curl -s -o payments-v2-changes.svg "https://api.zindex.ai/v1/public/diagrams/dgm_7Q2kD9a1B2c3@2.svg?from=1"
curl -s "https://api.zindex.ai/v1/public/diagrams/dgm_7Q2kD9a1B2c3@2/changes?from=1"
{"from":1,"to":2,"added":1,"changed":0,"removed":0,"moved":0}
Scope:
- This works through a published diagram’s ID or an every-version link. A version link or latest link answers
404. frommust be another version the link shows, and the version must be an exact one (@2); anything else is a400.- The answer is counts only, never which elements or fields changed or who changed them. An every-version link’s colored image can mark an element as changed when the only change is to something the image doesn’t show. For the details, read the diagram with a key:
GET /v1/diagrams/{id}/compare, ordiagram_historywithcompare. - Zindex draws the colored image on each request and doesn’t keep it, within the 5-second budget for drawings without a key (Drawing time). Each request counts toward the no-key rate limit, so a
429says how long to wait. The plain image is the kept one.
Caching and taking links down
Each answer’s Cache-Control says how long a browser or another cache may keep it:
| Answer | Cache-Control |
|---|---|
| An exact version’s image, which never changes | public, max-age=31536000, immutable |
| An image that follows the latest version, and a published diagram’s page answer | public, max-age=60 |
| What changed between two versions, colored or counted | public, max-age=3600 |
| A version link’s or latest link’s picture | private, no-cache |
| A share link’s page answer | no-store |
An exact version’s image has its version’s chain hash as its ETag, or its content hash while chain is null. Send If-None-Match, and an unchanged image answers 304. The colored image’s ETag names both versions and the engine that drew it, since a newer engine draws it again. A version link’s or latest link’s picture has an ETag of its own, and the browser asks again each time it shows it, so a revoked or ended link’s picture is gone on the next look.
An every-version link’s other answers are private rather than public: the visitor’s own browser may keep them, but no proxy, image proxy or chat preview may, so a revoked link stops for new viewers. Zindex’s own edge keeps none of a share link’s answers.
- Making a diagram private stops its links by ID at once. Revoking a share link, or the end of its last day, stops that link. Deleting the diagram stops both until it is restored; restoring it within 24 hours brings them back.
- Zindex’s own edge may keep a published diagram’s answers as long as a browser may, up to an hour, and is purged of them at that moment. If a purge fails, it lets them go within the hour.
- Copies people already fetched stay with them, as with any image once shared. A browser may keep each answer as long as its
Cache-Controlabove allows, and for a published diagram, so may another cache. - A private, deleted or unknown diagram and a revoked, ended or unknown link all answer the same
404, anddiagram_renderthe sameNOT_FOUND, so the answer doesn’t reveal which exist. The website’s page reveals no more: it says the same for every such diagram ID, and the same for every such link. For a diagram’s ID it also offers to open the diagram in Zindex at the version the link names,/dashboard/diagram?id={id}&revision={revision}, where the people in its workspace see it once signed in. - Every saved version’s image prints this address,
zindex.ai/d/{id}@{revision}, in its bottom-right corner, and so does every image an every-version link serves (The image’s address). A version link’s or latest link’s picture prints no ID.
Reporting a diagram
Anyone, signed in or not, can report a diagram they can see that breaks the hosted-content policy with POST /v1/public/diagrams/{ref}/report and { "reason": "spam", "description": "...", "reporterEmail": "..." }. {ref} is the page’s own: a published diagram’s ID or an every-version link’s token, with @{revision} for the version seen (without it, the latest), or a version link’s or latest link’s token alone. The page at zindex.ai/d/{ref} sends its ref with the version it shows. reason is spam, hate, violence, abuse, illegal, copyright or other; description is 50 to 2,000 characters; the email is optional and never shown to the diagram’s owner.
A report is kept only when GET /v1/public/diagrams/{ref} would show that version, so one through a private diagram’s ID, a revoked, ended or unknown link, or a deleted diagram is dropped. The answer is the same 200 either way, so it doesn’t reveal which IDs or tokens exist. A report through a share link records the link’s ID, never its token. Moderators see what the ref shows: a published diagram’s page, or, while a report through it is open, what the share link has shown, never the scene.
What happens when a diagram breaks the policy:
- A published diagram is made private, every share link to it is revoked, and its owner is emailed the reason. This applies to a report through a share link too, while the diagram is published.
- A diagram shared only with links keeps every link but the reported one, which is revoked. Nothing else about the diagram changes. The person who made the link is emailed the reason; if they are no longer in the diagram’s workspace, its owners are.
A revoked link can’t be restored; the owner can make a new one.
Report a problem
When a version draws wrong, send it to Zindex support. A report is its own record of one version, with a one-line problem; the diagram stays as private or public as it was.
POST /v1/diagrams/{id}/reports/previewwith{ "revision": 2, "anonymize": true }(both optional; the default is the latest version, anonymized) returns{ id, revision, anonymized, svg }, plus aseedwhen anonymized: the version drawn as support will see it. Nothing is stored.POST /v1/diagrams/{id}/reportswith{ "problem": "The label sits on the edge", "revision": 2, "anonymize": true, "seed": 123 }returns201with{ reportId, id, revision, reported: true, anonymized }. Pass the preview’sseedand support sees exactly the copy you previewed; without it, a new random substitution is made.problemis one line of up to 500 characters.GET /v1/diagrams/{id}/reports/{reportId}returns{ id, reportId, revision, anonymized, svg }: what support sees, at any time after sending.DELETEon the same path withdraws the report.
An anonymized report keeps that anonymized copy, and staff see only it. With anonymize: false, staff see the version as it is. Deleting the diagram hides its reports from staff at once; they are removed with the diagram 24 hours later.
Feedback
Tell Zindex staff about a bug, a place where the docs and the engine disagree, or something you needed that is missing. Feedback needs an account but no saved diagram. Staff read every item; no model does. An item has:
kind:bug,docs(the docs and the engine disagree),requestorothersummary: one line, up to 200 charactersexpectedandobserved: optional, up to 2,000 characters eachconfidence: optional,seen,likelyorunsure- optionally,
id(withrevision; default the latest) to attach a version of one of the workspace’s diagrams (not with a read key or as a viewer), orsnippet: a scene document or Mermaid text of up to 64 KB. Either is anonymized unlessanonymizeisfalse, as in a problem report.
The person confirms each item before it is sent. The first request stores nothing: it answers 400 with code: "CONFIRMATION_REQUIRED", a confirm token and preview, the item exactly as staff will see it, with the engine version and client Zindex adds.
curl -s -X POST https://api.zindex.ai/v1/feedback \
-H "Authorization: Bearer $ZINDEX_API_KEY" -H "Content-Type: application/json" \
-d '{ "kind": "docs", "summary": "The guide says an edge may end on a frame", "expected": "The edge draws to the frame", "observed": "EDGE_ENDPOINT_KIND_INVALID", "confidence": "seen" }'
{"error":"Nothing was sent. Show the person the preview, and only if they agree, send the same body again with confirm set to the token; it expires in 10 minutes.","code":"CONFIRMATION_REQUIRED","confirm":"1791541440.Qm8rT2vXk9LpZ4nWc7HbYd","preview":{"kind":"docs","summary":"The guide says an edge may end on a frame","expected":"The edge draws to the frame","observed":"EDGE_ENDPOINT_KIND_INVALID","confidence":"seen","engine":"6.0.0+build.1690","client":"curl/8.7.1","diagram":null,"anonymized":null,"snippet":null}}
Show the person the preview. Only if they agree, send the same body again with confirm. The token works for 10 minutes, for that account and that item only:
curl -s -X POST https://api.zindex.ai/v1/feedback \
-H "Authorization: Bearer $ZINDEX_API_KEY" -H "Content-Type: application/json" \
-d '{ "kind": "docs", "summary": "The guide says an edge may end on a frame", "expected": "The edge draws to the frame", "observed": "EDGE_ENDPOINT_KIND_INVALID", "confidence": "seen", "confirm": "1791541440.Qm8rT2vXk9LpZ4nWc7HbYd" }'
{"feedbackId":"fb_6tJ3wNq8KxPa","sent":true,"status":"new"}
GET /v1/feedback lists your items newest first (limit up to 50, default 20, and cursor from nextCursor), each with what staff see and its status: new, accepted, fixed, wont-fix or duplicate. note is from Zindex staff, and a fixed item’s fixedIn names the version that fixed it. Dashboard → Usage shows the same list under Your feedback.
curl -s https://api.zindex.ai/v1/feedback \
-H "Authorization: Bearer $ZINDEX_API_KEY"
{"feedback":[{"feedbackId":"fb_6tJ3wNq8KxPa","kind":"docs","summary":"The guide says an edge may end on a frame","expected":"The edge draws to the frame","observed":"EDGE_ENDPOINT_KIND_INVALID","confidence":"seen","engine":"6.0.0+build.1690","client":"curl/8.7.1","diagram":null,"anonymized":null,"snippet":null,"status":"new","note":null,"fixedIn":null,"sentAt":"2026-10-09T10:15:00.000Z","updatedAt":null}]}
An account can send 20 items in any 24 hours; past that, the answer is 429 with code: "RATE_LIMITED" and retryAfter, the seconds until the next can go. Deleting a diagram hides the feedback that carries it from staff at once, and removes it with the diagram 24 hours later; closing the account removes all of it. Over MCP, diagram_share with action: "feedback" takes the same fields and needs the person’s agreement (MCP tools: Confirmation).
History and compare
GET /v1/diagrams/{id}/revisions lists versions newest first, with the time, who saved each one (by, their name, else their email) and how (credential: session, api_key or oauth, never which key), the client, its message, its chain hash and how many elements it added, changed, removed and moved. GET /v1/diagrams/{id}/compare?from=2026-09-01&to=2026-10-01 returns the element IDs added, changed, removed and moved between two versions, and authors, each distinct { by, client } that saved a version between them.
Export
GET /v1/diagrams/{id}/export downloads one diagram’s whole history as JSON Lines. The first line is a header with the diagram’s id, key, title and revisions. One line per version follows, oldest first, with its scene, its hash and chain, and its stored image. That is all you need to check the history yourself (Verifying).
GET /v1/workspace/export downloads every diagram in the workspace the key acts in, in one file, in the format zindex-account-history/1; GET /v1/account/export is the same download. Settings → Account on zindex.ai downloads the same file for the selected workspace. In a team workspace only its owners can download it, with the dashboard or their own keys; anyone else gets 403 with code: "OWNER_REQUIRED", and can still download each diagram’s history. Its first line names the format and the workspace (kind is personal or team). Each diagram follows in ID order, written as its own export is, but its header also has project, the diagram’s project name, when it has one. The last line counts the diagrams:
{"format":"zindex-account-history/1","workspace":{"id":"0b7e4c1a-…","name":"Personal workspace (ana@acme.com)","kind":"personal"},"exportedAt":"2026-10-13T09:00:00.000Z"}
{"format":"zindex-history/1","chain":"zindex-chain/1","id":"dgm_7Q2kD9a1B2c3","key":"payments-architecture","title":"Payments","revisions":2,"exportedAt":"2026-10-13T09:00:00.004Z"}
{"revision":1,"at":"2026-10-05T09:12:00.000Z","by":"Ana Lima","actor":{"userId":"…","credential":"api_key","credentialId":"…"},"client":"curl/8.7.1","message":null,"hash":"sha256:3f9a…","chain":"sha256:fdac…","scene":{…},"image":{…}}
{"revision":2,…}
{"format":"zindex-history/1","chain":"zindex-chain/1","id":"dgm_Hq3vT8bWm2Xa","key":null,"title":"Orders","revisions":1,"exportedAt":"2026-10-13T09:00:00.019Z"}
{"revision":1,…}
{"end":true,"diagrams":2}
A line with "format": "zindex-history/1" starts the next diagram. A file without the closing line was cut short; download it again. Deleted diagrams are left out, even while they can be restored, and so are share links, problem reports and feedback. Both exports are sent a line at a time as Zindex writes them, so a large workspace starts downloading at once.
Errors
Errors are JSON with error, a short message, and a code.
Every response, an error or not, carries an X-Request-Id header: Zindex’s own ID for that request, never one you send. Quote it to support@zindex.ai when something looks wrong. It isn’t the requestId you choose for an edit.
| Code | Status | Means |
|---|---|---|
INVALID_REQUEST | 400 | A parameter is wrong; error says which |
CONFIRMATION_REQUIRED | 400 | A delete without ?confirm=true, or feedback without its confirm token; nothing was deleted or sent |
INVALID_PROJECT_NAME | 400 | project isn’t an allowed name: use 1 to 40 characters, not none or all, or leave it out. On the list, none means diagrams in no project and all is refused: leave project out to list every diagram |
AUTH_REQUIRED | 401 | No API key was sent |
API_KEY_INVALID, API_KEY_REVOKED, API_KEY_EXPIRED | 401 | The key sent is unknown, was revoked or has expired; use another key |
LIMIT_REACHED | 403 | The workspace is at a plan limit (Limits) |
PROJECT_LIMIT | 403 | The workspace can’t hold another project, and nothing was saved. Send the create again under an existing project or without project. nearest, when present, names up to 5 projects that read like the name sent |
PLAN_LIMIT_EXCEEDED | 403 | A new API key would pass the workspace’s apiKeys limit, or a viewer’s 3 keys; current and maximumAllowed give the numbers. Revoke a key first |
FEATURE_UNAVAILABLE | 403 | The workspace’s plan doesn’t include the feature (feature): a latest or every-version share link, or one that ends more than 7 days out or never, needs Pro or Team. Make a version link that ends within 7 days instead, or tell the person; don’t retry (Paid-plan features) |
EMAIL_NOT_VERIFIED | 403 | Verify the account’s email before saving or creating a key |
READ_ONLY | 403 | A read key, or a viewer in the workspace, can read diagrams but not change or share them or report a problem with them; reason is credential or role. Don’t retry the change |
SHARING_DISABLED | 403 | The workspace’s owners turned public sharing off: no publishing and no new share links. Don’t retry; tell the person an owner can turn sharing back on |
OWNER_REQUIRED | 403 | Only an owner of the team workspace can export all of it |
SESSION_REQUIRED | 403 | Managing a workspace, moving a diagram into a team workspace and billing work only from the signed-in dashboard, not with a key |
LINK_INVALID | 403 | A signed image link is invalid or has expired; render the diagram again for a new link |
NOT_FOUND | 404 | No such diagram or version in this workspace; another workspace’s diagram answers the same way. Also a path with no endpoint |
NO_REVISION_AS_OF | 404 | The diagram had no version yet at that date |
KEY_EXISTS | 409 | The key belongs to another diagram in the workspace, with different content or a teammate’s; id names it |
REVISION_CONFLICT | 409 | The diagram changed since baseRevision; see revision and changes |
STORAGE_HOLD | 409 | The connection to the workspace’s own GitHub repository needs a workspace owner; reason says what for and detail names the cause. Don’t retry; tell the person a workspace owner must act in Settings → Storage |
MOVED | 410 | A /v1/scenes path; method and path name the request to send instead |
INPUT_TOO_LARGE | 413 | The request body is over 4 MiB, or the Mermaid text or a feedback snippet is over 64 KB |
VALIDATION_FAILED | 422 | Nothing was saved; errors lists each problem with a code, the element when there is one, and a one-line fix (Validation rules) |
REQUEST_ID_REUSED | 422 | The requestId already made a different revision |
PARSE_ERROR | 422 | Mermaid couldn’t read the text; error says where or what, and line and column are there when Mermaid names them (Mermaid: Refused) |
UNSUPPORTED_DIAGRAM_TYPE | 422 | The Mermaid isn’t an erDiagram, a flowchart or a sequenceDiagram; send the diagram as a scene |
IMPORT_TIMEOUT, IMPORT_FAILED | 422 | The Mermaid parser took too long or stopped; send shorter text, or a scene |
MERMAID_FAMILY_MISMATCH | 422 | A Mermaid edit doesn’t fit the diagram’s family |
DRAW_TIMEOUT | 422 | Drawing the scene took longer than the drawing budget (5 s without a key or sign-in, 20 s with one and for every save, edit and render), or needed more memory than it allows. A save or edit saved nothing. The error says what to change: split the diagram, draw fewer edges into one node, or bring the elements closer together |
RATE_LIMITED | 429 | Over a rate limit, or 20 feedback items in 24 hours; retryAfter gives the seconds to wait |
INTERNAL_ERROR | 500 | Zindex failed while answering; error doesn’t say how. Retry, sending an edit’s requestId again. If it keeps failing, quote the X-Request-Id that error names to support |
UNSUPPORTED | 501 | The server doesn’t offer that feature; api.zindex.ai offers every one |
BUSY | 503 | Every drawing worker is busy; retryAfter and Retry-After give the seconds to wait, half the refused drawing’s budget |
UNAVAILABLE | 503 | Reporting a diagram is unavailable right now; try again later |
STORAGE_UNAVAILABLE | 503 | The workspace’s own GitHub repository didn’t answer; retryAfter and Retry-After give the seconds to wait, and detail names the cause. Retry after that |
STORAGE_UNAVAILABLE and STORAGE_HOLD come only from a workspace that keeps its diagrams in its own GitHub repository (Bring your own storage); Zindex’s own storage, the default, never returns them. STORAGE_HOLD’s reason is installation_missing, installation_suspended, repository_missing, repository_public (the repository was made public; the hold lifts once it is private or internal), branch_missing, push_refused, credentials, external_change (a change made in the repository outside Zindex) or disconnected (an owner disconnected the workspace’s storage). On such a workspace a save takes a few seconds and a read under a second, and a connected repository takes about 80 saves a minute and 500 an hour, GitHub’s limits for the App; past them Zindex answers STORAGE_UNAVAILABLE with retryAfter, never a plan-limit error.