Redact passport numbers from text, JSON, and CSV
Passport numbers have no universal format, so Redactly detects them from an explicit label such as Passport No: rather than from shape. That keeps precision high across issuing countries.
How Redactly detects passport numbers
- Detected by a context cue that pairs a passport label with the value that follows it.
- Works across issuing countries because no format is assumed.
- An expiry date is not part of the number, so it is left alone unless it is separately identified as a birth date.
Why redact passport numbers?
A passport number plus a name is enough to attempt identity verification fraud.
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": "Passport No: X1234567, expires 2031-04-18.", "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 passport numbers automatically?
Yes. Send text to the API and every detected type is redacted, including passport numbers. To redact only this type, pass the value identity.passport in the entities filter. No training or configuration is required.
What happens to passport numbers after redaction?
With style set to replace, each match becomes [identity.passport] — 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
- National ID numbersRedact national identity numbers such as NIN, DNI, PESEL, and similar government identifiers.
- Driver's licence numbersRedact driver's licence numbers from onboarding forms, insurance claims, and fleet records.
- Dates of birthRedact dates of birth in numeric, ISO, and written month formats from text and tabular data.
Redact passport numbers in production
Get an API key and send your first request in a minute. Plans start at $24/month.
See pricing