POST /v1/rehydrate
Restore original PII to a sanitized response.
POSThttps://api.ambientmeta.com/v1/rehydrate
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
text | string | Yes | Text containing placeholders to restore |
session_id | string | Yes | Session 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
| Field | Type | Description |
|---|---|---|
text | string | Text with original entities restored |
entities_restored | integer | Number of placeholders replaced |
processing_ms | integer | Processing 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
| Code | HTTP Status | Description |
|---|---|---|
session_not_found | 404 | Session ID doesn't exist |
session_expired | 410 | Session has expired (24 hour limit) |
invalid_api_key | 401 | API key is missing or invalid |