Tool guides

Redact PDF

Draw boxes on the page or search for names, emails, phone numbers and other data, review every match, then remove it for good: the text, the vector art and the covered part of images are deleted from the file, not hidden under a black box.

What it does

Draw boxes on the page or search for names, emails, phone numbers and other data, review every match, then remove it for good: the text, the vector art and the covered part of images are deleted from the file, not hidden under a black box.

It reads one PDF file. You get: the same PDF with the chosen content removed and black boxes where it was.

Step by step on the website

Use Redact PDF

  1. Open Redact PDF on the website.

    Open Redact PDF
  2. Drop your PDF file on the page, or choose it.

  3. Choose your settings, or keep the ones already chosen:

    • Regions: type it in. Areas to remove, as page:x,y,width,height in PDF points from the page's bottom-left corner (the PDF's own user space), separated by semicolons, e.g. 1:72,640,200,40;3:50,100,120,30. A turned area adds its angle as a fifth value, degrees counter-clockwise about the area's centre from -360 to 360, e.g. 1:72,640,200,40,30 (a multiple of 90 is an upright area). Everything under an area is removed: text, vector art and the covered part of images; a turned area is painted in its own shape.
    • Search terms: type it in. Words or phrases to remove wherever they appear, one per line. Matching is exact and case-sensitive, as written.
    • Patterns: type it in. Kinds of data to find and remove, comma-separated: email, phone, number (sequences of 4 or more digits, such as account or card numbers), date. Matches are found in the PDF's text and removed like search terms.
    • Pages: type page numbers and ranges, such as 1-3, 5. Leave empty for every page.
  4. To fine-tune, open More options:

    • Image policy: Partial or Remove (Partial at first). What happens to an image under an area: partial removes only the covered pixels; remove deletes every image an area touches.
    • Keep metadata: switch it on or off (Off at first). Keep the document information, XMP and attachment names even when they contain a removed term. By default they are scrubbed too.
    • File name: type a name, or keep the one suggested. Optional. The extension is added for you.
  5. Select Redact PDF to run it.

  6. When it finishes, select Download to save your PDF file.

Settings

Every setting, with the name the page shows and the name the API uses. On the page: shown next to your file. More options: under More options. API only: not offered on the website.

SettingAPI nameChoices or valuesDefaultWhereWhat it does
RegionsregionsTextOn the pageAreas to remove, as page:x,y,width,height in PDF points from the page's bottom-left corner (the PDF's own user space), separated by semicolons, e.g. 1:72,640,200,40;3:50,100,120,30. A turned area adds its angle as a fifth value, degrees counter-clockwise about the area's centre from -360 to 360, e.g. 1:72,640,200,40,30 (a multiple of 90 is an upright area). Everything under an area is removed: text, vector art and the covered part of images; a turned area is painted in its own shape.
Search termssearchTermsTextOn the pageWords or phrases to remove wherever they appear, one per line. Matching is exact and case-sensitive, as written.
PatternspatternsTextOn the pageKinds of data to find and remove, comma-separated: email, phone, number (sequences of 4 or more digits, such as account or card numbers), date. Matches are found in the PDF's text and removed like search terms.
PagespagesTextOn the pageLeave empty for every page.
Image policyimagePolicyPartial (partial), Remove (remove)PartialMore optionsWhat happens to an image under an area: partial removes only the covered pixels; remove deletes every image an area touches.
Keep metadatakeepMetadataOn (true), Off (false)OffMore optionsKeep the document information, XMP and attachment names even when they contain a removed term. By default they are scrubbed too.
File nameoutputNameTextMore optionsOptional. The extension is added for you.

Run it with the API

Upload your file with POST /api/v2/documents, then start Redact PDF with POST /api/v2/document-operations and toolId redact-pdf. The parameters use the API names in the settings table; anything you leave out takes its default. Read the operation until its state is completed, then download the output version.

The request below uses the same starting settings as the website. The script after it does the whole journey: upload, run, wait and download.

Request body
{
  "documentId": "doc_8kq2W1",
  "versionId": "ver_3Jx9Lm",
  "toolId": "redact-pdf",
  "parameters": {},
  "idempotencyKey": "redact-pdf-2026-11-22-1"
}
cURL
#!/usr/bin/env bash
# Needs curl and jq.
# Your API key: set WELLFRIEND_API_KEY, or replace YOUR_API_KEY (keys: https://wellfriend.dev/dashboard/developer-api/keys).
set -euo pipefail
API="${WELLFRIEND_API_URL:-https://wellfriend.dev}"
WELLFRIEND_API_KEY="${WELLFRIEND_API_KEY:-YOUR_API_KEY}"
AUTH="Authorization: Bearer $WELLFRIEND_API_KEY"
RUN=$(uuidgen) # reuse this value to retry safely

