Superagent LogoSuperagent
REST API

Redact API

Remove sensitive information (PII/PHI) from text using the Redact API

POST
/api/redact
AuthorizationBearer <token>

Bearer token authentication using your API key

In: header

textstring

The text content to be analyzed and redacted

entities?array<string>

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

rewrite?boolean

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>'.

Defaultfalse

Response Body

curl -X POST "https://app.superagent.sh/api/redact" \  -H "Content-Type: application/json" \  -d '{    "text": "My email is john@example.com and SSN is 123-45-6789"  }'

{
  "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>",
        "reasoning": "Redacted email address and social security number"
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 25,
    "completion_tokens": 12,
    "total_tokens": 37
  }
}

{
  "error": "Invalid text provided"
}

{
  "error": "API key missing"
}

{
  "error": "No subscription found"
}

{
  "error": "Team not found"
}

{
  "error": "Failed to analyze prompt"
}