Authentication
Batch Format (Preferred)
Submit multiple corrections in a single request. Each correction references either a placeholder from the sanitize response or raw text for missed entities.| Field | Type | Required | Description |
|---|---|---|---|
session_id | string | Yes | Session ID from the sanitize response |
corrections | array | Yes | Array of correction objects (max 50) |
corrections[].placeholder | string | Conditional | Reference to [TYPE_N] placeholder. Required for misclassification and false_positive |
corrections[].span_text | string | Conditional | Raw text span. Required for missed_entity |
corrections[].correct_type | string | Conditional | What the entity should be classified as. Required for misclassification and missed_entity |
corrections[].feedback_type | string | Yes | misclassification, false_positive, missed_entity, or wrong_type |
Example Request
Example Response
Response Fields
| Field | Type | Description |
|---|---|---|
accepted | integer | Number of corrections accepted |
correction_ids | array | IDs assigned to each correction |
contradictions_detected | integer | Number of contradictions found against previous corrections |
message | string | Human-readable summary |
status | string | Always "recorded" |
Contradiction detection is automatic. When you correct an entity in one direction (e.g., PHONE_NUMBER to NPI) and a previous correction went the other way (NPI to PHONE_NUMBER), the system detects this as a contradiction and creates an insight. Check GET /v1/insights for details and resolution options.
Feedback Types
| Type | When to Use | Required Fields |
|---|---|---|
misclassification | Entity was detected but classified as the wrong type | placeholder + correct_type |
wrong_type | Alias for misclassification | placeholder + correct_type |
missed_entity | System failed to detect an entity | span_text + correct_type |
false_positive | System flagged something that is not PII | placeholder |
Legacy Single-Correction Format
The original single-correction format is still supported for backwards compatibility.| Field | Type | Required | Description |
|---|---|---|---|
session_id | string | Yes | Session ID from the sanitize response |
feedback_type | string | Yes | wrong_type, missed_entity, false_positive, or misclassification |
text_snippet | string | Yes | The text span being corrected |
expected_type | string | No | What the entity should be classified as |
Legacy Example
SDK Example
Errors
| Code | HTTP Status | Description |
|---|---|---|
invalid_api_key | 401 | API key is missing or invalid |
session_not_found | 404 | Session ID doesn’t exist or has expired |
rate_limited | 429 | Too many requests |

