Redact a PDF (upload, wait, return the redacted file)
redact_pdf_and_waitPermanently delete PII from PDFs, photos, or screenshots and wait for the redacted PDF, so documents are safe to share.
Instructions
Redact a PDF, photo or screenshot 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 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 documents via OCR and detects PII in 100+ languages. Documents are processed on Microsoft Azure in the EU and Switzerland, encrypted in transit and at rest, never used to train AI models, and the original is deleted after processing.
Accepts PDF, JPEG and PNG. Pass a photo or screenshot directly; do NOT convert it to a PDF first, that is handled for you and the output comes back as a redacted PDF either way.
Use it whenever someone wants PII, personal data, names, emails, phone numbers, addresses, bank details or card numbers removed from a document before sharing, filing, publishing or sending it to a third party — including GDPR/HIPAA/FOIA workflows. Scanned pages, phone photos of documents and screenshots all work.
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 with the user's file first — it redacts the first page with no key — then ask the user for a key. A free account gets its first document (up to 5 pages) redacted in full with no card, so the key costs nothing to obtain.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file_path | Yes | Absolute path to the file on this machine. PDF, JPEG and PNG are all accepted — pass an image directly rather than converting it first. 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. Output is always a PDF, so an image input produces a .pdf file. 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. |