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

# Redaction

> Remove selected information from PDFs and images, with verification results.

> [!NOTE]
>
> This feature is currently in beta. The API may change.

**Before you begin**, make sure you have:

1. A [Datalab account](https://www.datalab.to/auth/sign_up) with an [API key](https://www.datalab.to/app/keys) (new accounts include \$5 in free credits)
2. Python 3.10+ installed
3. The Datalab SDK: `pip install datalab-python-sdk`
4. Your `DATALAB_API_KEY` environment variable set

## Submit a document

Send a multipart request to `POST https://www.datalab.to/api/v1/redact` with your
`X-API-Key` header and either a `file` upload or a `file_url`.

Choose a starting point:

| Preset | Removes | Keeps |
| - | - | - |
| `personal_information` | Private individuals' names, contact details and identifiers | Organisations, professional-role officials, record identifiers and transaction facts |
| `financial_details` | Financial account identifiers and payment credentials, including business accounts | Names, public bank routing details, dates, amounts and invoice identifiers |
| `business_confidentiality` | Customer/supplier identities, negotiated commercial terms and explicitly non-public business information | General provisions, structure and public reference information |
| `manuscript_anonymisation` | This paper's author identities, affiliations and correspondence details | Research content, references and publication identifiers |

Review and edit the rules for your document; these starting points are not
compliance guarantees. For specific requirements, provide `redaction_spec` as a
JSON object with a `goal`, `rules` and optional `keep` entries. Each rule has a
`label` and optional `id` and `detail`. Custom fields replace the corresponding
preset fields.

In the playground, **Custom rules** starts with empty Remove and Keep lists.
Add at least one Remove rule. Edits save automatically; replacing a customized
starting point or resetting rules asks before discarding edits. Visual and Raw
editing preserve the same rules.

Redaction reviews the whole document, up to 60 pages. PDF and image inputs are
supported. Page subsets are not supported.

## Retrieve the result

Poll the returned `request_check_url` until `status` is `complete`. The direct
response returns an available PDF as `output_base64`; regional requests may
provide a signed `result_url` for the result JSON instead.

The PDF is returned even when checks fail. Inspect `verdict` and `failing_checks`:
`PASS` means the checks passed; other verdicts mean the PDF needs review.
`withheld` is true only when no PDF
is available, rather than whenever a check fails.

The report provides `targets_removed_count`, `targets_not_found_count`,
redaction-box/page counts and check identifiers. It does not include removed
text, rule explanations or document-derived check details.

The playground labels outputs that did not pass verification **Needs review**
and allows you to preview and download them alongside the check results.

## Pricing

On the current rate card, Redact starts at \$10 per 1,000 pages. The run bills the
greater of its page charge and compute charge (1.25× measured model cost), never
their sum. Higher-cost runs therefore incur additional usage fees above the page
price. Completed runs
are charged even when verification fails. Existing contract and
legacy-plan rates can differ; the playground displays your team's quote. See
[pricing](https://www.datalab.to/pricing).

## Next Steps

> [card] [Pipeline API](https://documentation.datalab.to/docs/recipes/pipelines/pipeline-overview.md)
>
> Run Redact as a standalone pipeline step.

> [card] [Playground](https://www.datalab.to/app/playground)
>
> Configure a preset or custom specification and inspect the result.


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