# upload FILE CONTENT_TYPE KEY: prints the document id and its version id
upload() {
  curl -sS --fail-with-body -X POST "$API/api/v2/documents" -H "$AUTH" -H "Idempotency-Key: $3" \
    -H "Content-Type: $2" -H "X-Wellfriend-Filename: $(basename "$1")" --data-binary "@$1" \
    | jq -r '"\(.document.id) \(.document.currentVersion.id)"'
}

read -r DOCUMENT_ID VERSION_ID < <(upload 'input.pdf' 'application/pdf' "$RUN-upload")

# Run redact-pdf
OP=$(jq -n --arg doc "$DOCUMENT_ID" --arg ver "$VERSION_ID" --arg key "$RUN-1"  \
  --argjson parameters '{}' \
  '{documentId: $doc, versionId: $ver, toolId: "redact-pdf", parameters: $parameters, idempotencyKey: $key}' \
  | curl -sS --fail-with-body -X POST "$API/api/v2/document-operations" -H "$AUTH" \
      -H "Content-Type: application/json" -H "Idempotency-Key: $RUN-1" --data-binary @- | jq -r .operation.id)
while :; do
  RESULT=$(curl -sS --fail-with-body "$API/api/v2/document-operations/$OP" -H "$AUTH")
  STATE=$(echo "$RESULT" | jq -r .operation.state)
  case "$STATE" in completed) break ;; failed|cancelled|canceled) echo "$RESULT" >&2; exit 1 ;; esac
  sleep 1
done
DOCUMENT_ID=$(echo "$RESULT" | jq -r .operation.outputDocumentId)
VERSION_ID=$(echo "$RESULT" | jq -r .operation.outputVersionId)

# Download the result
curl -sS --fail-with-body "$API/api/v2/documents/$DOCUMENT_ID/versions/$VERSION_ID/content" -H "$AUTH" -o 'input-wellfriend.pdf'

Run it with the SDKs

The SDKs upload the file, run redact-pdf with the same parameters and wait for the result: wf.tools.redactPdf() in TypeScript, wf.tools.redact_pdf() in Python, wf.Tools.RedactPDF() in Go.

TypeScript SDK
// wellfriend-document-sdk: npm install wellfriend-document-sdk@latest. An ES module (top-level await): save it as .mts.
// Your API key: set WELLFRIEND_API_KEY, or replace YOUR_API_KEY (keys: https://wellfriend.dev/dashboard/developer-api/keys).
import { Wellfriend } from "wellfriend-document-sdk";

const wf = new Wellfriend({ apiKey: process.env.WELLFRIEND_API_KEY ?? "YOUR_API_KEY" });
const result = await wf.tools.redactPdf("input.pdf");
await result.save("input-wellfriend.pdf");
Python SDK
# wellfriend-document-sdk: pip install -U wellfriend-document-sdk
# Your API key: set WELLFRIEND_API_KEY, or replace YOUR_API_KEY (keys: https://wellfriend.dev/dashboard/developer-api/keys).
import os

from wellfriend import Wellfriend

wf = Wellfriend(api_key=os.environ.get("WELLFRIEND_API_KEY", "YOUR_API_KEY"))
result = wf.tools.redact_pdf("input.pdf")
result.save("input-wellfriend.pdf")
Go SDK
// go get wellfriend.dev/go/wellfriend@latest
package main

import (
	"context"
	"fmt"
	"os"

	"wellfriend.dev/go/wellfriend"
)

func main() {
	if err := run(); err != nil {
		fmt.Fprintln(os.Stderr, err)
		os.Exit(1)
	}
}

func run() error {
	// Your API key: set WELLFRIEND_API_KEY, or replace YOUR_API_KEY (keys: https://wellfriend.dev/dashboard/developer-api/keys).
	apiKey := os.Getenv("WELLFRIEND_API_KEY")
	if apiKey == "" {
		apiKey = "YOUR_API_KEY"
	}
	wf := wellfriend.New(wellfriend.WithAPIKey(apiKey))
	ctx := context.Background()
	res, err := wf.Tools.RedactPDF(ctx, wellfriend.File("input.pdf"), nil)
	if err != nil {
		return err
	}
	return res.Save(ctx, "input-wellfriend.pdf")
}