Przejdź do treści

API Documentation

Integrate ANOXY's privacy-preserving text anonymization into your applications with our simple REST API.

Quick Start

1

Get your API key

Sign up at dashboard and create an API key.

2

Make your first request

Use the /v1/anonymize endpoint to start protecting sensitive data.

3

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_KEY

JWT 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...
POST/v1/anonymize

Anonymize text by detecting and replacing personal information (PII) with consistent tokens.

Request Body

textstringrequired

The text to anonymize.

languagestringoptional

Language code (e.g., "en", "pl"). Defaults to "en".

session_idstringoptional

Custom 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
}
POST/v1/deanonymize

Restore the original text using the session mapping. Requires a valid session ID from a previous anonymization.

Request Body

textstringrequired

The anonymized text to restore.

session_idstringrequired

The 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
}
POST/v1/detect

Detect PII entities in text without anonymizing. Returns entity locations, types, and confidence scores while preserving the original text.

Request Body

textstringrequired

The text to scan for PII entities.

languagestringoptional

Language code (e.g., "en", "pl"). Defaults to "en".

entity_typesstring[] | stringoptional

Filter 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}
  }
}
POST/v1/documents/upload

Upload 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

filebinaryrequired

The document file to anonymize (max 50 MB).

modestringoptional

Anonymization mode: "anonymize" (default, irreversible) or "pseudonymize" (reversible with session).

languagestringoptional

Language 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

PDFDOCXXLSXCSVPPTXRTFHTMLTXTXMLJSONEMLMDPNGJPGTIFFBMP

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.

MethodEndpointDescriptionAuth
POST/v1/anonymizeAnonymize text, replacing PII with tokensRequired
POST/v1/deanonymizeRestore original text using session mappingRequired
POST/v1/detectDetect PII entities without anonymizingRequired
POST/v1/documents/uploadUpload and anonymize a document fileRequired
POST/v1/text/anonymize-batchAnonymize up to 20 text items in one requestRequired
GET/v1/countriesList supported countries and entity typesNone
GET/v1/historyList anonymization history (paginated, sortable)Required
GET/v1/history/{job_id}Get job detail with entity breakdownRequired
GET/v1/history/{job_id}/downloadDownload anonymized result fileRequired
POST/v1/history/batch-deleteBatch delete jobsRequired
GET/v1/quotaCheck current quota usage and limitsRequired
GET/v1/api-keysList your API keysRequired
POST/v1/api-keysCreate a new API keyRequired
DELETE/v1/api-keys/{id}Revoke an API keyRequired
GET/v1/billing/subscriptionGet current subscription detailsRequired
GET/healthHealth check endpointNone

Error Codes

400 Bad Request

Invalid request parameters or malformed JSON.

401 Unauthorized

Missing or invalid API key.

402 Payment Required

Quota exceeded. Upgrade your plan or wait for quota reset.

404 Not Found

Session not found or expired (for deanonymization).

429 Too Many Requests

Rate limit exceeded. Check the X-RateLimit-Reset header for when to retry.

500 Internal Server Error

Server 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-Limit

Maximum number of requests allowed per minute for your plan.

X-RateLimit-Remaining

Number of requests remaining in the current window.

X-RateLimit-Reset

Unix 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

Need Help?

Our team is here to support your integration.

v4.13.111 (dev)API Documentation | ANOXY