v1/scrub-file
Redact sensitive information from an uploaded file. The file is parsed to extract its text content, which is then scrubbed and returned as a string. To redact a text string directly, use v1/scrub.
Request
The request must be multipart/form-data with two parts:
file
file
The file to scrub. Required.
content
string
JSON object with filter options. Required (send {} to apply no filters).
Query parameters
redactionStyle
How to replace detected values. See Redaction styles below. Defaults to class.
key
Encryption key for the encrypted style. Must be exactly 32, 48, or 64 bytes. The raw query string value is used as the key — no hex decoding is applied.
content filter options
Only filters is supported in the content part.
filters
string[]
Allow-list of element labels to redact. Omit or pass an empty array to redact every supported element.
Limits
Multipart form size
32 MB
Redaction styles
Set ?redactionStyle= on the request. The value is case-insensitive. See Redaction Methodologies for details on each style.
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. Always pass a key — it is not enforced server-side, and output produced without one cannot be decrypted.
tokenized
Format-preserving tokens for email, IPv4, IPv6, MAC, and phone. All other elements fall back to <CLASS>.
Response fields
content
string
The file's text content with sensitive values redacted.
scanner_version
string
Version of the scanner that produced the result.
Related
v1/scrub — redact a text string directly.
v1/classify-file — detect without redacting.
Redaction Methodologies — how each redaction style transforms a detected value.
Last updated
Was this helpful?
