> For the complete documentation index, see [llms.txt](https://docs.teleskope.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.teleskope.ai/the-platform/api-service/redaction-api/v1-scrub.md).

# v1/scrub

Redact personal or sensitive information from a payload. Set the redaction style with the `redactionStyle` query parameter and control which elements are redacted with the body fields below.

{% openapi src="/files/cGyOSqpybs6wM3Oy8JMJ" path="/v1/scrub" method="post" %}
[{"openapi":"3.12.json](https://2383928706-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgO8NOoWqwRd6MduHoEy7%2Fuploads%2Fgit-blob-249bd45d1ddea31eba38b4ababd020880e363a48%2F%7B%22openapi%22%3A%223.12.json?alt=media)
{% endopenapi %}

## Redaction styles

Set `?redactionStyle=` on the request. The value is case-insensitive, and an unrecognized value falls back to `class`. See [Redaction Methodologies](https://github.com/teleskope-engineering/gitbook/blob/main/the-platform/specifications/redaction-methodologies.md) for the underlying methods.

| Style            | Result                                                                                                     |
| ---------------- | ---------------------------------------------------------------------------------------------------------- |
| `class`          | Replaces the value with its entity label, e.g. `<EMAIL>`. Default.                                         |
| `class_numbered` | Numbered labels, e.g. `<email_1>`. Identical values share a number.                                        |
| `empty`          | Drops the matched value.                                                                                   |
| `masked`         | Replaces characters with `*`.                                                                              |
| `encrypted`      | AES-SIV, reversible. Requires the `key` parameter (32, 48, or 64 bytes).                                   |
| `tokenized`      | Format-preserving tokens for email, IPv4, IPv6, MAC, and phone. All other elements fall back to `<CLASS>`. |

## Body options

| Field               | Type      | Description                                                                                                                                    |
| ------------------- | --------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| `content`           | string    | Text to scrub. Required.                                                                                                                       |
| `filters`           | string\[] | Allow-list of element labels to redact. Omit to redact every supported element.                                                                |
| `excludeFilters`    | string\[] | Deny-list of element labels to skip. Takes precedence over `filters`.                                                                          |
| `sensitivityLevels` | string\[] | Restrict redaction to these tiers: `low`, `medium`, `high`, `critical`. Elements with no assigned tier are always included.                    |
| `useML`             | boolean   | Enable ML-based detection in addition to rules. Defaults to `true`.                                                                            |
| `treatAsJSON`       | boolean   | Treat `content` as a JSON string: classify only inside string values and preserve structure so the output still parses. Use for JSON payloads. |
