v1

latestOpenAPI 3.0.02026-07-1731030.6 KB
Redaction

Redact sensitive information from text

Analyzes text and redacts sensitive information such as SSNs, emails, phone numbers, and other PII. Supports custom entity types and optional PDF file processing.

post/api/redact

Request body

textstring required

The text content to be analyzed and redacted

entitiesstring[]

Optional array of custom entity types to redact. If not provided, defaults to standard PII entities (SSNs, emails, phone numbers, etc.)

rewriteboolean

When true, naturally rewrite content to remove sensitive information instead of using placeholders. For example, 'Contact me at john@example.com' becomes 'Contact me via email' instead of 'Contact me at <EMAIL_REDACTED>'.

Example request

{
  "text": "My email is john@example.com and SSN is 123-45-6789",
  "entities": [
    "Email Addresses",
    "Social Security Numbers",
    "API Keys"
  ]
}

Response

Successfully redacted the text or PDF

idstring uuid

Unique identifier for this request

modelstring

Model used for redaction

redacted_pdfstring

Optional base64-encoded PDF data URL. Present when a file was provided and format='json' (or format not specified). Contains the redacted PDF in base64 format.

Example response

{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "model": "superagent-lm-redact-20b",
  "choices": [
    {
      "message": {
        "role": "assistant",
        "content": "My email is <EMAIL_REDACTED> and SSN is <SSN_REDACTED>"
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 150,
    "completion_tokens": 50,
    "total_tokens": 200
  },
  "redacted_pdf": "data:application/pdf;base64,JVBERi0xLjQKJeLjz9M..."
}
All 3 operations