Everything you need to integrate Anonymization API into your applications. Comprehensive guides, detailed endpoint references, code examples, and best practices for protecting sensitive data at scale.
Find exactly what you need. Our documentation is organized to help both newcomers and experienced developers.
All API requests require authentication using an API key. Your key should be kept secret and never exposed in client-side code.
Authentication with the Anonymization API is done via API keys passed in the request header. Every account can create multiple API keys for different environments or applications, and keys can be revoked at any time without affecting other keys.
Header Format: Include your API key in the Authorization header using the Bearer token format. Never embed your API key directly in URLs or client-side code where it could be exposed.
Environment Variables: We recommend storing your API key in an environment variable rather than hardcoding it. This makes it easy to use different keys for development, staging, and production without code changes.
Key Rotation: Regularly rotate your API keys as a security best practice. You can create a new key, update your applications, then delete the old key without any service interruption.
Authorization: Bearer your_api_key_here
Content-Type: application/json
Our RESTful API provides endpoints for text anonymization, entity detection, batch processing, and more. All endpoints accept and return JSON.
The primary endpoint for anonymizing text. Detects sensitive entities and applies the specified anonymization technique (redact, mask, pseudonymize, or generalize). Supports plain text, JSON, and structured data formats.
| Parameter | Type | Required | Description |
|---|---|---|---|
| text | string | Required | The text content to anonymize. Maximum 100KB per request. |
| mode | string | Optional | Anonymization mode: "redact", "mask", "pseudonymize", "generalize". Default: "redact" |
| entity_types | array | Optional | Array of entity types to detect. Default: all supported types. |
| language | string | Optional | ISO 639-1 language code. Default: auto-detect. |
| return_entities | boolean | Optional | Include detected entities in response. Default: true |
curl -X POST https://api.anonymizationapi.com/v2/anonymize \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "text": "Contact John Smith at [email protected] or 555-123-4567", "mode": "redact", "entity_types": ["PERSON", "EMAIL", "PHONE"] }'
{
"anonymized_text": "Contact [PERSON] at [EMAIL] or [PHONE]",
"entities": [
{
"type": "PERSON",
"text": "John Smith",
"start": 8,
"end": 18,
"confidence": 0.98
},
{
"type": "EMAIL",
"text": "[email protected]",
"start": 22,
"end": 42,
"confidence": 0.99
},
{
"type": "PHONE",
"text": "555-123-4567",
"start": 46,
"end": 58,
"confidence": 0.97
}
],
"processing_time_ms": 47,
"model_version": "2.1.0"
}
Detect sensitive entities in text without modifying the content. Useful for analysis, auditing, or when you want to handle anonymization yourself. Returns detailed information about each detected entity including position, type, and classification detail.
| Parameter | Type | Required | Description |
|---|---|---|---|
| text | string | Required | The text content to analyze for sensitive entities. |
| entity_types | array | Optional | Specific entity types to detect. Default: all types. |
| min_confidence | float | Optional | Minimum confidence threshold (0.0-1.0). Default: 0.7 |
Process multiple texts in a single request for improved efficiency. Ideal for bulk processing scenarios. Accepts up to 100 texts per request and returns results in the same order. More cost-effective than individual requests for large volumes.
| Parameter | Type | Required | Description |
|---|---|---|---|
| items | array | Required | Array of objects, each containing text and optional per-item settings. |
| default_mode | string | Optional | Default anonymization mode for all items. Default: "redact" |
Our AI models detect over 70 types of sensitive data across personal identifiers, financial information, healthcare records, and more. Here are the most commonly used entity types.
The API uses standard HTTP response codes to indicate success or failure. All error responses include a JSON body with additional details.
{
"error": {
"code": "INVALID_PARAMETER",
"message": "The 'text' parameter is required",
"details": {
"parameter": "text",
"reason": "missing"
}
},
"request_id": "req_abc123xyz"
}
Rate limits protect the API from abuse and ensure fair access for all users. Limits vary by plan and are applied per API key. When you exceed a limit, you'll receive a 429 response with a Retry-After header indicating when to retry.
Free Tier: 60 requests per minute, 1,000 requests per month. Ideal for testing and development.
Professional: 300 requests per minute, 50,000 requests per month. Suitable for production applications with moderate traffic.
Enterprise: Custom rate limits based on your needs. Contact us for dedicated infrastructure with no hard limits.
Monitoring Usage: Check the X-RateLimit-Remaining and X-RateLimit-Reset headers in every response to track your usage and avoid hitting limits.
Get your API key and start protecting sensitive data in minutes. Free tier available with 1,000 requests per month.