PDF Redaction

Detect PII in PDF with file upload

Detect PII (Personally Identifiable Information) in a PDF file without redaction. Accepts PDF as multipart/form-data file upload. Returns detected PII entities and processing metrics. Supports multiple OCR languages, rotated text detection, and customizable PII tag detection. Only processes the first page of the PDF.

POST
/api/detect/pii/file/pdf

Authorization

APIKeyHeader
X-API-Key<token>

In: header

Request Body

multipart/form-data

pdf*file

PDF file to detect PII in

Formatbinary
force_ocr?boolean

Force OCR processing even if text is extractable from PDF

Defaulttrue
rotated_text?boolean

Enable detection and recognition of rotated text in the document

Defaulttrue
custom_tags?|null

List of custom tags to detect. These tags are added to the standard PII tags

tags?|null

List of predefined PII tags to detect. If empty, all available tags are used. Available tags: DATE, PERSON_NAME, ORGANIZATION, LOCATION, EMAIL, PHONE, ID, ACCOUNT, ZIP_CODE, ADDRESS, IP, URL, SSN, DRIVER_LICENSE, PASSPORT, PASSWORD, AGE, CREDIT_CARD, MONEY_AMOUNT. Can be comma-separated string like 'PERSON_NAME,EMAIL,PHONE' or list of strings.

ocr_langs?|null

List of OCR languages to use for text recognition. Available languages: eng (English), spa (Spanish), fra (French), deu (German), ita (Italian), por (Portuguese), rus (Russian). Defaults to English only. Multiple languages can improve accuracy for multilingual documents. Can be comma-separated string like 'eng,spa' or list of strings.

Default[["eng"]]

Response Body

application/json

application/json

application/json

application/json

curl -X POST "https://api.pdf-redaction.com/api/detect/pii/file/pdf" \  -F pdf="document.pdf"
{
  "detected_pii": {
    "path": "string",
    "entities": [
      {
        "entity_group": "string",
        "score": 0,
        "word": "string",
        "start": 0,
        "end": 0,
        "boxes": [
          {
            "text": "string",
            "score": 0,
            "x": 0,
            "y": 0,
            "width": 0,
            "height": 0,
            "angle": 0
          }
        ]
      }
    ],
    "exception": "string",
    "json": ""
  },
  "processing_time": {
    "total": 0,
    "stages": {
      "property1": 0,
      "property2": 0
    }
  }
}
{
  "detail": "Invalid document type"
}
Empty
{
  "error_code": "LLM_CALL_ERROR",
  "message": "string"
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string"
    }
  ]
}
Empty