Redact PDF API
Permanently remove text, image pixels and overlapping vector content from explicitly selected page rectangles.
Endpoint and task semantics#
Operation code: redact
Start this operation with POST /v1/tasks and the tool code shown above. Upload and attach source PDFs (or use task-scoped upload endpoints), then call POST /v1/tasks/{task_id}/process with operation settings.
Prepare reviewed documents for disclosure with known sensitive content areas.
Inputs: Exactly one sealed PDF; 1–200 explicit rectangles, each inside its target page.
Configuration and extra parameters#
| Setting | Type | Behaviour |
|---|---|---|
| regionsrequired | object[] | Each region: {page,x0,y0,x1,y1}, page starts at 1 and rectangle coordinates use PDF points from page top-left. All rectangles must be within page bounds. |
| strip_metadata | boolean | Also remove metadata, attachments and scripts. Default: true. |
Options are validated by the API. Unknown settings and unsupported values return an error instead of being ignored.
Working request sequence#
Programming language: cURL
Choose a language · scroll horizontally for all 10 SDK languages
# Server-side API calls. Save the returned task_id.
curl -fsS -X POST 'https://api.pdfhq.io/v1/tasks' \
-H 'x-api-key: YOUR_API_KEY' -H 'Content-Type: application/json' \
-d '{"tool":"redact"}'
# Upload and verify 1 PDF(s), then obtain and approve a credit quote:
curl -fsS 'https://api.pdfhq.io/v1/tasks/TASK_ID/quote' -H 'x-api-key: YOUR_API_KEY'
# ONLY after explicit customer approval:
test "$PDFHQ_APPROVE_QUOTE" = yes || { echo "Approval required" >&2; exit 1; }
curl -fsS -X POST 'https://api.pdfhq.io/v1/tasks/TASK_ID/process' \
-H 'x-api-key: YOUR_API_KEY' -H 'Content-Type: application/json' \
-d '{"options":{"regions":[{"page":1,"x0":72,"y0":100,"x1":300,"y1":132}],"strip_metadata":true}}'
curl -fsS 'https://api.pdfhq.io/v1/tasks/TASK_ID' -H 'x-api-key: YOUR_API_KEY'After starting a task, upload and verify PDFs, review the credit quote, and get explicit approval before processing. API keys belong on your server, never on signed storage uploads.
Generated downloadable packages cover the task workflow only. Full-service SDKs require a verified runtime OpenAPI specification; the Python, JavaScript and TypeScript task SDKs stream file uploads; the other languages require signed multipart uploads implemented by the caller.
The returned task ID is used for both status polling and retrieval. After the task succeeds, request a signed output URL rather than embedding a download secret.
Output and important details#
New PDF with content physically removed in marked regions and black fill applied.
Requires visual review and verification against original. Not a semantic redaction detector; does not guarantee all instances of a name elsewhere in a file are found. Intersecting vector objects may be removed in full. Target pages must be unrotated and PDFs with form fields must be flattened first. Existing digital signatures are invalidated.
Errors, retries and billing