---
title: "Download the whole history"
method: GET
path: "/v1/diagrams/{id}/export"
tags: ["Diagrams"]
---

# Download the whole history

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

## Request

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

Every version in one file, as JSON Lines: a header line ({ format: "zindex-history/1", chain: "zindex-chain/1", id, key, title, revisions, note?, exportedAt }), then one line per version, oldest first: { revision, at, by, actor, client, message, hash, chain, scene, image }, where by is as in the history, actor is { userId, credential, credentialId } (credentialId is the key's or connected app's ID, null for a session), and image is the version's stored picture: { hash, engine, renderedAt, backfilled, svg }, left out when the server stores no images. hash is the SHA-256 of scene's RFC 8785 form, image.hash of svg's UTF-8 bytes, and chain links each version to the one before, so the file can be checked without Zindex: https://zindex.ai/docs/concepts/#verifying. Sent as a download (Content-Disposition: attachment).

## Path parameters

- `id` string, required

## Response `200`

The history as JSON Lines

## Other responses

- `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
- `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)
