Redact national ID numbers from text, JSON, and CSV
National identifiers differ in length and format from country to country, which is why this type combines a model pass with a context cue rather than a single regex.
How Redactly detects national ID numbers
- Detected from a national-ID cue such as national ID, NIN, DNI, or 身份证, followed by the value.
- No country-specific format is assumed: the label supplies the meaning and the value is captured as written.
- A value after a passport, licence, or tax cue is reported under that type instead.
Why redact national ID numbers?
National IDs anchor identity in most jurisdictions and are the primary key in identity-fraud databases.
Example request
curl -X POST https://api.bitbanger.in/v1/redact \
-H "X-API-Key: rdct_your_key_here" \
-H "Content-Type: application/json" \
-d '{"text": "KYC completed, national ID 1234 5678 9012 verified.", "style": "replace"}'
Every hit in the response carries entity, text, start, and end. The offsets index into the text you sent, so you can apply the redactions to your own copy of the document. The full response schema is in the API reference.
Questions
Does Redactly redact national ID numbers automatically?
Yes. Send text to the API and every detected type is redacted, including national ID numbers. To redact only this type, pass the value identity.national_id in the entities filter. No training or configuration is required.
What happens to national ID numbers after redaction?
With style set to replace, each match becomes [identity.national_id] — the entity type in square brackets. Setting style to mask replaces every character with a block character, and remove deletes the span entirely.
Related entity types
- Social Security numbersRedact US Social Security numbers in 3-2-4 format from text, JSON, and CSV. Format-matched, with no model dependency.
- Passport numbersRedact passport numbers from travel documents, onboarding packets, and KYC notes.
- Tax identification numbersRedact TINs, EINs, and equivalent tax identifiers from invoices, payroll files, and vendor records.
Redact national ID numbers in production
Get an API key and send your first request in a minute. Plans start at $24/month.
See pricing