# Mask Bulgarian EGN, IBAN and phone numbers in text

**Use case:** 

Find and mask Bulgarian personal numbers (EGN, validated by date and check digit), Bulgarian IBANs, phone numbers and e-mails in Cyrillic or Latin text. The sample text is made up.

## Input

```json
{
  "texts": [
    "Клиент: Иван Примерен, ЕГН 8001010008, тел. 0888 123 456, e-mail ivan@example.com. Сметка: IBAN BG80 BNBG 9661 1020 3456 78. Номер на поръчка 1234567890."
  ],
  "urls": [],
  "inlineDocuments": [],
  "entities": [
    "EMAIL",
    "PHONE",
    "IBAN",
    "PAYMENT_CARD",
    "BG_EGN",
    "NATIONAL_ID",
    "IP_ADDRESS",
    "SECRET"
  ],
  "customTerms": [
    "Иван Примерен"
  ],
  "mode": "mask",
  "includeDetails": true,
  "includeOriginalValues": false,
  "removeHeadersFooters": false,
  "maxPagesPerDocument": 200,
  "maxFileSizeMb": 25
}
```

## Output

```json
{
  "source": {
    "label": "Source",
    "format": "string"
  },
  "status": {
    "label": "Status",
    "format": "string"
  },
  "format": {
    "label": "Format",
    "format": "string"
  },
  "totalFindings": {
    "label": "Findings",
    "format": "integer"
  },
  "findings": {
    "label": "By type",
    "format": "object"
  },
  "warnings": {
    "label": "Warnings",
    "format": "array"
  },
  "error": {
    "label": "Error",
    "format": "string"
  },
  "redactedText": {
    "label": "Redacted text",
    "format": "string"
  }
}
```

## How it works

### 1. Sign up on Apify or log in

The PII Redactor for GDPR & LLM Pipelines Actor is ready to run with the inputs already set for "Mask Bulgarian EGN, IBAN and phone numbers in text". [Sign up or log in](https://console.apify.com/create-task-from-example/GqrczNld1aIpusM7p) and you'll land in Apify Console with a copy of this exact task.

### 2. Start the "Mask Bulgarian EGN, IBAN and phone numbers in text" task

The PII Redactor for GDPR & LLM Pipelines Actor will start running based on the input automatically. You can also change all the input fields, like texts, document urls, and more, to match your specific use case.

### 3. Receive the "Mask Bulgarian EGN, IBAN and phone numbers in text" output

Monitor the progress in real time. You will be notified as soon as your dataset is complete and ready for review. Each result includes data such as source, status, format, and more.

### 4. Integrate into your workflow

The final output is delivered in JSON, CSV, or Excel format, ready to be plugged into your workflow. You can also [run the "Mask Bulgarian EGN, IBAN and phone numbers in text" task via API](https://apify.com/praised_tumbler/pii-redactor-eu-gdpr.md).

## FAQ

### Is my data sent to an external AI service?

No. Everything runs inside the Actor on the Apify platform; no external AI, OCR or redaction API is called.

### Why is the order number in the sample not masked?

Because it is not a valid EGN: the birth date and the check digit must match. Only real-looking personal numbers are masked.

### Does it work on PDF and DOCX?

Yes. Give links in "urls" or upload files in "inlineDocuments"; the redacted text is returned.

## About this Actor

This example demonstrates how to use [PII Redactor for GDPR & LLM Pipelines](https://apify.com/praised_tumbler/pii-redactor-eu-gdpr.md) with a specific input configuration. Visit the [Actor detail page](https://apify.com/praised_tumbler/pii-redactor-eu-gdpr.md) to learn more, explore other use cases, and run it yourself.


## How to integrate an Actor?

This Task's input is already configured above. Use it as-is rather than inventing a new one.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For full API examples (JavaScript, Python, CLI, MCP, OpenAPI), see this Task's Actor page: https://apify.com/praised_tumbler/pii-redactor-eu-gdpr.md

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).
