Skip to main content

Authentication

X-API-Key: am_live_your_key_here

Request Body

FieldTypeRequiredDescription
textstringYesText to sanitize (max 100KB)
modestringNo"sanitize" (default) or "redact". Redact mode permanently removes PII and returns session_id: null.
config.entitiesarrayNoEntity types to detect (default: all). See entity types below.
config.confidence_thresholdfloatNoMinimum confidence score to include a detection (default: 0.0)
config.custom_patternsbooleanNoInclude org’s custom patterns (default: false)
config.storage_overridesobjectNoPer-entity storage tier overrides (e.g., {"SSN": 1} for never-store)

Example Request

curl -X POST https://api.ambientmeta.com/v1/sanitize \
  -H "X-API-Key: am_live_xxx" \
  -H "Content-Type: application/json" \
  -d '{
    "text": "Email John Smith at john@acme.com about the NYC merger",
    "config": {"entities": ["PERSON", "EMAIL_ADDRESS", "LOCATION"]}
  }'

Response

FieldTypeDescription
sanitizedstringText with PII replaced by placeholders
session_idstring|nullID for rehydration (valid 24 hours). null when mode="redact".
redactedbooleantrue if redact mode was used
entities_foundintegerNumber of entities detected
entitiesarrayDetails of each detected entity (see below)
metadataobjectProcessing metadata including format_type and disambiguation_applied
processing_msfloatProcessing time in milliseconds

Entity Object

FieldTypeDescription
placeholderstringThe replacement token, e.g. [PERSON_1]
typestringEntity type (see Entity Types below)
confidencefloatDetection confidence score (0.0 to 1.0)
startintegerStart character offset in the original text
endintegerEnd character offset in the original text
structureobject|nullStructural context: region_type, label, line

Example Response

{
  "sanitized": "Email [PERSON_1] at [EMAIL_ADDRESS_1] about the [LOCATION_1] merger",
  "session_id": "ses_a1b2c3d4e5f6",
  "redacted": false,
  "entities_found": 3,
  "entities": [
    {
      "placeholder": "[PERSON_1]",
      "type": "PERSON",
      "confidence": 0.97,
      "start": 6,
      "end": 16,
      "structure": null
    },
    {
      "placeholder": "[EMAIL_ADDRESS_1]",
      "type": "EMAIL_ADDRESS",
      "confidence": 0.99,
      "start": 20,
      "end": 33,
      "structure": null
    },
    {
      "placeholder": "[LOCATION_1]",
      "type": "LOCATION",
      "confidence": 0.92,
      "start": 44,
      "end": 47,
      "structure": null
    }
  ],
  "metadata": {
    "format_type": "plain_prose",
    "disambiguation_applied": false
  },
  "processing_ms": 14.2
}

Redact Mode

Set mode: "redact" to permanently remove PII. Redacted responses cannot be rehydrated.
curl -X POST https://api.ambientmeta.com/v1/sanitize \
  -H "X-API-Key: am_live_xxx" \
  -H "Content-Type: application/json" \
  -d '{"text": "Email john@acme.com", "mode": "redact"}'
Response will have "session_id": null and "redacted": true.

Entity Types

TypeDescriptionDetectionExamples
PERSONNames of peopleNER + patternsJohn Smith, Dr. Jane Doe
EMAIL_ADDRESSEmail addressesRegex + validationjohn@acme.com
PHONE_NUMBERPhone numbersMulti-format regex(555) 123-4567
SSNSocial Security NumbersRegex + checksum123-45-6789
CREDIT_CARDCredit card numbersRegex + Luhn4532-1234-5678-9012
LOCATIONPlaces, citiesNERNYC, San Francisco
ADDRESSPhysical addressesRegex + NER123 Main St, Suite 200
NPINational Provider IdentifierRegex + Luhn (10-digit)1234567890
DEA_NUMBERDEA Registration NumberRegex + checksumAB1234567
MRNMedical Record NumberContext-aware regexMRN-12345678
EMAIL and PHONE are accepted as aliases for EMAIL_ADDRESS and PHONE_NUMBER in the config.entities array.

Errors

CodeHTTP StatusDescription
invalid_api_key401API key is missing or invalid
empty_text400Text field is empty
text_too_large413Text exceeds 100KB limit
rate_limited429Too many requests
View all error codes