> ## 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.

Agents can capture files encountered during task execution: PDFs, documents, spreadsheets, images, and archives. 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](https://docs.deck.co/concepts/tasks.md). When a [task run](https://docs.deck.co/concepts/task-runs.md) 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 |
| `extraction_pages_max` | Optional limit on how many pages of each file are extracted, to control extraction costs |
| `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 parses supported files into structured JSON. It's powered by a language model that matches document content to your schema fields by meaning, not exact keywords or position. Use `extraction_schema` to define exactly what you want back. Each storage item reports its extraction outcome in a `result` field (`success` or `failure`); a failed file has `result` set to `failure` but is still kept and available for download. See [Supported files](https://docs.deck.co/guides/storage.md#supported-files) in the storage guide for the types that can be captured and extracted, and the file-size limit.

## 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 skipped, so you only ever process new documents. Each skip is recorded on the task run under `storage_deduplicated`, with a reference to the matched file and the run that first captured it.

See the [storage guide](https://docs.deck.co/guides/storage.md#deduplication) for configuration, field-picking guidance, and how to retrieve skipped files.

## Input vs. output files

Storage items carry a `purpose`: `attachment` for files you provide as task input for the agent to use, `extraction` for files you provide as task input that Deck extracts data from directly (skipping the agent), and `output` for files the agent captures during a run. All three are returned together with a task run's storage. File inputs are available on Enterprise plans. See [providing files as input](https://docs.deck.co/guides/storage.md#providing-files-as-input).

## Retrieving files

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

Each item includes a pre-signed `url` for download and an `extraction` field with the structured data. URLs expire after an hour; refetch the item if one expires. You can also retrieve a single storage item by ID with `GET /v2/storage/{storage_id}`.

## Retention

Retention period varies by plan. All files are deleted after 90 days. To remove a file sooner, [delete it through the API](https://docs.deck.co/guides/storage.md#deleting-storage-items).

## Deep dives

> [card] [Storage & document extraction](https://docs.deck.co/guides/storage.md)
>
> Full integration walkthrough with extraction schemas and examples.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.