POST /v1/rehydrate

Restore original PII to a sanitized response.

POSThttps://api.ambientmeta.com/v1/rehydrate

Request Body

FieldTypeRequiredDescription
textstringYesText containing placeholders to restore
session_idstringYesSession ID from sanitize response

Example Request

curl -X POST https://api.ambientmeta.com/v1/rehydrate \
  -H "Authorization: Bearer am_live_xxx" \
  -H "Content-Type: application/json" \
  -d '{"text": "I will contact [PERSON_1] at [EMAIL_1] tomorrow.", "session_id": "ses_a1b2c3d4e5f6"}'

Response

FieldTypeDescription
textstringText with original entities restored
entities_restoredintegerNumber of placeholders replaced
processing_msintegerProcessing time in milliseconds

Example Response

{
  "text": "I will contact John Smith at john@acme.com tomorrow.",
  "entities_restored": 2,
  "processing_ms": 3
}

Session Expiry

Sessions expire after 24 hours. If you call rehydrate with an expired session, you'll receive a session_expired error. Re-sanitize the original text to create a new session.

Errors

CodeHTTP StatusDescription
session_not_found404Session ID doesn't exist
session_expired410Session has expired (24 hour limit)
invalid_api_key401API key is missing or invalid

View all error codes →