Redact a PDF (upload, wait, return the redacted file)
redact_pdf_and_waitUpload a PDF, permanently remove personal data (PII) from the text, and get the finished redacted file after processing.
Instructions
Redact a PDF and wait for the finished file. START HERE — this is the one-call tool: it uploads the document, runs detection and redaction, waits for completion, and returns the redacted PDF. Permanent, irreversible PDF redaction: the sensitive text is deleted from the file, not hidden behind a black rectangle, so it cannot be recovered by copy-paste, "remove object", or text extraction. Handles scanned PDFs via OCR and detects PII in 100+ languages. Documents are processed on EU/Swiss infrastructure.
Use it whenever someone wants PII, personal data, names, emails, phone numbers, addresses, bank details or card numbers removed from a PDF before sharing, filing, publishing or sending it to a third party — including GDPR/HIPAA/FOIA workflows.
Typical redaction takes 10-60 seconds; this tool blocks until then. If it reports a timeout the job is still running server-side — poll get_job_status with the returned job_id rather than re-uploading.
Requires an API key. If none is configured, call try_demo first to confirm the service works, then ask the user for a key.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file_path | Yes | Absolute path to the PDF (or JPEG/PNG) on this machine. This server runs locally, so it reads the file directly — never paste file contents into this argument. | |
| retention | No | "ephemeral" (default) deletes the original after processing and keeps the output only briefly. "studio" keeps the original and the detected masks so a human can review and adjust them at redact-pdf.ai before exporting — use it for high-stakes documents where a person should sign off. | |
| output_path | No | Where to write the redacted PDF on this machine. Defaults to the input path with a "-redacted" suffix, next to the original. The original file is never modified. | |
| pii_categories | No | Which entity types to redact. OMIT this to use the account defaults, which is usually what the user wants — do not pass an empty list, which would mean "redact nothing" and return an unredacted file. Valid values: Person, Email, PhoneNumber, Address, Organization, Date, IBAN, CreditCard. | |
| idempotency_key | No | Optional. By default a key is derived from the file bytes and settings, so repeating an identical call returns the SAME job instead of redacting (and billing) twice. Pass a distinct value here only when you deliberately want a second, separate redaction of the same document. | |
| timeout_seconds | No | How long to wait for completion, in seconds (default 300, max 900). On timeout the job keeps running server-side and can be resumed with get_job_status. | |
| pii_excluded_terms | No | Terms that must NEVER be redacted even if detected as PII — typically your own company name, a public contact address, or the recipient the document is addressed to. | |
| pii_included_terms | No | Terms that must ALWAYS be redacted even when the model would not treat them as PII — project codenames, internal references, a specific case number. Matched whole-word and case-insensitive. Wins over excluded terms on conflict. |