# Exports

> Export a tenant or one account as an archive, then download or delete it.

URL: https://docs.workwae.com/reference/exports

Guides: [Exports](/guides/exports).

| Method | Path | Operation | Scope |
| --- | --- | --- | --- |
| `GET` | `/v1/exports` | [List exports, newest first](#list-exports-newest-first) | `admin` |
| `POST` | `/v1/exports` | [Export the tenant or one account](#export-the-tenant-or-one-account) | `admin` |
| `GET` | `/v1/exports/{exportId}` | [Get an export](#get-an-export) | `admin` |
| `DELETE` | `/v1/exports/{exportId}` | [Delete an export and its file](#delete-an-export-and-its-file) | `admin` |
| `GET` | `/v1/exports/{exportId}/download` | [Download an export (application/gzip)](#download-an-export-applicationgzip) | `admin` |

## List exports, newest first

`GET /v1/exports`

TypeScript SDK method: `workwae.exports.list()`

Requires the admin scope.

Required scope: `admin`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `limit` | query | integer | no | 1 to 200. Default `50`. |
| `cursor` | query | string | no | 1 to 512 characters. Example `"eyJ0eG5pZCI6IjQyIiwiaWQiOjEwMDF9"`. |

### Responses

- **200** OK (application/json, object)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `items` | object[] | yes |  |
| `items[].id` | string (uuid) | yes | Example `"c4e6a8b0-1d3f-4a5c-8e7b-9d1f3a5c7e9b"`. |
| `items[].accountId` | string (uuid) \| null | yes | Example `"6f1c2a4e-8b3d-4e5f-9a7b-1c2d3e4f5a6b"`. |
| `items[].accountEmail` | string \| null | yes |  |
| `items[].status` | "queued" \| "running" \| "completed" \| "failed" \| "expired" | yes |  |
| `items[].bytes` | integer | yes |  |
| `items[].sha256` | string \| null | yes |  |
| `items[].contents` | object | yes |  |
| `items[].error` | string \| null | yes |  |
| `items[].createdAt` | string (date-time) | yes | Example `"2026-05-04T09:30:00.000Z"`. |
| `items[].startedAt` | string (date-time) \| null | yes | Example `"2026-05-04T09:30:00.000Z"`. |
| `items[].completedAt` | string (date-time) \| null | yes | Example `"2026-05-04T09:30:00.000Z"`. |
| `items[].expiresAt` | string (date-time) \| null | yes | Example `"2026-05-04T09:30:00.000Z"`. |
| `nextCursor` | string \| null | yes | Example `"eyJ0eG5pZCI6IjQyIiwiaWQiOjEwMDF9"`. |

- **Errors**, by status and `code` (see [Errors](/guides/errors)):
  - 400: `invalid_input`, `invalid_idempotency_key`, `invalid_cursor`
  - 401: `unauthenticated`, `api_key_expired`
  - 403: `missing_scope`, `role_forbidden`, `account_token_forbidden`, `account_scope_forbidden`, `mcp_only_key`
  - 409: `idempotency_key_in_progress`
  - 413: `payload_too_large`
  - 422: `idempotency_key_reused`
  - 429: `rate_limited`, `too_many_requests`
  - 500: `internal_error`
  - 503: `overloaded`

## Export the tenant or one account

`POST /v1/exports`

TypeScript SDK method: `workwae.exports.create()`

Builds a gzip-compressed tar in the background: accounts without secrets, mailboxes, message metadata (JSON lines), stored message bodies as .eml, calendars and events as JSON and .ics, and for a tenant export its webhooks (without signing secrets), templates and settings. Follow it with GET /v1/exports/{exportId}, or the export.completed and export.failed events. Requires the admin scope.

Required scope: `admin`.

### Request body (required)

Content type `application/json`.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `accountId` | string (uuid) | no | Example `"6f1c2a4e-8b3d-4e5f-9a7b-1c2d3e4f5a6b"`. |

### Responses

- **202** OK (application/json, object)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string (uuid) | yes | Example `"c4e6a8b0-1d3f-4a5c-8e7b-9d1f3a5c7e9b"`. |
| `accountId` | string (uuid) \| null | yes | Example `"6f1c2a4e-8b3d-4e5f-9a7b-1c2d3e4f5a6b"`. |
| `accountEmail` | string \| null | yes |  |
| `status` | "queued" \| "running" \| "completed" \| "failed" \| "expired" | yes |  |
| `bytes` | integer | yes |  |
| `sha256` | string \| null | yes |  |
| `contents` | object | yes |  |
| `error` | string \| null | yes |  |
| `createdAt` | string (date-time) | yes | Example `"2026-05-04T09:30:00.000Z"`. |
| `startedAt` | string (date-time) \| null | yes | Example `"2026-05-04T09:30:00.000Z"`. |
| `completedAt` | string (date-time) \| null | yes | Example `"2026-05-04T09:30:00.000Z"`. |
| `expiresAt` | string (date-time) \| null | yes | Example `"2026-05-04T09:30:00.000Z"`. |

- **Errors**, by status and `code` (see [Errors](/guides/errors)):
  - 400: `invalid_input`, `invalid_idempotency_key`, `storage_unavailable`
  - 401: `unauthenticated`, `api_key_expired`
  - 403: `missing_scope`, `role_forbidden`, `account_token_forbidden`, `account_scope_forbidden`, `mcp_only_key`
  - 409: `idempotency_key_in_progress`, `export_in_progress`
  - 413: `payload_too_large`
  - 422: `idempotency_key_reused`, `unknown_account`
  - 429: `rate_limited`, `too_many_requests`
  - 500: `internal_error`
  - 503: `overloaded`

## Get an export

`GET /v1/exports/{exportId}`

TypeScript SDK method: `workwae.exports.get()`

Requires the admin scope.

Required scope: `admin`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `exportId` | path | string (uuid) | yes | Example `"56677aa9-5bc6-4869-a067-424b6e1df1a0"`. |

### Responses

- **200** OK (application/json, object)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string (uuid) | yes | Example `"c4e6a8b0-1d3f-4a5c-8e7b-9d1f3a5c7e9b"`. |
| `accountId` | string (uuid) \| null | yes | Example `"6f1c2a4e-8b3d-4e5f-9a7b-1c2d3e4f5a6b"`. |
| `accountEmail` | string \| null | yes |  |
| `status` | "queued" \| "running" \| "completed" \| "failed" \| "expired" | yes |  |
| `bytes` | integer | yes |  |
| `sha256` | string \| null | yes |  |
| `contents` | object | yes |  |
| `error` | string \| null | yes |  |
| `createdAt` | string (date-time) | yes | Example `"2026-05-04T09:30:00.000Z"`. |
| `startedAt` | string (date-time) \| null | yes | Example `"2026-05-04T09:30:00.000Z"`. |
| `completedAt` | string (date-time) \| null | yes | Example `"2026-05-04T09:30:00.000Z"`. |
| `expiresAt` | string (date-time) \| null | yes | Example `"2026-05-04T09:30:00.000Z"`. |

- **Errors**, by status and `code` (see [Errors](/guides/errors)):
  - 400: `invalid_input`, `invalid_idempotency_key`
  - 401: `unauthenticated`, `api_key_expired`
  - 403: `missing_scope`, `role_forbidden`, `account_token_forbidden`, `account_scope_forbidden`, `mcp_only_key`
  - 404: `export_not_found`
  - 409: `idempotency_key_in_progress`
  - 413: `payload_too_large`
  - 422: `idempotency_key_reused`
  - 429: `rate_limited`, `too_many_requests`
  - 500: `internal_error`
  - 503: `overloaded`

## Delete an export and its file

`DELETE /v1/exports/{exportId}`

TypeScript SDK method: `workwae.exports.delete()`

Requires the admin scope.

Required scope: `admin`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `exportId` | path | string (uuid) | yes | Example `"56677aa9-5bc6-4869-a067-424b6e1df1a0"`. |

### Responses

- **204** OK (application/json, any)
- **Errors**, by status and `code` (see [Errors](/guides/errors)):
  - 400: `invalid_input`, `invalid_idempotency_key`
  - 401: `unauthenticated`, `api_key_expired`
  - 403: `missing_scope`, `role_forbidden`, `account_token_forbidden`, `account_scope_forbidden`, `mcp_only_key`
  - 404: `export_not_found`
  - 409: `idempotency_key_in_progress`, `export_running`
  - 413: `payload_too_large`
  - 422: `idempotency_key_reused`
  - 429: `rate_limited`, `too_many_requests`
  - 500: `internal_error`
  - 503: `overloaded`

## Download an export (application/gzip)

`GET /v1/exports/{exportId}/download`

TypeScript SDK method: `workwae.exports.download()`

Streams the decrypted .tar.gz; compare it with the export's sha256. Requires the admin scope.

Required scope: `admin`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `exportId` | path | string (uuid) | yes | Example `"56677aa9-5bc6-4869-a067-424b6e1df1a0"`. |

### Responses

- **200** The export as a gzip-compressed tar (application/gzip, string)
- **Errors**, by status and `code` (see [Errors](/guides/errors)):
  - 400: `invalid_input`, `invalid_idempotency_key`, `storage_unavailable`
  - 401: `unauthenticated`, `api_key_expired`
  - 403: `missing_scope`, `role_forbidden`, `account_token_forbidden`, `account_scope_forbidden`, `mcp_only_key`
  - 404: `export_not_found`
  - 409: `idempotency_key_in_progress`, `export_not_ready`, `export_failed`
  - 410: `export_expired`
  - 413: `payload_too_large`
  - 422: `idempotency_key_reused`
  - 429: `rate_limited`, `too_many_requests`
  - 500: `internal_error`, `export_corrupt`
  - 503: `overloaded`
