{
  "openapi": "3.0.1",
  "info": {
    "title": "PDF Redactor – True PII Redaction (Emails, Phones, IBAN, Cards)",
    "description": "Redact PDFs for real: automatic PII detection (emails, phone numbers, IBAN, credit cards with Luhn check, SSN and national IDs, dates) plus your own terms and regex. Redacted text is permanently removed, not just covered, and verified by re-extraction. OCR for scanned pages. No external APIs.",
    "version": "1.0",
    "x-build-id": "xN3W4AKXzgivOgTXz"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/freecamp008~pdf-redactor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-freecamp008-pdf-redactor",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/freecamp008~pdf-redactor/runs": {
      "post": {
        "operationId": "runs-sync-freecamp008-pdf-redactor",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/freecamp008~pdf-redactor/run-sync": {
      "post": {
        "operationId": "run-sync-freecamp008-pdf-redactor",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "required": [
          "pdfUrls"
        ],
        "properties": {
          "pdfUrls": {
            "title": "PDF URLs",
            "type": "array",
            "description": "Direct links to the PDFs to redact (or <code>data:application/pdf;base64,...</code> URLs). Each PDF becomes one redacted PDF plus a list of redactions.",
            "items": {
              "type": "string"
            }
          },
          "piiTypes": {
            "title": "Personal data to detect",
            "type": "array",
            "description": "Built-in detectors. <b>email</b>, <b>phone</b> (international numbers validated with libphonenumber, plus any number after Tel/Phone/Fax/Mobile), <b>iban</b> (checksum-validated), <b>credit_card</b> (Luhn-validated), <b>national_id</b> (US SSN, UK NINO, and IDs after keywords like SSN, TIN, passport, tax ID), <b>date</b>, <b>ip_address</b>, <b>url</b>.",
            "items": {
              "type": "string",
              "enum": [
                "email",
                "phone",
                "iban",
                "credit_card",
                "national_id",
                "date",
                "ip_address",
                "url"
              ],
              "enumTitles": [
                "Email addresses",
                "Phone numbers",
                "IBAN / bank accounts",
                "Credit card numbers",
                "SSN / national IDs",
                "Dates",
                "IP addresses",
                "URLs"
              ]
            },
            "default": [
              "email",
              "phone",
              "iban",
              "credit_card",
              "national_id"
            ]
          },
          "terms": {
            "title": "Words and phrases to redact",
            "type": "array",
            "description": "Literal terms such as names, company names, addresses or case numbers. Matching ignores case and line breaks inside phrases.",
            "items": {
              "type": "string"
            }
          },
          "regexes": {
            "title": "Regular expressions",
            "type": "array",
            "description": "JavaScript regular expressions for custom patterns, e.g. <code>INV-\\d{6}</code> or <code>/Kundennummer:\\s*\\d+/i</code>.",
            "items": {
              "type": "string"
            }
          },
          "caseSensitive": {
            "title": "Case-sensitive terms",
            "type": "boolean",
            "description": "Match terms (and regexes without flags) case-sensitively.",
            "default": false
          },
          "wholeWords": {
            "title": "Whole words only",
            "type": "boolean",
            "description": "Terms only match complete words (\"Ann\" does not match \"Annual\").",
            "default": true
          },
          "phoneCountry": {
            "title": "Default phone country",
            "type": "string",
            "description": "Optional two-letter country code (e.g. <code>US</code>, <code>DE</code>, <code>FR</code>) so national phone numbers without a + prefix are detected too. Leave empty to detect international numbers and numbers after Tel/Phone/Fax labels only."
          },
          "ocrScannedPages": {
            "title": "OCR scanned pages",
            "type": "boolean",
            "description": "Also find personal data on pages without a text layer (scans, photos) using built-in OCR. Charged per OCR'd page.",
            "default": false
          },
          "ocrLanguage": {
            "title": "OCR language",
            "type": "string",
            "description": "Tesseract language code(s) for scanned pages, e.g. <code>eng</code>, <code>deu</code>, <code>eng+fra</code>.",
            "default": "eng"
          },
          "keepTextSearchable": {
            "title": "Keep remaining text searchable",
            "type": "boolean",
            "description": "Redacted pages are rebuilt as images (that is what makes the removal permanent). With this on, the non-redacted words are put back as an invisible text layer so the page stays searchable and copyable. Redacted words are never written back.",
            "default": true
          },
          "rasterizeAllPages": {
            "title": "Rebuild every page",
            "type": "boolean",
            "description": "Rebuild all pages as images, not only pages with redactions. Strongest option: also strips hidden layers, comments and invisible content from pages without matches.",
            "default": false
          },
          "dpi": {
            "title": "Resolution of rebuilt pages (DPI)",
            "minimum": 100,
            "maximum": 400,
            "type": "integer",
            "description": "Resolution used to rebuild redacted pages. 200 is crisp for text; 300 for small print; 150 for smaller files.",
            "default": 200
          },
          "boxColor": {
            "title": "Redaction box colour",
            "type": "string",
            "description": "Hex colour of the redaction boxes.",
            "default": "#000000"
          },
          "includeMatchedText": {
            "title": "Include the redacted text in the report",
            "type": "boolean",
            "description": "Add the original matched text to every redaction in the results. Off by default so the report itself contains no personal data (a masked preview like <code>j**n@e*****e.com</code> is always included).",
            "default": false
          },
          "outputPdf": {
            "title": "Create the redacted PDF",
            "type": "boolean",
            "description": "Turn off for a detection-only run that just lists what would be redacted (faster, no file produced).",
            "default": true
          },
          "maxPages": {
            "title": "Max pages per PDF",
            "minimum": 1,
            "maximum": 2000,
            "type": "integer",
            "description": "PDFs with more pages are rejected (a partially redacted document would be unsafe).",
            "default": 500
          },
          "password": {
            "title": "PDF password",
            "type": "string",
            "description": "Password for encrypted PDFs (optional). The redacted PDF is saved without encryption."
          },
          "returnBase64": {
            "title": "Return base64 (Standby API only)",
            "type": "boolean",
            "description": "Standby HTTP API only: also include the redacted PDF as a base64 string (<code>pdfBase64</code>) in the response.",
            "default": false
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}