---
title: "Diagram history"
method: GET
path: "/v1/diagrams/{id}/revisions"
tags: ["Diagrams"]
---

# Diagram history

`GET /v1/diagrams/{id}/revisions`

## Request

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

Versions newest first, with time, who saved each (by, credential), client, message and how many elements each added, changed and removed. asOf lists the history as it stood at that instant.

## Path parameters

- `id` string, required

## Query parameters

- `limit` integer
- `cursor` string
- `asOf` string

## Response `200`

{ id, currentRevision, versions: [{ revision, at, by, credential, client, message, chain, added?, changed?, removed? }], nextCursor?, note? }. chain is the version's chain hash, as in DiagramWrite. The counts appear when the version before is kept; note names versions an earlier retention limit deleted and the version the chain starts at.

- object
  - `id` string, required
  - `currentRevision` integer, required
  - `versions` object[], required
    - `revision` integer, required
    - `at` string, date-time, nullable, required
    - `by` string, nullable, required: Who saved it: the person's name, else their email; "former member" once their account is closed; null when unknown
    - `credential` 'session' | 'api_key' | 'oauth' | 'null', nullable, required: How they saved it: the dashboard's session, an API key or a connected app, never which one; null when unknown
    - `client` string, nullable, required
    - `message` string, nullable, required
    - `chain` string, nullable, required: The version's chain hash, as in DiagramWrite
    - `added` integer
    - `changed` integer
    - `removed` integer
  - `nextCursor` string
  - `note` string

## Other responses

- `400`: INVALID_REQUEST: limit isn't a whole number, or asOf isn't a date or timestamp
- `401`: Missing or invalid API key. Response includes a `code` field that distinguishes the failure mode so clients (dashboard, MCP server) can render actionable copy: `AUTH_REQUIRED` (no key or session was sent), `API_KEY_INVALID` (key not found), `API_KEY_REVOKED` (key was revoked, or its person is no longer in its workspace), `API_KEY_EXPIRED` (key passed its expires_at), and for the site's session cookie `SESSION_EXPIRED` (past its 24 hours), `SESSION_REVOKED` (the account's sessions were ended, for example by a password reset) and `SESSION_INVALID` (not a session this server signed).
- `404`: NOT_FOUND or NO_REVISION_AS_OF
- `429`: RATE_LIMITED: over the request rate limit (see Rate Limiting). Wait retryAfter seconds (also the Retry-After header), then try again.

---

[API](https://skmtc.dev/zindex/apis/zindex-api.md) · [All operations](https://skmtc.dev/zindex/apis/zindex-api/llms.txt) · [OpenAPI document](https://skmtc.dev/zindex/apis/zindex-api/revisions/1d21bd5bbf8e?raw)
