> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.staple.ai/llms.txt.
> For full documentation content, see https://docs.staple.ai/llms-full.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.staple.ai/_mcp/server.

# Document Redaction

## What is redaction?

Redaction is a feature that blacks out sensitive information in documents. Users can utilize this functionality for audit purposes.

![](https://files.buildwithfern.com/staple.docs.buildwithfern.com/2d47180f1e389079a0046fddcd6f634ff646b3d22c85e08ebdcf63745aa2d780/docs/assets/images/supporthub/document-redaction_673c8c7ba8cb4ca7828d97e5_673c88d3f91ffb39d4def9b1_image-20240724-045005.png)

### Use cases

Customer X has over 500,000 documents and email files (.pdf, .msg, .tif) containing credit card numbers. According to the country’s regulations, they are prohibited from displaying or storing these credit card numbers in their database. The primary challenge lies in processing such a large volume of documents efficiently while ensuring compliance.

## Redaction via the UI

Open a document in the *Completed*tab. Decide the fields you want to redact. In this example, we will redact *Total*.

![](https://files.buildwithfern.com/staple.docs.buildwithfern.com/1c550fc71e2c93a8465d7eaed9c2bfc7905572abcff51c42017a6bd1a54bac33/docs/assets/images/supporthub/document-redaction_673c8c7ca8cb4ca7828d9821_673c8911119cc0b859810d6c_image-20241115-041625.png)

On the top horizontal bar, select “*Export*” and “*Redacted files (.pdf)*”.

![](https://files.buildwithfern.com/staple.docs.buildwithfern.com/a00be5dc46820a28bd01258a90359d247e51ba26d891541b29cfdd721434564e/docs/assets/images/supporthub/document-redaction_673c8c7ca8cb4ca7828d981b_673c894e0b2130356ce3632a_image-20241115-041709.png)

Select fields to redact. You can select multiple fields. Then click the blue button “*Export*”.

![](https://files.buildwithfern.com/staple.docs.buildwithfern.com/b11e1b3e73001cefb3e5968014c034b877148e54d7a810f99731c6125b6b7d6b/docs/assets/images/supporthub/document-redaction_673c8c7ca8cb4ca7828d981e_673c89a9907fc8e244964b26_image-20241115-041755.png)

The system will display the green status bars.

```
```

Redaction process spend time for a while in the background. This message inform users to wait.

```
```

This message confirms the redaction is completed.

![](https://files.buildwithfern.com/staple.docs.buildwithfern.com/7eb434817d92dae05da32203e29f836a469dce914535fe8aab6781465d39d04e/docs/assets/images/supporthub/document-redaction_673c8c7ca8cb4ca7828d97ff_673c8a28add39b54a1c9a40d_image-20241115-053749.png)

Once completed, the document will be moved to the *Exported* tab. If you open the exported document, you will not see the redacted version on the website. To get the redacted file, proceed with the next step.

![](https://files.buildwithfern.com/staple.docs.buildwithfern.com/f72c1d94453cb46fbdf6a5a3f951f24c51c13da5d2ab838227f861e561f9ae83/docs/assets/images/supporthub/document-redaction_673c8c7ba8cb4ca7828d97e8_673c8a51b2cd206874080df5_image-20241115-042038.png)

Click the three-dot icon of the document.

![](https://files.buildwithfern.com/staple.docs.buildwithfern.com/0d5e3d2ab857a4e8d20533ff75cac09ed0c361cbf5255aed0cef368fc69783c3/docs/assets/images/supporthub/document-redaction_673c8c7ba8cb4ca7828d97eb_673c8a7790e18c1629479417_image-20241115-054159.png)

Click “*Download redacted file*”. The current system allows to download one redacted file at a time. A zip file “*redactions.zip*” will be downloaded to your computer.

![](https://files.buildwithfern.com/staple.docs.buildwithfern.com/e77925902c64cd248a186d46c22c0cecebd506ce42f9c0cb6249c2e118a9009a/docs/assets/images/supporthub/document-redaction_673c8c7ca8cb4ca7828d97fb_673c8aa5a1f3a13dfb80b89b_image-20241115-053940.png)

Extract the zip file and you will see the redacted document. The value of the selected field “*Total*” is redacted (blacked out).

![](https://files.buildwithfern.com/staple.docs.buildwithfern.com/7b055dcdae87a2da50312aca07eac3c35e18621ab969b317a8560636182adde9/docs/assets/images/supporthub/document-redaction_673c8c7ca8cb4ca7828d9803_673c8a98b44a0ce4865fc2c6_image-20241115-054444.png)

## Redaction via API endpoint

Staple AI implemented a solution to detect credit card numbers and redact the relevant fields. The system imports a large number of documents into queues, identifies the credit card numbers, performs bulk redaction via an API endpoint, and finally exports the redacted files to Customer X's system.

1. POST Redact Documents ([link](https://documentation.staple.io/#fb8a1ff0-217b-4a6a-bfc3-67287affc31b))

[https://api.staple.io/v2/redaction/document](https://api.staple.io/v2/redaction/document)

1. GET Tracking Redacted Document ([link](https://documentation.staple.io/#371e8a47-3ba5-4cce-a281-7e6ee83a2f97))

[https://api.staple.io/v2/redaction/tracking/\`\{trackingId}\`](https://api.staple.io/v2/redaction/tracking/`\{trackingId}`)