For the complete documentation index, see llms.txt. This page is also available as Markdown.

v1/scrub

Redact personal or sensitive information from a payload. Set the redaction style with the redactionStyle query parameter and control which elements are redacted with the body fields below.

Scrub

post

Redact personal or sensitive information from any given payload

Authorizations
x-api-keystringRequired
Query parameters
redactionStylestring · enumOptional

Redaction style applied to every match. Case-insensitive; an unrecognized value falls back to class. class (default) replaces with the entity label, e.g. . class_numbered uses numbered labels, e.g. <email_1>, and identical values share a number. empty drops the matched value. masked replaces characters with *. encrypted uses AES-SIV and is reversible; it requires the key parameter. tokenized produces format-preserving tokens for email, IPv4, IPv6, MAC, and phone; all other elements fall back to .

Default: classPossible values:
keystringOptional

Encryption key used when redactionStyle=encrypted. Must be 32, 48, or 64 bytes. Required for encrypted, ignored otherwise.

Body
contentstringOptional

Content you would like to scrub personal and sensitive information from

Default: Hi, my name is John Doe, you can reach me on john.doe@gmail.com
filtersstring[]Optional

Allow-list of data element labels to redact. If omitted, every supported element is redacted.

excludeFiltersstring[]Optional

Deny-list of data element labels to skip. Takes precedence over filters.

useMLbooleanOptional

Enable ML-based detection in addition to rules. Defaults to true.

Default: true
treatAsJSONbooleanOptional

Treat content as a JSON string: classify only inside string values and preserve structure so the output still parses. Use for JSON payloads.

Default: false
Responses
200

200

application/json
post/v1/scrub
POST /v1/scrub HTTP/1.1
Host: api.scanner.demo-001.teleskope.ai
x-api-key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 183

{
  "content": "Hi, my name is John Doe, you can reach me on john.doe@gmail.com",
  "filters": [
    "text"
  ],
  "excludeFilters": [
    "text"
  ],
  "sensitivityLevels": [
    "low"
  ],
  "useML": true,
  "treatAsJSON": false
}
{
  "content": "Hi, my name is <FIRST_NAME> <LAST_NAME>, you can reach me on <EMAIL>",
  "classifications": [
    {
      "index": 0,
      "class": "FIRST_NAME",
      "startByte": 15,
      "byteSize": 4,
      "startChar": 15,
      "charSize": 4,
      "version": 2,
      "category": [
        "PERSONAL"
      ]
    },
    {
      "index": 1,
      "class": "LAST_NAME",
      "startByte": 20,
      "byteSize": 3,
      "startChar": 20,
      "charSize": 3,
      "version": 2,
      "category": [
        "PERSONAL"
      ]
    },
    {
      "index": 2,
      "class": "EMAIL",
      "startByte": 45,
      "byteSize": 18,
      "startChar": 45,
      "charSize": 18,
      "version": 2,
      "category": [
        "PERSONAL"
      ]
    }
  ]
}

Redaction styles

Set ?redactionStyle= on the request. The value is case-insensitive, and an unrecognized value falls back to class. See Redaction Methodologies for the underlying methods.

Style
Result

class

Replaces the value with its entity label, e.g. <EMAIL>. Default.

class_numbered

Numbered labels, e.g. <email_1>. Identical values share a number.

empty

Drops the matched value.

masked

Replaces characters with *.

encrypted

AES-SIV, reversible. Always pass a key (32, 48, or 64 bytes) — it is not enforced, and output produced without one cannot be decrypted.

tokenized

Format-preserving tokens for email, IPv4, IPv6, MAC, and phone. All other elements fall back to <CLASS>.

Body options

Field
Type
Description

content

string

Text to scrub. Required.

filters

string[]

Allow-list of element labels to redact. Omit to redact every supported element.

excludeFilters

string[]

Deny-list of element labels to skip. Takes precedence over filters.

sensitivityLevels

string[]

Restrict redaction to these tiers: low, medium, high, critical. Elements with no assigned tier are always included.

useML

boolean

Enable ML-based detection in addition to rules. Defaults to true.

treatAsJSON

boolean

Treat content as a JSON string: classify only inside string values and preserve structure so the output still parses. Use for JSON payloads.

Last updated

Was this helpful?