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

# Storage

> Capture files during task execution and extract structured data.

<Note>
  Available as an add-on on paid plans.
</Note>

Agents can capture files encountered during task execution: documents, images, videos, PDFs, spreadsheets, reports. Enable storage on a task, and Deck captures the files the agent is instructed to collect and makes them available through the API. Turn on extraction, and Deck also parses supported files into structured JSON.

## How storage fits in

Storage is configured on a [task](/concepts/tasks). When a [task run](/concepts/task-runs) executes with storage enabled, captured files become storage items tied to that run. Retrieving an individual item gives you a signed download URL and, if extraction is on, structured data pulled from the file.

## Enabling storage

Storage can be enabled on a task from the Console or the API.

| Fields                 | What it does                                                                                           |
| ---------------------- | ------------------------------------------------------------------------------------------------------ |
| `enabled`              | Capture files produced during execution                                                                |
| `extraction`           | Parse captured files into structured JSON                                                              |
| `extraction_schema`    | JSON Schema that controls what fields are extracted (required when `extraction` is on)                 |
| `extraction_prompt`    | Optional natural-language guidance for the extraction model                                            |
| `deduplication`        | Skip files that match a previous capture, based on field values you choose                             |
| `deduplication_schema` | JSON Schema that defines the fields used for duplicate detection (required when `deduplication` is on) |

## Extraction

Extraction works with PDFs, invoices, receipts, statements, and common document types. Use `extraction_schema` to define exactly what you want back. If extraction fails on a specific file, the raw file is still available for download.

## Deduplication

For recurring tasks, deduplication tells Deck to skip files that match one captured by a previous run. You choose which fields make a file "the same". For a utility bill, that might be the account number plus the billing period start date. Files matching every chosen field against a prior capture are dropped, so you only ever process new documents.

See the [storage guide](/guides/storage#deduplication) for configuration and field-picking guidance.

## Retrieving files

```text theme={null}
GET /v2/task-runs/{run_id}/storage
```

Each item includes an `extraction` field with the structured data. To get a signed download URL, retrieve the individual storage item by ID with `GET /v2/storage/{storage_id}`.

## Retention

Retention period varies by plan. All files are deleted after 90 days.

## Deep dives

<CardGroup cols={2}>
  <Card title="Storage & document extraction" icon="box-archive" href="/guides/storage">
    Full integration walkthrough with extraction schemas and examples.
  </Card>
</CardGroup>
