Bytefusedocs

Protect

Redact PII

Detect and truly remove personal data from a PDF — the text is deleted from the content stream, not just covered with a black box, and the result is verified to confirm nothing leaked.

Login required 40 credits / callSynchronous

Overview

Upload a PDF; the engine finds PII, removes the underlying glyphs across all pages, then re-extracts the text to confirm none of the redacted values remain (text_fully_removed). Images are preserved — only text is removed.

POSThttps://api.bytefuse.in/api/v1/redact

This tool requires authentication

Redaction is not free-to-try — an anonymous call returns 401. Send a dt_live_ key or JWT.

Request

Content type multipart/form-data:

filefilerequired
The PDF to redact. Must end in .pdf or the request returns 415.
entity_typesstringoptional
Comma-separated PII types to redact, e.g. EMAIL,CREDIT_CARD. Values are upper-cased and validated; an unknown type returns 422. Omit to redact every supported type.Default: all types

Entity types

The supported types (listed in match-priority order — earlier types win overlaps):

CREDIT_CARD13–19 digit card numbers (Luhn-checked)
AADHAARIndian 12-digit Aadhaar (Verhoeff-checked)
IBANInternational bank account numbers
US_SSNUS Social Security numbers
US_ITINUS individual taxpayer IDs
PAN_INDIAIndian PAN (AAAAA9999A)
EMAILEmail addresses
IP_ADDRESSIPv4 addresses
PHONEInternational / US phone numbers

Fetch the list at runtime

A UI can read the always-current list from the public, no-auth endpoint GET /api/v1/redact/entity-types, which returns the types alphabetically sorted.

Response

200 OK, application/json:

200 OK
{
  "success": true,
  "url": "https://<r2-host>/redacted/20260704/<uuid>.pdf",
  "redactions_made": 4,
  "entities": { "EMAIL": 3, "CREDIT_CARD": 1 },
  "text_fully_removed": true,
  "pages": 8,
  "credits_charged": 3
}
successbooloptional
Always true on 200.
urlstringoptional
Public R2 URL of the redacted PDF. No expires_at.
redactions_madeintoptional
Total redaction boxes applied.
entitiesobjectoptional
Per-type counts, e.g. { "EMAIL": 3 }.
text_fully_removedbooloptional
true if verification confirms no redacted value remains in the text layer — the differentiator versus “black box only” tools.
pagesintoptional
Page count of the PDF.
credits_chargedintoptional
Always 40 (login required). Mirrors X-Credits-Charged.

Examples

# redact only emails and cards
curl -X POST https://api.bytefuse.in/api/v1/redact \
  -H "X-API-Key: dt_live_your_key" \
  -F "file=@contract.pdf" \
  -F "entity_types=EMAIL,CREDIT_CARD"
# Omit entity_types to redact every supported type.

Errors

401Anonymous / not signed in — redaction is login-only.
415Missing filename or not a .pdf.
422An unknown entity_types value, or a password-protected / invalid PDF.
402 / 429 / 503Insufficient credits, rate limited, or capacity/config error.
500Redaction failed unexpectedly.