Redact phone numbers from text, JSON, and CSV
Phone numbers are hard to detect by regex alone: the same digit shapes appear in dates, order IDs, and account numbers. Redactly uses a model gate first and only then expands the match to the full number.
How Redactly detects phone numbers
- Reported when the model flags the value, or when a number follows a phone cue such as tel, mobile, or call; the regex layer then snaps the span to the complete number.
- Handles country codes, parentheses, and space, dot, or hyphen separators.
- Date-shaped and ID-shaped digit strings that the model does not flag are left alone.
Why redact phone numbers?
Phone numbers are a primary target for SIM-swap and smishing attacks against your customers.
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": "Phone: +1 202-555-0143, best reached after 6pm.", "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 phone numbers automatically?
Yes. Send text to the API and every detected type is redacted, including phone numbers. To redact only this type, pass the value contact.phone in the entities filter. No training or configuration is required.
What happens to phone numbers after redaction?
With style set to replace, each match becomes [contact.phone] — 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
- Email addressesRedact email addresses from text, JSON, and CSV with one HTTP call. Returns exact character offsets and keeps your structure intact.
- Street addressesRedact postal addresses from free text and structured payloads, including partial street names the model only half-captures.
- Postal codesRedact ZIP and postcode values in US 5-digit, ZIP+4, and UK formats from text and tabular data.
Redact phone numbers in production
Get an API key and send your first request in a minute. Plans start at $24/month.
See pricing