API Documentation
Integrate ANOXY's privacy-preserving text anonymization into your applications with our simple REST API.
Quick Start
Get your API key
Sign up at dashboard and create an API key.
Make your first request
Use the /v1/anonymize endpoint to start protecting sensitive data.
Restore original text
Use the same session ID with /v1/deanonymize to get back the original text.
Authentication
All API requests require authentication. ANOXY supports two authentication methods:
API Key
Include your API key in the X-API-Key header. Create keys in your dashboard.
X-API-Key: YOUR_API_KEYJWT Bearer Token
For SSO and OAuth integrations, pass a JWT token in the Authorization header. Tokens are issued by ANOXY's identity provider.
Authorization: Bearer eyJhbGciOiJSUzI1NiIs.../v1/anonymizeAnonymize text by detecting and replacing personal information (PII) with consistent tokens.
Request Body
textstringrequiredThe text to anonymize.
languagestringoptionalLanguage code (e.g., "en", "pl"). Defaults to "en".
session_idstringoptionalCustom session ID. If not provided, one will be generated.
Example Request
curl -X POST https://test.anoxy.ai/v1/anonymize \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"text": "John Smith lives at 123 Main St, New York. His email is john@example.com.",
"language": "en",
"session_id": "optional-session-id"
}'Example Response
{
"session_id": "abc-123-def-456",
"anonymized_text": "<PERSON_1> lives at <LOCATION_1>. His email is <EMAIL_1>.",
"entities_found": [
{
"entity_type": "PERSON",
"start": 0,
"end": 10,
"text": "John Smith",
"anonymized_token": "<PERSON_1>"
},
{
"entity_type": "LOCATION",
"start": 20,
"end": 42,
"text": "123 Main St, New York",
"anonymized_token": "<LOCATION_1>"
},
{
"entity_type": "EMAIL_ADDRESS",
"start": 57,
"end": 76,
"text": "john@example.com",
"anonymized_token": "<EMAIL_1>"
}
],
"quota_used": 1250,
"quota_remaining": 8750,
"processing_time_ms": 45.2
}/v1/deanonymizeRestore the original text using the session mapping. Requires a valid session ID from a previous anonymization.
Request Body
textstringrequiredThe anonymized text to restore.
session_idstringrequiredThe session ID from the anonymization request.
Example Request
curl -X POST https://test.anoxy.ai/v1/deanonymize \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"text": "<PERSON_1> lives at <LOCATION_1>. His email is <EMAIL_1>.",
"session_id": "your-session-id"
}'Example Response
{
"original_text": "John Smith lives at 123 Main St, New York. His email is john@example.com.",
"session_id": "abc-123-def-456",
"processing_time_ms": 12.4
}/v1/detectDetect PII entities in text without anonymizing. Returns entity locations, types, and confidence scores while preserving the original text.
Request Body
textstringrequiredThe text to scan for PII entities.
languagestringoptionalLanguage code (e.g., "en", "pl"). Defaults to "en".
entity_typesstring[] | stringoptionalFilter specific entity types. Accepts a JSON array or comma-separated string (e.g., "PERSON,EMAIL_ADDRESS").
Example Request
curl -X POST https://test.anoxy.ai/v1/detect \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"text": "John Smith lives at 123 Main St. Email: john@example.com",
"language": "en"
}'Example Response
{
"status": "success",
"data": {
"text": "John Smith lives at 123 Main St. Email: john@example.com",
"entities_found": [
{"entity_type": "PERSON", "start": 0, "end": 10, "text": "John Smith", "score": 0.95},
{"entity_type": "LOCATION", "start": 20, "end": 31, "text": "123 Main St", "score": 0.88},
{"entity_type": "EMAIL_ADDRESS", "start": 40, "end": 56, "text": "john@example.com", "score": 0.99}
],
"entity_summary": {"PERSON": 1, "LOCATION": 1, "EMAIL_ADDRESS": 1}
}
}/v1/documents/uploadUpload a document file for anonymization. Supports PDF, DOCX, XLSX, CSV, PPTX, images (OCR), and 10+ more formats. Returns a job ID for downloading the result.
Request Body
Content-Type: multipart/form-data
filebinaryrequiredThe document file to anonymize (max 50 MB).
modestringoptionalAnonymization mode: "anonymize" (default, irreversible) or "pseudonymize" (reversible with session).
languagestringoptionalLanguage code (e.g., "en", "pl"). Defaults to "en".
Example Request
curl -X POST https://test.anoxy.ai/v1/documents/upload \
-H "X-API-Key: YOUR_API_KEY" \
-F "file=@contract.pdf" \
-F "mode=anonymize" \
-F "language=en"Supported Formats
Example Response
{
"status": "success",
"data": {
"job_id": "550e8400-e29b-41d4-a716-446655440000",
"filename": "contract_anonymized.pdf",
"entities_count": 23,
"processing_time_ms": 1250.5,
"download_url": "/v1/history/550e8400.../download"
}
}Response Format
All API responses follow a consistent JSON envelope structure. Success responses wrap data in a "data" field, error responses provide a structured error object.
Success
{
"status": "success",
"data": { ... },
"meta": {
"version": "4.10.10",
"processing_time_ms": 45.2
}
}Error
{
"status": "error",
"error": {
"type": "validation_error",
"message": "Text is required."
}
}Endpoint Catalog
Complete list of available API endpoints.
| Method | Endpoint | Description | Auth |
|---|---|---|---|
| POST | /v1/anonymize | Anonymize text, replacing PII with tokens | Required |
| POST | /v1/deanonymize | Restore original text using session mapping | Required |
| POST | /v1/detect | Detect PII entities without anonymizing | Required |
| POST | /v1/documents/upload | Upload and anonymize a document file | Required |
| POST | /v1/text/anonymize-batch | Anonymize up to 20 text items in one request | Required |
| GET | /v1/countries | List supported countries and entity types | None |
| GET | /v1/history | List anonymization history (paginated, sortable) | Required |
| GET | /v1/history/{job_id} | Get job detail with entity breakdown | Required |
| GET | /v1/history/{job_id}/download | Download anonymized result file | Required |
| POST | /v1/history/batch-delete | Batch delete jobs | Required |
| GET | /v1/quota | Check current quota usage and limits | Required |
| GET | /v1/api-keys | List your API keys | Required |
| POST | /v1/api-keys | Create a new API key | Required |
| DELETE | /v1/api-keys/{id} | Revoke an API key | Required |
| GET | /v1/billing/subscription | Get current subscription details | Required |
| GET | /health | Health check endpoint | None |
Error Codes
400 Bad RequestInvalid request parameters or malformed JSON.
401 UnauthorizedMissing or invalid API key.
402 Payment RequiredQuota exceeded. Upgrade your plan or wait for quota reset.
404 Not FoundSession not found or expired (for deanonymization).
429 Too Many RequestsRate limit exceeded. Check the X-RateLimit-Reset header for when to retry.
500 Internal Server ErrorServer error. Please try again or contact support.
Rate Limits
Rate limits vary by plan:
- Free: 10 requests/minute, 1,000 tokens/month
- Pro: 100 requests/minute, 100,000 tokens/month
- Team: 1,000 requests/minute, 1,000,000 tokens/month
- Enterprise: 1,000 requests/minute, unlimited tokens
Rate Limit Headers
Every authenticated response includes rate limit headers:
X-RateLimit-LimitMaximum number of requests allowed per minute for your plan.
X-RateLimit-RemainingNumber of requests remaining in the current window.
X-RateLimit-ResetUnix timestamp (seconds) when the rate limit window resets.
HTTP/1.1 200 OK
X-RateLimit-Limit: 100
X-RateLimit-Remaining: 87
X-RateLimit-Reset: 1707523260