API reference

The Redactly API detects and redacts personally identifiable information in text, JSON, and CSV. Every request is authenticated with an API key and returns the redacted output together with the entities that were found.

Updated 26 October 2026

Base URL

https://api.bitbanger.in

Authentication

Every redaction endpoint requires an API key in the X-API-Key header. Keys start with rdct_. They are shown once at creation and only a SHA-256 hash is stored server-side, so a lost key has to be replaced rather than recovered.

X-API-Key: rdct_your_key_here

A missing, invalid, or revoked key returns 401.

POST /v1/redact

Redact PII from a string. The response contains the original text, the redacted text, the entity list with character spans and confidence scores, and a count.

Request body

FieldTypeRequiredDefaultDescription
textstringyes—Text to redact. Must not be empty.
stylestringnoreplaceOne of replace, mask, or remove.
thresholdnumberno0.5Minimum confidence between 0 and 1. Raise it for precision, lower it for recall.
entitiesstring[]noall typesRestrict detection to specific entity labels, for example ["PERSON","EMAIL"].
webhook_urlURLno—If set, the result is also POSTed to this URL after redaction.

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": "Call John Smith at 555-867-5309 or [email protected]",
    "style": "replace",
    "threshold": 0.5
  }'

Response

{
  "original": "Call John Smith at 555-867-5309 or [email protected]",
  "redacted": "Call [PERSON] at [PHONE] or [EMAIL]",
  "entities": [
    {
      "entity": "PERSON",
      "text": "John Smith",
      "start": 5,
      "end": 15,
      "score": 0.998
    }
  ],
  "entity_count": 3
}
FieldTypeDescription
originalstringThe input text, unchanged.
redactedstringThe same text with detected spans transformed by the chosen style.
entitiesarrayOne object per hit: entity, text, start, end, score.
entity_countintegerNumber of entities redacted.

POST /v1/redact/file

Redact a .json or .csv upload and get a redacted file back. JSON is walked recursively so every string value at any depth is redacted; CSV is redacted cell by cell with the structure preserved.

Form fields

FieldTypeRequiredDefaultDescription
filefileyes—A .json or .csv file. Other extensions return 422.
stylestringnoreplacereplace, mask, or remove.
thresholdnumberno0.5Minimum confidence between 0 and 1.

Example request

curl -X POST https://api.bitbanger.in/v1/redact/file \
  -H "X-API-Key: rdct_your_key_here" \
  -F "[email protected]" \
  -F "style=mask" \
  -F "threshold=0.6" \
  --output customers_redacted.csv

The response is a file download. JSON input returns application/json with the suffix _redacted.json; CSV input returns text/csv.

GET /health

Returns the service status and the identifier of the detector build currently loaded. The identifier is opaque and changes when the detector is upgraded; treat it as a version string rather than a product name. Useful for uptime checks before you send traffic.

curl https://api.bitbanger.in/health

{"status":"ok","model":"redactly-pii-encoder-v1"}

Redaction styles

StyleOutputUse when
replaceJohn Smith becomes [PERSON]You need to keep the document readable or show it to an analyst.
maskReplaced with block characters matching the original lengthYou want to preserve layout and character counts.
removeDeleted entirelyYou want the shortest possible output with no trace of the value.

Entity types

Redactly detects 30+ entity types out of the box, grouped into personal identifiers (names, usernames, dates of birth), contact details (emails, phone numbers, addresses), financial data (card numbers, IBANs, bank accounts), government identifiers (SSNs, passport and driver's licence numbers), digital identifiers (IP and MAC addresses), and medical data (record and health plan numbers).

Use the entities field on /v1/redact to restrict a request to specific labels.

Errors

StatusCause
401Missing, invalid, or revoked API key.
422Empty text, an unsupported file extension, or malformed JSON or CSV.
503The model is still loading. Retry shortly.

Machine-readable versions