Snipget.ai

Redact phone numbers from text

Exact
phone_redact

Deterministic and authoritative — the canonical answer for this input.

Mask a phone number, keeping the last `keep_last` digits visible. Works with any format — punctuation is preserved; only digits are masked. Input with no digits at all has nothing to mask and passes through unchanged with `phone_shaped: false` at reduced confidence (0.5), so a no-op is never silent. Processing multiple inputs? Use `phone_redact_batch` to do up to 1000 in one call.

Parameters

valuestringrequired

Phone number to redact.

keep_lastintegeroptional

Call it

curl -X POST https://api.snipget.ai/v1/phone/redact \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{"value":"555-123-4567","keep_last":4}'

The Batch tab sends up to 1000 inputs in one call via /v1/phone/redact/batch.

Example response

{
  "input": "555-123-4567",
  "redacted": "***-***-4567",
  "phone_shaped": true
}

FAQ

Why use this instead of trimming the number myself?

It gives you the familiar 'last four digits' style every time, keeping whatever spaces, dashes, or parentheses were in the original so the masked number still reads like a phone number. Handy for confirmations, logs, and support views where you want the customer to recognize their number without exposing it.

Does it find phone numbers inside a sentence?

No. It masks the single phone number you pass in, it does not scan free text for numbers. Pass one number per call, or use the batch version for a column of numbers.

Is the result reliable and repeatable?

Yes. This is an exact, deterministic tool, so the same number always masks the same way. It is the authoritative result, and it is one-way: the masked version cannot be turned back into the full number.

Can I change how many digits stay visible?

Yes. The keep_last option sets how many trailing digits show (default 4). Set it to 0 to hide every digit.

What if the number is too short or empty?

It does not error. If the number has the same or fewer digits than keep_last, every digit is masked, and an empty value returns an empty string.

What if the value has no digits at all?

There is nothing to mask, so it passes through unchanged — and the result says so with phone_shaped false and reduced confidence (0.5), so you can catch values that were never phone numbers before logging them.

Related tools