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.
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
- Street addressesRedact postal addresses from free text and structured payloads, including partial street names the model only half-captures.
- Dates of birthRedact dates of birth in numeric, ISO, and written month formats from text and tabular data.
- GPS coordinatesRedact latitude and longitude pairs from delivery records, field-service notes, and mobile telemetry.
Redact postal codes in production
Get an API key and send your first request in a minute. Plans start at $24/month.
See pricing