apyhub
Back

Redact Content from PDF File API

What it does

PDF Redaction lets you permanently remove sensitive content from a PDF by sending the file and a set of redaction boxes. You define the target areas by page number and box coordinates, and the API returns a redacted PDF as a binary file.

Use it when you need to publish or share documents without exposing personal data, account numbers, internal notes, or other confidential text and images. The request accepts one PDF file up to 20 MB and a boxes string containing a JSON object that maps page numbers to lists of rectangles. Each rectangle uses x, y, width, and height values so you can target exact regions on the page.

The response is the modified PDF file, ready to store, download, or pass to the next step in your workflow. Typical uses include legal document cleanup, compliance workflows, support ticket attachments, and document sharing pipelines where specific areas must be removed before release.

Because the redaction is applied in the output PDF itself, you can build automated systems that remove sensitive areas before a document leaves your app.

POST
Permanently redact areas of a PDF
https://api.eu.apyhub.com/freedailypro/redact-content-from-pdf-file/redact

QUICKSTART

GUIDE

Quickstart

Redact sensitive areas in a PDF by uploading the file and the redaction boxes as multipart form fields.

curl -X POST "https://api.eu.apyhub.com/freedailypro/redact-content-from-pdf-file/redact" \
  -H "apy-token: $APY_TOKEN" \
  -F "file=@/path/to/document.pdf" \
  -F 'boxes={"1":[{"x":50,"y":700,"width":200,"height":20}]}'

What you'll get back

Returns a binary file (string with format: binary) containing the redacted PDF.

TRY ITLIVE · 10 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.
Max 100MB total per request (all files combined). Larger? Use this API's URL-based endpoint instead, if it has one.
body*
The PDF. Up to 20 MB.
JSON object: page number to a list of boxes, for example {"1":[{"x":50,"y":700,"width":200,"height":20}]}

About this endpoint

What it does

Permanently redacts specified rectangular areas from a PDF and returns the modified PDF as a binary file.

Request Body

ParameterTypeMandatoryDescription
fileStringYesThe PDF file to redact. Up to 20 MB.
boxesStringYesJSON object mapping page numbers to lists of redaction boxes, for example {"1":[{"x":50,"y":700,"width":200,"height":20}]}.

Response

Returns a binary PDF file containing the permanently redacted document.

ParameterTypeMandatoryDescription
binary fileStringYesThe redacted PDF returned as binary content.

Max 100MB total per request (all files combined). Larger? Use this API's URL-based endpoint instead, if it has one.

▣ COMMON ERRORS

Errors any endpoint can return

400bad_request

Required parameter missing or malformed body.

401unauthorized

API key missing, revoked, or not authorized for this service.

429rate_limited

Your plan's per-second rate exceeded. Retry with exponential backoff.

503upstream_busy

Backend temporarily unavailable. Try again in a few seconds.