{
  "openapi": "3.1.0",
  "info": {
    "title": "PII Redaction",
    "version": "1.0.0",
    "summary": "Find and redact names, emails, phone numbers, addresses, SSNs, card numbers and dates of birth in free text.",
    "description": "Detect and redact names, emails, phone numbers, addresses, SSNs, card numbers and dates of birth in free text, with the exact offsets of every value found.\n\nGenerated from the service's own TypeScript contract types, so this document describes what the API actually returns. Operated by EAC Ventures, LLC.\n\nSubscribe, including the free tier: https://rapidapi.com/aervik-labs-aervik-labs-default/api/pii-phi-redaction-detection-api\n\nKnown limits:\n- Seven types: person names, email addresses, phone numbers, physical addresses, Social Security Numbers (U.S.), credit card numbers and dates of birth. IP addresses, bank account or IBAN numbers, passport, driver’s license or other national ID numbers, API keys or other secrets, and health information are not detected.\n- A value the model misses is left in the text and is not reported, so a response with neither warnings nor unlocated_count is not proof the text is clean.\n- A dash-formatted SSN, a Luhn-valid card number, an ASCII email address or a North American phone number written with separators is also matched by pattern. Names, addresses and dates of birth are found by the model alone, and the phone pattern does not cover other countries’ formats.\n- One text per request, up to 50,000 UTF-16 code units. Offsets count UTF-16 code units and index the original text, not redacted_text.\n- No confidence scores, and one placeholder per type.\n- Accuracy on languages other than English has not been measured.\n- Text whose list of values is too long for one model reply fails with redaction_failed rather than returning a partial redaction.\n\nSources, freshness and live health: https://aerviklabs.com/sources.json (https://aerviklabs.com/data-sources/#pii-redaction). What we do when something cannot be established: https://aerviklabs.com/trust/\n\nThis OpenAPI document is available under the MIT License (Copyright (c) 2026 EAC Ventures, LLC). Use of the API itself is governed by its Terms of Service, not by that license.",
    "contact": {
      "name": "Aervik Labs",
      "url": "https://aerviklabs.com/about/"
    },
    "x-aervik-provenance": {
      "sources_json": "https://aerviklabs.com/sources.json",
      "data_sources_page": "https://aerviklabs.com/data-sources/#pii-redaction",
      "trust_page": "https://aerviklabs.com/trust/",
      "read_method": "input-only",
      "known_limits": [
        "Seven types: person names, email addresses, phone numbers, physical addresses, Social Security Numbers (U.S.), credit card numbers and dates of birth. IP addresses, bank account or IBAN numbers, passport, driver’s license or other national ID numbers, API keys or other secrets, and health information are not detected.",
        "A value the model misses is left in the text and is not reported, so a response with neither warnings nor unlocated_count is not proof the text is clean.",
        "A dash-formatted SSN, a Luhn-valid card number, an ASCII email address or a North American phone number written with separators is also matched by pattern. Names, addresses and dates of birth are found by the model alone, and the phone pattern does not cover other countries’ formats.",
        "One text per request, up to 50,000 UTF-16 code units. Offsets count UTF-16 code units and index the original text, not redacted_text.",
        "No confidence scores, and one placeholder per type.",
        "Accuracy on languages other than English has not been measured.",
        "Text whose list of values is too long for one model reply fails with redaction_failed rather than returning a partial redaction."
      ]
    },
    "termsOfService": "https://redact.aerviklabs.com/terms"
  },
  "externalDocs": {
    "description": "Product page",
    "url": "https://aerviklabs.com/apis/pii-redaction/"
  },
  "servers": [
    {
      "url": "https://pii-phi-redaction-detection-api.p.rapidapi.com",
      "description": "RapidAPI gateway"
    }
  ],
  "security": [
    {
      "RapidApiKey": []
    }
  ],
  "paths": {
    "/redact": {
      "post": {
        "operationId": "redactText",
        "summary": "Detect and redact seven types of personal data in free text",
        "parameters": [
          {
            "$ref": "#/components/parameters/RapidApiHost"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RedactResponse"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "405": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RedactRequest"
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "RapidApiKey": {
        "type": "apiKey",
        "in": "header",
        "name": "X-RapidAPI-Key",
        "description": "Your RapidAPI application key."
      }
    },
    "parameters": {
      "RapidApiHost": {
        "name": "X-RapidAPI-Host",
        "in": "header",
        "required": true,
        "schema": {
          "type": "string",
          "const": "pii-phi-redaction-detection-api.p.rapidapi.com"
        }
      }
    },
    "schemas": {
      "EntityType": {
        "type": "string",
        "enum": [
          "PERSON",
          "EMAIL",
          "PHONE",
          "ADDRESS",
          "SSN",
          "CREDIT_CARD",
          "DATE_OF_BIRTH"
        ]
      },
      "ErrorResponse": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string",
            "description": "Stable machine-readable code. redaction_failed (502) means no reliable redaction pass completed, for example because the model provider failed, timed out, rate limited, declined or stopped early, or returned a reply that could not be used; no partial result is ever returned, and a retry may succeed."
          },
          "message": {
            "type": "string",
            "description": "A plain-language explanation for humans, whose wording may change. It never contains any part of the submitted text."
          }
        },
        "required": [
          "error",
          "message"
        ],
        "description": "Every non-2xx JSON response from the API itself. `error` is a stable machine-readable code; `message` is for humans and may change. Codes this API can return: `input_too_large`, `invalid_json`, `method_not_allowed`, `missing_text`, `not_found`, `provider_misconfigured`, `redaction_failed`, `unauthorized`. RapidAPI answers authentication, subscription and rate-limit failures itself, in its own format."
      },
      "RedactionEntity": {
        "type": "object",
        "properties": {
          "type": {
            "$ref": "#/components/schemas/EntityType",
            "description": "One of the seven types this API detects: PERSON, EMAIL, PHONE, ADDRESS, SSN (a U.S. Social Security Number), CREDIT_CARD or DATE_OF_BIRTH; it does not detect health information. On a merged entity, the type of the longest detection that was merged."
          },
          "value": {
            "type": "string",
            "description": "The original, unredacted substring of the submitted text at start to end. It is the sensitive value itself, so scrub it before logging a raw response."
          },
          "start": {
            "type": "number",
            "description": "Start offset, inclusive, in UTF-16 code units into the original text, not redacted_text. In JavaScript, original.slice(start, end) === value."
          },
          "end": {
            "type": "number",
            "description": "End offset, exclusive, in UTF-16 code units into the original text, not redacted_text. In JavaScript, original.slice(start, end) === value."
          },
          "merged_types": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EntityType"
            },
            "description": "Present only when overlapping detections were merged into this one redaction: each distinct type that was merged, in the order the detections start in the text (the longer first when two start together). It can list a single type when the merged detections had the same type."
          }
        },
        "required": [
          "type",
          "value",
          "start",
          "end"
        ]
      },
      "RedactRequest": {
        "type": "object",
        "properties": {
          "text": {
            "type": "string",
            "description": "The text to scan: a non-empty string of up to 50,000 UTF-16 code units, which is its JavaScript string length, so an emoji can count as two. Longer text is refused with input_too_large, never truncated."
          }
        },
        "required": [
          "text"
        ]
      },
      "RedactResponse": {
        "type": "object",
        "properties": {
          "redacted_text": {
            "type": "string",
            "description": "The submitted text with each value in entities replaced by [REDACTED_<TYPE>] for that entity's type, and everything else unchanged. Placeholders change the text's length, so entity offsets index the original text, never this one."
          },
          "entities": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RedactionEntity"
            },
            "description": "Every redacted value, in ascending start order, with no two overlapping. An empty list means nothing was redacted, not that the text is clean."
          },
          "unlocated_count": {
            "type": "number",
            "description": "Present only when a value the model reported was NOT redacted: how many such values, counting values that could not be located in the text, verbatim or in another written form (letter case, whitespace, digit separators), and values reported under a type this API does not recognize that no other redaction covers. Treat any value here as text that still contains something sensitive."
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Present only when a value the model reported was NOT redacted: plain-language notes with counts and this API's type names only, never a detected value. Neither warnings nor unlocated_count present means every value the model reported was redacted, not that the text is clean: a value the model never reports is redacted only if the pattern floor matches it (dash-formatted SSNs, Luhn-valid 16-digit and 15-digit American Express card numbers, ASCII email addresses, and North American phone numbers written with separators)."
          }
        },
        "required": [
          "redacted_text",
          "entities"
        ]
      }
    }
  }
}
