Superagent LogoSuperagent
REST API

Redact API

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

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

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"
}