Tools › Entity types

Identity and government IDs

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.

Try it on the live API No signup. 2,000 characters, 20 runs per 10 minutes.
Output appears here.

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

Redact passport numbers in production

Get an API key and send your first request in a minute. Plans start at $24/month.

See pricing