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

# Take everything with you

> A full export of a space — every memory and entity — as a file you hold. No SDK method; three HTTP calls.

[← All use cases](/use-cases/overview)

<div className="uc-examples"><a className="uc-api" href="/guides/export">API reference</a></div>

## The scenario

Two reasons to export, and they arrive at very different moments. One is
routine: somebody asks whether your memory layer is a lock-in risk, and the only
answer that lands is a file. The other is urgent: you are about to
[delete a space](/use-cases/one-space-or-many), or answer a
[deletion request](/use-cases/delete-a-users-memories), and the export is the
last thing standing between a mistake and permanent loss.

**What this recipe shows that no other does:** a surface with **no SDK method at
all**. Exports are REST-only, so this is raw HTTP — and it is worth knowing
which parts of the platform are like that.

## Step 1 — Ask for one

```python theme={null}
import httpx

H = {"Authorization": f"Bearer {API_KEY}"}
BASE = "https://api.anonalabs.com"

job = httpx.post(f"{BASE}/v1/spaces/support/exports", headers=H).json()
print(job["job_id"], job["status"])
```

Returns `202` with a job. Exports are asynchronous — a large space takes a while.

## Step 2 — Poll the list

```python theme={null}
jobs = httpx.get(f"{BASE}/v1/spaces/support/exports", headers=H).json()
for j in jobs["items"]:
    print(j["job_id"], j["status"], j.get("memory_count"), j.get("size_bytes"))
```

## Step 3 — Download it

```python theme={null}
url = httpx.get(f"{BASE}/v1/spaces/support/exports/{job_id}/download", headers=H).json()
print(url["download_url"], "expires in", url["expires_in"], "seconds")
```

The download URL is short-lived and pre-signed — fetch the bytes promptly, and
do not paste it into a ticket, because anyone holding it can read the bundle.

## Step 4 — Actually keep it

```python theme={null}
with httpx.stream("GET", url["download_url"]) as r, open("support-export.json", "wb") as f:
    for chunk in r.iter_bytes():
        f.write(chunk)
```

An export you generated and never downloaded is not a backup. Bundles expire.

## Evals

An untested backup is not a backup:

1. Export a small space and download it.
2. Open it. Count the memories and compare against `list_memories`'s `total`.
3. Confirm it contains the **raw facts**, not just the consolidated
   observations — a takeout that dropped the evidence layer is not a takeout.
4. Do this once a quarter rather than once, ever.

## Guardrails

<Warning>
  **Export before you delete, every time.** Space deletion and memory deletion
  are both irreversible with no recycle bin. The export is the only recovery
  path, and it has to exist *before* the mistake.
</Warning>

* **Exports are owner-only.** A visitor to a shared space cannot take a copy of
  someone else's space, which is the correct behaviour and occasionally
  surprising.
* **Bundles expire** — `expires_at` on the job says when. Re-export rather than
  hoarding download URLs.
* **The bundle is plain readable content.** It is the most concentrated copy of
  your customers' data that will ever exist; treat the file accordingly.
* **There is no import endpoint to pair with this.** Exports answer "can I
  leave"; they do not currently give you "and come back". Do not design a
  migration around round-tripping one.

## Where to go next

[Delete a user's memories, provably](/use-cases/delete-a-users-memories) — where
the export is step two of a runbook rather than an insurance policy.
