> ## Documentation Index
> Fetch the complete documentation index at: https://docs.anyformat.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Download

> Get a presigned URL for a workflow's whole knowledge corpus, as a tar

*Rate limit tier: **general**, 600 requests/min. See [Rate limits](/api-reference-v3/introduction#rate-limits).*

Returns a presigned URL for a workflow's whole knowledge corpus, packaged as a tar. Prefer [List](/api-reference-v3/knowledge/list) and [Read](/api-reference-v3/knowledge/read) for anything that stays inside this API — this endpoint exists for handing the whole archive to something outside it.

**Possession of the URL is read permission for the workflow's corpus until it expires.** The URL is not scoped to your API key: whoever holds it can fetch the tar, and revoking the key that requested it does not revoke a URL already minted. `expires_in_seconds` (900, 15 minutes) is the only bound.

The URL can 404 if a newer snapshot replaced it or the workflow was deleted meanwhile — mint a fresh one rather than caching it past its TTL.

## Requires a knowledge base

Same requirement as `ask`: the workflow needs a **knowledge node**, or this returns `409 KNOWLEDGE_NOT_ENABLED`. `409 KNOWLEDGE_NOT_READY` means no usable snapshot has ever been published. Unlike `ask`, downloading is never billed, so `402` cannot occur here.

## Errors

| Status | `error_code`            | Meaning                                                                                           |
| ------ | ----------------------- | ------------------------------------------------------------------------------------------------- |
| `404`  | `NOT_FOUND`             | Unknown workflow, or one belonging to another organization.                                       |
| `409`  | `KNOWLEDGE_NOT_ENABLED` | The workflow has no Knowledge node. Do not retry: add the node first.                             |
| `409`  | `KNOWLEDGE_NOT_READY`   | No knowledge snapshot has ever been published for this workflow. Wait if indexing is in progress. |

<RequestExample>
  ```bash curl theme={null}
  curl -X GET 'https://api.anyformat.ai/v3/workflows/0686bb97-8c30-70f0-8000-97669e000eb8/knowledge/snapshot' \
    -H 'Authorization: Bearer YOUR_API_KEY'
  ```

  ```python Python (requests) theme={null}
  import requests

  workflow_id = "0686bb97-8c30-70f0-8000-97669e000eb8"
  url = f"https://api.anyformat.ai/v3/workflows/{workflow_id}/knowledge/snapshot"
  headers = {"Authorization": "Bearer YOUR_API_KEY"}

  snapshot = requests.get(url, headers=headers).json()
  tar_bytes = requests.get(snapshot["url"]).content
  ```
</RequestExample>

<ResponseExample>
  ```json Response (200 OK) theme={null}
  {
    "corpus_version": "2026-09-11T12:00:00Z-3",
    "url": "https://static-dev.anyformat.ai/customers/org/.../snapshot.tar.gz?X-Amz-Signature=...",
    "size_bytes": 11534336,
    "document_count": 42,
    "built_at": "2026-09-11T12:00:00Z",
    "expires_in_seconds": 900
  }
  ```

  ```json Response (409, no knowledge base) theme={null}
  {
    "error": "Knowledge base not enabled",
    "detail": "This workflow has no knowledge base. Add a knowledge node. New completed runs then ingest documents; index earlier processed documents from the app's Knowledge tab.",
    "error_code": "KNOWLEDGE_NOT_ENABLED",
    "retryable": false
  }
  ```
</ResponseExample>
