<!-- Markdown twin of https://pixelvault.dev/docs/guides/export-media/ -->

# Export all media

**Goal:** a complete, offline copy of a project, for backups, migrations, or leaving. Exports are available on every plan.

An export downloads every non-expired image, video, and audio original in a project as one `.tar`. The additive `manifest.json` keeps existing `images` entries and adds `videos`, `audios`, custom metadata, folder/collection membership, job state, and parent relationships for every available video or audio artifact. Private bytes are included behind the owner-authenticated download endpoint, but private manifest URLs are `null`—no permanent or stale bearer links. Pending and failed jobs are recorded without invented artifact files. Assets already expired or deleted are omitted; an asset deleted after the snapshot remains in the manifest and its missing bytes are skipped.

## Run an export

Export

CLIShellNode.js

```
npx pixelvault-cli export
```

## How it works

```
POST /v1/export
→ 202 { "job_id": "exp_…", "status": "pending",
        "asset_count": 332, "image_count": 327, "video_count": 4, "audio_count": 1,
        "status_url": "/v1/export-jobs/exp_…" }

GET /v1/export-jobs/:id
→ { "status": "processing", "processed_count": 120,
    "asset_count": 332, "image_count": 327, "video_count": 4, "audio_count": 1 }
   # when status is "complete", the response adds "download_url"

GET /v1/export-jobs/:id/download   # streams application/x-tar once complete
```

[`POST /v1/export`](/docs/api/exports/#start_export) snapshots the project and returns `202`. Poll [`GET /v1/export-jobs/:id`](/docs/api/exports/#get_export_job) until `complete` (`pending` → `processing` → `complete`, or `failed`/`expired`), then [download](/docs/api/exports/#download_export). `processed_count` counts parent assets, not derived files. Archives expire after 24 hours (`410 export_expired`); downloading before completion is `409 export_not_ready`. One export runs per project at a time: a second `POST` returns `409 export_in_progress` with the running `job_id`. Export responses are not wrapped in `data`. The image paths and manifest fields from the previous export remain unchanged for backward compatibility.

Exports need a secret key, or a dashboard session with `?project_id=`. Instead of polling, subscribe to the `export.completed` and `export.failed` [webhooks](/docs/webhooks/); the shared pattern is in [Async jobs](/docs/async-jobs/).

## Next steps

-   [Expiry & retention](/docs/lifecycle/): what's deleted and when.
-   [Billing](/docs/billing/): what happens to media after a downgrade.
