Tools › Entity types

Contact details

Redact postal codes from text, JSON, and CSV

Postal codes rarely identify anyone alone, but combined with a date of birth they narrow a population to a handful of people. Treat them as quasi-identifiers rather than harmless metadata.

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

How Redactly detects postal codes

  • Reported when the model flags the value, or when a postcode appears directly after a cue such as postcode or ZIP; the regex then expands the match to the full code.
  • Recognises US 5-digit and ZIP+4 forms, UK alphanumeric postcodes, and four-digit European codes.
  • Longer digit strings such as account numbers are not truncated into a postcode match.

Why redact postal codes?

Postal code is one of the classic quasi-identifiers used to re-identify supposedly anonymous records.

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": "Postcode: BS8 4QA, delivery window 09:00-12:00.", "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 postal codes automatically?

Yes. Send text to the API and every detected type is redacted, including postal codes. To redact only this type, pass the value contact.postal_code in the entities filter. No training or configuration is required.

What happens to postal codes after redaction?

With style set to replace, each match becomes [contact.postal_code] — 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 postal codes in production

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

See pricing