{
  "openapi": "3.0.1",
  "info": {
    "title": "PII Masker — Redact CPF, CNPJ, Emails, Phones, Names (LGPD)",
    "description": "Find and mask personal data in texts, JSON or any Apify dataset: CPF, CNPJ (incl. alphanumeric), e-mails, phones, cards, IBAN, IPs and names. Redact, mask, partial or hash. Check-digit validated. LGPD/GDPR ready.",
    "version": "0.1",
    "x-build-id": "18uFaUrIgqDlX8oCX"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/adorable_partial~pii-masker/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-adorable_partial-pii-masker",
        "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/adorable_partial~pii-masker/runs": {
      "post": {
        "operationId": "runs-sync-adorable_partial-pii-masker",
        "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/adorable_partial~pii-masker/run-sync": {
      "post": {
        "operationId": "run-sync-adorable_partial-pii-masker",
        "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",
        "properties": {
          "texts": {
            "title": "Texts",
            "type": "array",
            "description": "Free texts to clean (messages, tickets, reviews, transcripts...). Each text is one record.",
            "items": {
              "type": "string"
            }
          },
          "records": {
            "title": "JSON records",
            "type": "array",
            "description": "JSON objects to clean. Structure is kept; only values with personal data change."
          },
          "datasetId": {
            "title": "Apify dataset",
            "type": "string",
            "description": "Clean every item of an existing Apify dataset, e.g. the output of a scraper run (pick it from your storage or paste its ID). Items are processed like JSON records."
          },
          "method": {
            "title": "Masking method",
            "enum": [
              "redact",
              "mask",
              "partial",
              "hash"
            ],
            "type": "string",
            "description": "How found values are replaced. Hash keeps joins possible: the same value always becomes the same token (with the same secret).",
            "default": "redact"
          },
          "piiTypes": {
            "title": "Data types",
            "type": "array",
            "description": "Types to detect. Empty = all except person names (use the switch below for names).",
            "items": {
              "type": "string",
              "enum": [
                "email",
                "cnpj",
                "cpf",
                "pis",
                "credit_card",
                "iban",
                "rg",
                "ip_address",
                "license_plate",
                "cep",
                "phone",
                "person"
              ],
              "enumTitles": [
                "E-mail",
                "CNPJ (incl. alphanumeric)",
                "CPF",
                "PIS/PASEP/NIS",
                "Credit card (Luhn-validated)",
                "IBAN",
                "RG (with \"RG\" label)",
                "IP address",
                "License plate (BR)",
                "CEP (BR postal code)",
                "Phone",
                "Person name (AI)"
              ]
            },
            "default": [
              "email",
              "cnpj",
              "cpf",
              "pis",
              "credit_card",
              "iban",
              "rg",
              "ip_address",
              "license_plate",
              "cep",
              "phone"
            ]
          },
          "detectNames": {
            "title": "Detect person names (AI)",
            "type": "boolean",
            "description": "Find person names with a small language model (Portuguese and English). Slower, and names are harder than documents: some may be missed or over-detected.",
            "default": true
          },
          "namesLanguage": {
            "title": "Language for names",
            "enum": [
              "auto",
              "pt",
              "en"
            ],
            "type": "string",
            "description": "Language model used for names.",
            "default": "auto"
          },
          "fields": {
            "title": "Only these fields",
            "type": "array",
            "description": "For JSON records and datasets: only process these keys (dot paths like contact.email). Empty = all fields.",
            "items": {
              "type": "string"
            }
          },
          "hashSecret": {
            "title": "Hash secret",
            "type": "string",
            "description": "Secret key for the hash method. Use the same secret in every run to get the same tokens. Without it, a random secret is used per run."
          },
          "includeEntities": {
            "title": "Return positions of findings",
            "type": "boolean",
            "description": "Add _piiEntities with type, field and character positions (never the original value).",
            "default": false
          },
          "addSummary": {
            "title": "Add _pii summary to each record",
            "type": "boolean",
            "description": "Add a _pii field with the number of findings per type.",
            "default": true
          },
          "maxRecords": {
            "title": "Max records",
            "minimum": 0,
            "type": "integer",
            "description": "Stop after N records (0 = no limit).",
            "default": 0
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}