---
title: "Download every diagram in the workspace with its whole history"
method: GET
path: "/v1/workspace/export"
tags: ["Account"]
---

# Download every diagram in the workspace with its whole history

`GET /v1/workspace/export`

## Request

- Base URL: `https://api.zindex.ai`
- URL: `https://api.zindex.ai/v1/workspace/export`
- Auth: one of:
  - HTTP bearer
  - API key in header `X-API-Key`
  - API key in cookie `zindex_session`

Every diagram in the workspace the request acts in, with its whole history, in one JSON Lines file in the zindex-account-history/1 format. The first line is { format: "zindex-account-history/1", workspace: { id, name, kind }, exportedAt }, where kind is personal or team. Each diagram follows in ID order, exactly as GET /v1/diagrams/{id}/export writes it: a header line ({ format: "zindex-history/1", chain, id, key, title, revisions, note?, exportedAt }), then one line per version, oldest first. A line whose format is "zindex-history/1" starts the next diagram. The last line is { end: true, diagrams }, the number of diagrams in the file; a file without it was cut short. Deleted diagrams are left out, even while they can be restored. Each diagram's lines check on their own, like a diagram's export: https://zindex.ai/docs/concepts/#checking-an-export. A read key works too. In a team workspace only an owner can download it (403 OWNER_REQUIRED); everyone in it can still download one diagram's history at GET /v1/diagrams/{id}/export. The file is sent as a download (Content-Disposition: attachment), a line at a time as Zindex writes it.

## Response `200`

The workspace's diagrams 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).
- `403`: OWNER_REQUIRED: a team workspace's export is for its owners
- `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)
