API Integration
The anonym.legal API is a RESTful web service that detects and anonymizes personally identifiable information in text, files, and payloads. It applies 5 auditable operators — replace, redact, mask, hash, and encrypt — with deterministic, reproducible results.
Authentication
JWT-based authentication
Secure your API requests with JWT tokens. Available on Basic plan and above.
RESTful API
Simple HTTP endpoints
Standard JSON request/response format for easy integration into any stack.
Rate Limiting
Token-based quotas
Usage is metered by tokens with clear quotas and upgrade paths.
Base URL
Endpoints
/presidio/analyzeAnalyze text to detect PII entities
Request Body:
{
"text": "John Smith's email is john@example.com",
"language": "en",
"entities": ["PERSON", "EMAIL_ADDRESS"],
"score_threshold": 0.5
}/presidio/anonymizeAnonymize text based on analyzer results
Request Body:
{
"text": "John Smith's email is john@example.com",
"analyzer_results": [...],
"operators": {
"PERSON": { "type": "replace", "new_value": "<PERSON>" },
"EMAIL_ADDRESS": { "type": "redact" }
}
}/presidio/batchAnalyze multiple texts in a single request (Basic plan required)
Request Body:
{
"texts": ["Text 1", "Text 2", "Text 3"],
"language": "en",
"entities": ["PERSON", "EMAIL_ADDRESS"],
"score_threshold": 0.5
}Authentication
All API requests require authentication using a JWT token in the Authorization header:
Authorization: Bearer YOUR_JWT_TOKEN
Obtain your JWT token by signing in to your account. API access is available with Basic plan and above.
Error Responses
401 UnauthorizedInvalid or missing authentication token
402 Payment RequiredInsufficient tokens. Top up or upgrade your plan.
429 Too Many RequestsRate limit exceeded. Try again later.