Anonymize PDF with file upload
Anonymize a PDF file by detecting and redacting PII (Personally Identifiable Information). Accepts PDF as multipart/form-data file upload. Returns anonymized PDF as binary stream. This endpoint is useful for direct file uploads without base64 encoding. Supports multiple OCR languages, rotated text detection, and customizable PII tag detection via query parameters. Only processes the first page of the PDF.
In: header
Request Body
multipart/form-data
PDF file to anonymize
binaryForce OCR processing even if text is extractable from PDF
falseEnable detection and recognition of rotated text in the document
falseEnable text redaction using NER (Named Entity Recognition). When enabled, detected PII entities are redacted (blacked out) in the output PDF
trueMinimum chunk size for text processing. Used to control text segmentation for NER processing. Larger values may improve accuracy but increase processing time
0List of custom tags to detect and redact. These tags are added to the standard PII tags
List of predefined PII tags to detect (and redact, where applicable). If empty, all available tags are used. Available tags: DATE, PERSON_NAME, ORGANIZATION, LOCATION, EMAIL, PHONE, ID, ACCOUNT, ZIP_CODE, ADDRESS, IP, URL, SSN, DRIVER_LICENSE, PASSPORT, PASSWORD, AGE, CREDIT_CARD, MONEY_AMOUNT, SIGNATURE, QR_CODE, FACE. Can be comma-separated string like 'PERSON_NAME,EMAIL,PHONE' or list of strings. Available values: DATE, PERSON_NAME, ORGANIZATION, LOCATION, EMAIL, PHONE, ID, ACCOUNT, ZIP_CODE, ADDRESS, IP, URL, SSN, DRIVER_LICENSE, PASSPORT, PASSWORD, AGE, CREDIT_CARD, MONEY_AMOUNT, SIGNATURE, QR_CODE, FACE
List of OCR languages to use for text recognition. Available languages: eng (English), spa (Spanish), fra (French), deu (German), ita (Italian), por (Portuguese), rus (Russian). Defaults to English only. Multiple languages can improve accuracy for multilingual documents. Can be comma-separated string like 'eng,spa' or list of strings. Available values: eng, spa, fra, deu, ita, por, rus
["eng"]Response Body
application/pdf
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://api.pdf-redaction.com/api/anonymize/file/pdf" \ -F pdf="document.pdf""binary pdf data"{
"detail": "Invalid document type"
}{
"error_code": "UNAUTHORIZED",
"message": "Invalid token"
}{
"error_code": "FORBIDDEN",
"message": "Missing credentials: provide X-API-Key or Authorization: Bearer token"
}{
"error_code": "PROCESSING_ERROR",
"message": "Failed to process the PDF file"
}{
"detail": [
{
"loc": [
"string"
],
"msg": "string",
"type": "string"
}
]
}{
"error_code": "TOO_MANY_REQUESTS",
"message": "Rate limit exceeded: 5 per 1 minute"
}