API Documentation
Clean AI Prompts makes it simple to de-identify and re-identify sensitive data in text. Send your content via API, get it back with semantic placeholders, then re-identify when needed.
Send text and receive it back with sensitive data replaced by semantic placeholders
curl -X POST $NEXT_PUBLIC_API_BASE/v1/text/deidentify \
-H "X-API-Key: your-api-key-here" \
-H "Content-Type: application/json" \
-d '{
"text": "Subject: Account Update\n\nDear John A. Example,\n\nWe need to verify your account.\nAccount Number: 12345678\nEmail: john@example.com\nPhone: +44 20 7946 0958"
}'{
"deidentified": "Subject: Account Update\n\nDear {{person_abc123...}},\n\nWe need to verify your account.\nAccount Number: {{account_number_def456...}}\nEmail: {{email_address_ghi789...}}\nPhone: {{phone_number_jkl012...}}",
"mapping": {
"{{person_abc123...}}": "John A. Example",
"{{account_number_def456...}}": "12345678",
"{{email_address_ghi789...}}": "john@example.com",
"{{phone_number_jkl012...}}": "+44 20 7946 0958"
}
}Send the de-identified text with placeholders to restore original values
curl -X POST $NEXT_PUBLIC_API_BASE/v1/text/reidentify \
-H "X-API-Key: your-api-key-here" \
-H "Content-Type: application/json" \
-d '{
"text": "Subject: Account Update\n\nDear {{person_abc123...}},\n\nWe need to verify your account.\nAccount Number: {{account_number_def456...}}\nEmail: {{email_address_ghi789...}}\nPhone: {{phone_number_jkl012...}}",
"mapping": {
"{{person_abc123...}}": "John A. Example",
"{{account_number_def456...}}": "12345678",
"{{email_address_ghi789...}}": "john@example.com",
"{{phone_number_jkl012...}}": "+44 20 7946 0958"
}
}'{
"reidentified": "Subject: Account Update\n\nDear John A. Example,\n\nWe need to verify your account.\nAccount Number: 12345678\nEmail: john@example.com\nPhone: +44 20 7946 0958"
}Choose how sensitive data is anonymized: replace, hash, or redact
Replaces PII with semantic placeholders (e.g., {{full_name_abc123...}}). Reversible with mapping.
{
"text": "My email is john@example.com",
"method": "replace"
}Replaces PII with SHA-256 hash values (e.g., <HASHED_abc123...>). Reversible with mapping.
{
"text": "My email is john@example.com",
"method": "hash"
}Removes PII completely (e.g., <REDACTED>). Not reversible.
{
"text": "My email is john@example.com",
"method": "redact"
}When you de-identify text, the mapping is stored securely. To re-identify, simply send the de-identified text with placeholders. The API automatically retrieves the original values from your secure vault.
curl -X POST $NEXT_PUBLIC_API_BASE/v1/text/reidentify \
-H "X-API-Key: your-api-key-here" \
-H "Content-Type: application/json" \
-d '{
"text": "Dear {{person_abc123...}}, your account {{account_number_def456...}}..."
}'The API automatically looks up mappings from your vault - no need to send the mapping manually.
Start protecting sensitive data in your AI applications today. Learn more about how it works and explore use cases on our homepage.