Detect, replace, and restore personal data
Use the native text APIs for detection and reversible, consistent replacement.
Detect personal data
POST /v1/analyze accepts a single text or a texts array. Native offsets count Unicode code points, starting at zero; endIndex is exclusive.
| Parameter | Meaning |
|---|---|
text / texts | One string or an array of strings. Send one of these fields. |
tier | standard, batch or realtime |
model | shinrai-latest or shinrai-v1.3. Tier aliases may append -batch or -realtime. |
threshold | Confidence threshold from 0 to 1; default 0,7. |
merge_persons | Merge adjacent person findings; default true. |
GET /v1/models lists the models and API tiers available to your key. OpenAPI is the machine-readable native reference.
What is semantic encryption?
ShinrAI calls its context-preserving, reversible replacement semantic encryption. It is a form of pseudonymisation: sensitive values become useful alternatives, and your application can restore originals using its mapping.
Protect the mapping as sensitive data and keep it out of AI prompts. Realistic replacements do not mean every word is cryptographically encrypted or that the text is automatically anonymous.
Languages and data categories · Model changelog · Compare ShinrAI
Replace personal data and keep the mapping
POST /v1/redact returns transformed text. Choose replace for consistent realistic stand-ins, mask for masked characters, or label for entity labels such as [PERSON].
curl https://api.shinrai.innovius.io/v1/redact \
-H "Authorization: Bearer $SHINRAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"text":"Contact Emma at emma@example.com","mode":"replace"}'
Example output (simulated)
Simulated JSON excerpt for the command above. Your detections, replacement values and balance may differ.
{
"mode": "replace",
"tier": "standard",
"text": "Contact Nora at nora@example.net",
"mapping": {
"Emma": "Nora",
"emma@example.com": "nora@example.net"
},
"usage": {
"records": 1,
"weighted_records": 1.0,
"tier": "standard",
"balance_after": 9998.0
}
}Save the returned mapping securely in your application if you need restoration. Send known_replacements to reuse existing stand-ins across calls; reserved_replacements excludes values that must not be generated. mask_char controls masking and defaults to *.
Review detections against representative documents. Pseudonymized text and restoration mappings can remain sensitive data; do not treat transformation as a guarantee of anonymization.
Keep replacements consistent across a batch
Use POST /v1/redact/batch when several records belong to the same workflow. ShinrAI maintains one request-local replacement map and can reuse mappings supplied in known_replacements.
{"texts":["Emma owns the case.","Email Emma at emma@example.com"],"mode":"replace","include_mapping":true}
Returned mappings contain original values. Store them as sensitive application data and keep them out of model prompts.