---
title: "Redact Indian personal identifiers"
method: POST
path: "/v1/text/redact"
tags: ["Text tools"]
---

# Redact Indian personal identifiers

`POST /v1/text/redact`

## Request

- Base URL: `https://api.dharun.dev`
- URL: `https://api.dharun.dev/v1/text/redact`
- Auth: none declared

Masks Aadhaar numbers (Verhoeff-checked), PAN, GSTIN (checksum-checked), card numbers (Luhn-checked), Indian mobile numbers, email addresses, UPI IDs, vehicle numbers, voter IDs, passport numbers and IP addresses. Returns where each was found, never the values. With names=true a model also masks people's names: IndicNER for Indian scripts, bert-base-NER for English. Street addresses are not detected.

## Query parameters

- `types` string
- `style` 'label' | 'partial'
- `names` 'true' | 'false'

## Request body

- object
  - `names` 'true' | 'false': true also finds people's names with a model (slower; text up to 20,000 characters). Default false.
  - `style` 'label' | 'partial': label replaces with [PAN]; partial keeps the last digits, as on a bank statement. Default label.
  - `text` string, required: The text to redact.
  - `types` string: Comma-separated kinds to redact; default all. Kinds: email, upi, gstin, card, aadhaar, pan, phone, vehicle, voter_id, passport, ip.

## Response `200`

Success

- Envelope
  - `data` unknown, required
  - `meta` object, required
    - `limit` integer
    - `note` string
    - `offset` integer
    - `source` object: Where the data came from and the credit its licence asks for.
      - `attribution` string
      - `licence` string
      - `name` string
      - `retrieved` string
      - `url` string
      - `version` string
    - `total` integer

## Other responses

- `400`: Error
- `404`: Error
- `429`: Error

---

[API](https://skmtc.dev/dharun/apis/india-api-free-open-source-apis-for-indian-data.md) · [All operations](https://skmtc.dev/dharun/apis/india-api-free-open-source-apis-for-indian-data/llms.txt) · [OpenAPI document](https://skmtc.dev/dharun/apis/india-api-free-open-source-apis-for-indian-data/revisions/ecd8b0ec7863?raw)
