{"openapi":"3.1.0","info":{"title":"ShinrAI PII API","version":"2.0.0-draft.3","summary":"Detect, protect and restore personal data in text, tables, JSON, transcripts, documents and media.","description":"Find personal data in text, tables, JSON, transcripts, pages and images, protect it\n(pseudonymise, mask, label, remove, or fill image regions) and restore it later.\n\nThe same contract serves the hosted API, an installation in your own cluster and the\noffline edition. Hosted and offline: send your key as `Authorization: Bearer <key>`.\nRead `GET /v2/capabilities` once at start: it lists the models, languages, input kinds,\nactions and limits this deployment serves.\n\nQuick start: `POST /v2/detect` with `{\"text\": \"...\"}`, or send a file as the body\n(`Content-Type: text/plain` or an image type) with options as query parameters.\n\nRules for every operation:\n- Unknown request fields answer 422 `validation_failed` with a JSON Pointer; options this\n  version does not implement answer 501 `capability_unavailable`.\n- Responses carry no originals unless the request asks for them (`output.include_text`,\n  `output.include: [mapping]`). Personal data is never a JSON key.\n- `processing.on_degraded: fail` (default) answers 503 `degraded_refused` when a requested\n  detection layer did not run. Failed requests are not charged.\n- Surrogates derive from a key per account (hosted) or per installation: the same value gets\n  the same surrogate for you, and a different one for everybody else.\n- Responses carry `Cache-Control: no-store`.\n","license":{"name":"Proprietary"}},"servers":[{"url":"https://api.shinrai.innovius.io","description":"Hosted API (Germany)"},{"url":"https://api-sbx.shinrai.innovius.io","description":"Hosted sandbox (test keys)"},{"url":"{base}","description":"Your own installation (in-cluster or offline)","variables":{"base":{"default":"http://localhost:8080"}}}],"security":[{"BearerApiKey":[]}],"paths":{"/v2/detect":{"post":{"tags":["Native PII API v2"],"operationId":"detect","summary":"Find entities with coordinates in 1 to 256 inputs","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"},{"$ref":"#/components/parameters/RequestId"},{"$ref":"#/components/parameters/Deadline"},{"$ref":"#/components/parameters/QLanguage"},{"$ref":"#/components/parameters/QModel"},{"$ref":"#/components/parameters/QTypes"},{"$ref":"#/components/parameters/QExclude"},{"$ref":"#/components/parameters/QTier"},{"$ref":"#/components/parameters/QOnDegraded"},{"$ref":"#/components/parameters/QGranularity"}],"requestBody":{"required":true,"description":"JSON, or the content itself (plain text or one image) with options as query parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DetectRequest"},"example":{"text":"Mail jane@example.org or call +49 30 1234567."}},"text/plain":{"schema":{"type":"string"},"example":"Mail jane@example.org or call +49 30 1234567."},"image/png":{"schema":{"type":"string","format":"binary"}},"image/jpeg":{"schema":{"type":"string","format":"binary"}},"image/bmp":{"schema":{"type":"string","format":"binary"}},"image/tiff":{"schema":{"type":"string","format":"binary"}},"image/webp":{"schema":{"type":"string","format":"binary"}}}},"responses":{"200":{"$ref":"#/components/responses/Result"},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"402":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"413":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"501":{"$ref":"#/components/responses/Error"},"503":{"$ref":"#/components/responses/Error"},"504":{"$ref":"#/components/responses/Error"}},"security":[{"BearerApiKey":[]}]}},"/v2/protect":{"post":{"tags":["Native PII API v2"],"operationId":"protect","summary":"Detect (or take caller spans), apply the policy, return outputs, mapping delta and restore table","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"},{"$ref":"#/components/parameters/RequestId"},{"$ref":"#/components/parameters/Deadline"},{"$ref":"#/components/parameters/QLanguage"},{"$ref":"#/components/parameters/QModel"},{"$ref":"#/components/parameters/QTypes"},{"$ref":"#/components/parameters/QExclude"},{"$ref":"#/components/parameters/QTier"},{"$ref":"#/components/parameters/QOnDegraded"},{"$ref":"#/components/parameters/QGranularity"},{"$ref":"#/components/parameters/QPreset"}],"requestBody":{"required":true,"description":"JSON, or the content itself (plain text or one image) with options as query parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProtectRequest"},"example":{"text":"Anna Weber, IBAN DE89 3704 0044 0532 0130 00","policy":{"preset":"pseudonymize"},"output":{"include":["entities","mapping"]}}},"text/plain":{"schema":{"type":"string"},"example":"Mail jane@example.org or call +49 30 1234567."},"image/png":{"schema":{"type":"string","format":"binary"}},"image/jpeg":{"schema":{"type":"string","format":"binary"}},"image/bmp":{"schema":{"type":"string","format":"binary"}},"image/tiff":{"schema":{"type":"string","format":"binary"}},"image/webp":{"schema":{"type":"string","format":"binary"}}}},"responses":{"200":{"$ref":"#/components/responses/ProtectResult"},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"402":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"410":{"$ref":"#/components/responses/Error"},"413":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"501":{"$ref":"#/components/responses/Error"},"503":{"$ref":"#/components/responses/Error"},"504":{"$ref":"#/components/responses/Error"}},"security":[{"BearerApiKey":[]}]}},"/v2/restore":{"post":{"tags":["Native PII API v2"],"operationId":"restore","summary":"Reference restore of text and JSON leaves (shinrai-restore/1); the conformance oracle","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestoreRequest"}}}},"responses":{"200":{"description":"Restored inputs. Not charged.","headers":{"Cache-Control":{"$ref":"#/components/headers/NoStore"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestoreResponse"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"410":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"501":{"$ref":"#/components/responses/Error"}},"security":[{"BearerApiKey":[]}]}},"/v2/restore-tables":{"post":{"tags":["Native PII API v2"],"operationId":"createRestoreTable","summary":"Compile a caller-held map into a restore table (no text processed; not charged)","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestoreTablesRequest"}}}},"responses":{"200":{"description":"Restore table for shinrai-restore/1.","headers":{"Cache-Control":{"$ref":"#/components/headers/NoStore"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestoreTable"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"501":{"$ref":"#/components/responses/Error"}},"security":[{"BearerApiKey":[]}]}},"/v2/replacements":{"post":{"tags":["Native PII API v2"],"operationId":"createReplacement","summary":"Mint one replacement for a caller-chosen value and type (bind rules apply; not charged)","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReplacementRequest"}}}},"responses":{"200":{"description":"The replacement and its mapping entry.","headers":{"Cache-Control":{"$ref":"#/components/headers/NoStore"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReplacementResponse"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"501":{"$ref":"#/components/responses/Error"}},"security":[{"BearerApiKey":[]}]}},"/v2/sessions":{"post":{"tags":["Native PII API v2"],"operationId":"createSession","summary":"Create a server-held map with a time to live (optional feature; see capabilities.sessions)","requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionCreate"}}}},"responses":{"201":{"description":"Session created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Session"}}}},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"501":{"$ref":"#/components/responses/Error"}},"security":[{"BearerApiKey":[]}]}},"/v2/sessions/{session_id}":{"parameters":[{"$ref":"#/components/parameters/SessionId"}],"get":{"tags":["Native PII API v2"],"operationId":"getSession","responses":{"200":{"description":"Session metadata. No originals.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Session"}}}},"404":{"$ref":"#/components/responses/Error"},"410":{"$ref":"#/components/responses/Error"},"501":{"$ref":"#/components/responses/Error"}},"security":[{"BearerApiKey":[]}]},"patch":{"tags":["Native PII API v2"],"operationId":"updateSession","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionPatch"}}}},"responses":{"200":{"description":"Updated session.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Session"}}}},"409":{"$ref":"#/components/responses/Error"},"410":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"501":{"$ref":"#/components/responses/Error"}},"security":[{"BearerApiKey":[]}]},"delete":{"tags":["Native PII API v2"],"operationId":"deleteSession","responses":{"204":{"description":"Deleted. The map is gone."},"404":{"$ref":"#/components/responses/Error"},"501":{"$ref":"#/components/responses/Error"}},"security":[{"BearerApiKey":[]}]}},"/v2/sessions/{session_id}/mapping":{"parameters":[{"$ref":"#/components/parameters/SessionId"}],"get":{"tags":["Native PII API v2"],"operationId":"exportSessionMapping","summary":"Export the map (scope mapping:read; contains originals)","responses":{"200":{"description":"Mapping entries.","headers":{"Cache-Control":{"$ref":"#/components/headers/NoStore"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MappingResult"}}}},"403":{"$ref":"#/components/responses/Error"},"410":{"$ref":"#/components/responses/Error"},"501":{"$ref":"#/components/responses/Error"}},"security":[{"BearerApiKey":[]}]}},"/v2/sessions/{session_id}/restore-table":{"parameters":[{"$ref":"#/components/parameters/SessionId"}],"get":{"tags":["Native PII API v2"],"operationId":"getSessionRestoreTable","summary":"Restore table of the session (scope mapping:restore)","parameters":[{"name":"direction","in":"query","schema":{"type":"string","enum":["restore","forward"],"default":"restore"}}],"responses":{"200":{"description":"Restore table.","headers":{"Cache-Control":{"$ref":"#/components/headers/NoStore"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestoreTable"}}}},"403":{"$ref":"#/components/responses/Error"},"410":{"$ref":"#/components/responses/Error"},"501":{"$ref":"#/components/responses/Error"}},"security":[{"BearerApiKey":[]}]}},"/v2/uploads":{"post":{"tags":["Native PII API v2"],"operationId":"createUpload","summary":"Upload a file for a job (encrypted at rest, deleted with the job or after its expiry)","requestBody":{"required":true,"content":{"application/octet-stream":{"schema":{"type":"string","contentMediaType":"application/octet-stream"}}}},"responses":{"201":{"description":"Upload stored.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Upload"}}}},"413":{"$ref":"#/components/responses/Error"},"415":{"$ref":"#/components/responses/Error"},"501":{"$ref":"#/components/responses/Error"}},"security":[{"BearerApiKey":[]}]}},"/v2/jobs":{"post":{"tags":["Native PII API v2"],"operationId":"createJob","summary":"Start a job (text batches, documents, images; audio and video as beta)","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobCreate"}}}},"responses":{"202":{"description":"Accepted. Poll Location or wait for the webhook.","headers":{"Location":{"schema":{"type":"string"}},"Retry-After":{"schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"}}}},"402":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"501":{"$ref":"#/components/responses/Error"}},"security":[{"BearerApiKey":[]}]},"get":{"tags":["Native PII API v2"],"operationId":"listJobs","parameters":[{"name":"status","in":"query","schema":{"type":"string","enum":["queued","running","succeeded","failed","cancelled"]}},{"name":"after","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"Jobs of the caller.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobList"}}}},"501":{"$ref":"#/components/responses/Error"}},"security":[{"BearerApiKey":[]}]}},"/v2/jobs/{job_id}":{"parameters":[{"$ref":"#/components/parameters/JobId"}],"get":{"tags":["Native PII API v2"],"operationId":"getJob","responses":{"200":{"description":"Job state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"}}}},"404":{"$ref":"#/components/responses/Error"},"501":{"$ref":"#/components/responses/Error"}},"security":[{"BearerApiKey":[]}]},"delete":{"tags":["Native PII API v2"],"operationId":"deleteJob","summary":"Delete the job, its uploads and its artifacts","responses":{"204":{"description":"Deleted."},"404":{"$ref":"#/components/responses/Error"},"501":{"$ref":"#/components/responses/Error"}},"security":[{"BearerApiKey":[]}]}},"/v2/jobs/{job_id}/cancel":{"parameters":[{"$ref":"#/components/parameters/JobId"}],"post":{"tags":["Native PII API v2"],"operationId":"cancelJob","responses":{"202":{"description":"Cancellation accepted. Completed parts stay billed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"}}}},"404":{"$ref":"#/components/responses/Error"},"501":{"$ref":"#/components/responses/Error"}},"security":[{"BearerApiKey":[]}]}},"/v2/jobs/{job_id}/artifacts/{name}":{"parameters":[{"$ref":"#/components/parameters/JobId"},{"name":"name","in":"path","required":true,"schema":{"type":"string","enum":["protected","entities","mapping","redaction_plan","transcript","audit"]}}],"get":{"tags":["Native PII API v2"],"operationId":"getJobArtifact","responses":{"200":{"description":"Artifact bytes (media type depends on the artifact).","headers":{"Cache-Control":{"$ref":"#/components/headers/NoStore"}},"content":{"application/octet-stream":{"schema":{"type":"string","contentMediaType":"application/octet-stream"}},"application/json":{"schema":{"type":"object"}}}},"404":{"$ref":"#/components/responses/Error"},"501":{"$ref":"#/components/responses/Error"}},"security":[{"BearerApiKey":[]}]}},"/v2/capabilities":{"get":{"tags":["Native PII API v2"],"operationId":"getCapabilities","security":[{"BearerApiKey":[]}],"summary":"What this deployment supports (ga, beta, upcoming, planned, unavailable per input kind and endpoint)","responses":{"200":{"description":"Capabilities.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Capabilities"}}}}}}},"/v2/types":{"get":{"tags":["Native PII API v2"],"operationId":"getTypes","security":[{"BearerApiKey":[]}],"summary":"Canonical taxonomy and the versioned vendor vocabularies","responses":{"200":{"description":"Types.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TypesResponse"}}}}}}},"/v2/usage":{"get":{"tags":["Native PII API v2"],"operationId":"getUsage","summary":"Metering state of the calling key (global and offline modes)","responses":{"200":{"description":"Usage.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsageResponse"}}}},"501":{"$ref":"#/components/responses/Error"}},"security":[{"BearerApiKey":[]}]}}},"components":{"schemas":{"Capabilities":{"$ref":"#/components/schemas/PiiV2Capabilities"},"DetectRequest":{"$ref":"#/components/schemas/PiiV2DetectRequest"},"ErrorResponse":{"$ref":"#/components/schemas/PiiV2ErrorResponse"},"Id":{"$ref":"#/components/schemas/PiiV2Id"},"Job":{"$ref":"#/components/schemas/PiiV2Job"},"JobCreate":{"$ref":"#/components/schemas/PiiV2JobCreate"},"JobList":{"$ref":"#/components/schemas/PiiV2JobList"},"MappingResult":{"$ref":"#/components/schemas/PiiV2MappingResult"},"ProtectRequest":{"$ref":"#/components/schemas/PiiV2ProtectRequest"},"ReplacementRequest":{"$ref":"#/components/schemas/PiiV2ReplacementRequest"},"ReplacementResponse":{"$ref":"#/components/schemas/PiiV2ReplacementResponse"},"RestoreRequest":{"$ref":"#/components/schemas/PiiV2RestoreRequest"},"RestoreResponse":{"$ref":"#/components/schemas/PiiV2RestoreResponse"},"RestoreTable":{"$ref":"#/components/schemas/PiiV2RestoreTable"},"RestoreTablesRequest":{"$ref":"#/components/schemas/PiiV2RestoreTablesRequest"},"Result":{"$ref":"#/components/schemas/PiiV2Result"},"Session":{"$ref":"#/components/schemas/PiiV2Session"},"SessionCreate":{"$ref":"#/components/schemas/PiiV2SessionCreate"},"SessionPatch":{"$ref":"#/components/schemas/PiiV2SessionPatch"},"TypesResponse":{"$ref":"#/components/schemas/PiiV2TypesResponse"},"Upload":{"$ref":"#/components/schemas/PiiV2Upload"},"UsageResponse":{"$ref":"#/components/schemas/PiiV2UsageResponse"},"PiiV2Id":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9._:/-]{0,127}$","description":"Caller or service identifier. Never PII."},"PiiV2Language":{"type":"string","pattern":"^(auto|[a-z]{2,3}(-[A-Za-z0-9]{2,8})*)$","description":"BCP 47 language tag (lower-case primary subtag) or auto."},"PiiV2OffsetUnit":{"type":"string","enum":["codepoint","utf16","utf8","grapheme"],"description":"Unit of span offsets. codepoint is the default and the metering unit."},"PiiV2EntityType":{"type":"string","pattern":"^[A-Z][A-Z0-9_]{0,63}$","description":"Canonical type in UPPER_SNAKE (engine label space)."},"PiiV2Probability":{"type":"number","minimum":0,"maximum":1},"PiiV2Span":{"type":"object","additionalProperties":false,"required":["start","end"],"properties":{"start":{"type":"integer","minimum":0},"end":{"type":"integer","minimum":0},"extra":{"type":"object","additionalProperties":false,"properties":{"utf16":{"$ref":"#/components/schemas/PiiV2Range"},"utf8":{"$ref":"#/components/schemas/PiiV2Range"},"grapheme":{"$ref":"#/components/schemas/PiiV2Range"},"codepoint":{"$ref":"#/components/schemas/PiiV2Range"}},"description":"The same span in the extra offset units the request asked for."}},"description":"Half-open [start, end) in the request's offset unit."},"PiiV2Range":{"type":"object","additionalProperties":false,"required":["start","end"],"properties":{"start":{"type":"integer","minimum":0},"end":{"type":"integer","minimum":0}}},"PiiV2Interval":{"type":"object","additionalProperties":false,"required":["t0","t1"],"properties":{"t0":{"type":"number","minimum":0},"t1":{"type":"number","minimum":0}},"description":"Time interval in the input's time unit."},"PiiV2Box":{"type":"object","additionalProperties":false,"required":["page","box"],"properties":{"page":{"type":"integer","minimum":1},"box":{"type":"array","items":{"type":"number"},"minItems":4,"maxItems":4,"description":"[x, y, width, height] in the input's box unit."},"t0":{"type":"number","minimum":0},"t1":{"type":"number","minimum":0}},"description":"Page or frame box; video boxes carry a time interval."},"PiiV2Cell":{"type":"object","additionalProperties":false,"required":["row","column"],"properties":{"row":{"type":"integer","minimum":0},"column":{"type":"string"}}},"PiiV2Coords":{"type":"object","additionalProperties":false,"properties":{"intervals":{"type":"array","items":{"$ref":"#/components/schemas/PiiV2Interval"}},"boxes":{"type":"array","items":{"$ref":"#/components/schemas/PiiV2Box"}},"cell":{"$ref":"#/components/schemas/PiiV2Cell"},"path":{"type":"string","description":"JSON Pointer (RFC 6901) into a json input."}},"description":"Where an entity sits in a non-text input (text plus coordinate atoms)."},"PiiV2KeyRef":{"type":"object","additionalProperties":false,"required":["ref"],"properties":{"ref":{"type":"string","pattern":"^(kms|vault|local):[A-Za-z0-9._/-]{1,200}$"}},"description":"Reference to key material held by the deployment. Key bytes never travel in a request."},"PiiV2Status":{"type":"string","enum":["ga","beta","upcoming","planned","unavailable"]},"PiiV2Detection":{"oneOf":[{"type":"object","additionalProperties":false,"required":["template"],"properties":{"template":{"$ref":"#/components/schemas/PiiV2Id"}}},{"$ref":"#/components/schemas/PiiV2DetectionOptions"}]},"PiiV2DetectionOptions":{"type":"object","additionalProperties":false,"properties":{"mode":{"type":"string","enum":["detect","provided","merge"],"default":"detect","description":"detect: the service finds entities. provided: only caller spans (no model call). merge: both."},"model":{"type":"string","pattern":"^(latest|v[0-9]+\\.[0-9]+)$","default":"latest"},"language":{"$ref":"#/components/schemas/PiiV2Language"},"types":{"type":"object","additionalProperties":false,"properties":{"include":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128}},"exclude":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128}},"vocabulary":{"type":"string","pattern":"^(canonical|azure:[0-9a-z.-]+|aws|google|presidio)$","default":"canonical"}}},"thresholds":{"type":"object","additionalProperties":false,"properties":{"default":{"$ref":"#/components/schemas/PiiV2Probability"},"per_type":{"type":"object","propertyNames":{"$ref":"#/components/schemas/PiiV2EntityType"},"additionalProperties":{"$ref":"#/components/schemas/PiiV2Probability"}},"per_language":{"type":"object","propertyNames":{"$ref":"#/components/schemas/PiiV2Language"},"additionalProperties":{"$ref":"#/components/schemas/PiiV2Probability"}}}},"recognizers":{"type":"object","additionalProperties":false,"properties":{"model":{"type":"boolean","default":true},"pattern":{"type":"boolean","default":true},"validated_identifiers":{"type":"boolean","default":true,"description":"Checksum-validated identifiers (IBAN, Luhn, SSN, DE tax id, VIN, ...)."},"bias_terms":{"type":"boolean","default":false},"carrier":{"type":"array","items":{"type":"string","enum":["face","license_plate","signature","voice"]},"description":"Carrier PII in media. Planned."}}},"validation":{"type":"string","enum":["strict","off"],"default":"strict"},"exclude_values":{"type":"object","additionalProperties":false,"required":["values"],"properties":{"values":{"type":"array","items":{"type":"string","minLength":1}},"case_sensitive":{"type":"boolean","default":false}}},"context_terms":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["type","terms"],"properties":{"type":{"$ref":"#/components/schemas/PiiV2EntityType"},"terms":{"type":"array","items":{"type":"string","minLength":1}},"language":{"$ref":"#/components/schemas/PiiV2Language"}}}},"custom":{"type":"object","additionalProperties":false,"properties":{"user_values":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["value"],"properties":{"value":{"type":"string","minLength":1},"label":{"type":"string","maxLength":128},"type":{"$ref":"#/components/schemas/PiiV2EntityType"}}}},"regex":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["name","type","pattern"],"properties":{"name":{"type":"string","maxLength":128},"type":{"$ref":"#/components/schemas/PiiV2EntityType"},"pattern":{"type":"string","maxLength":1024,"description":"RE2 syntax; evaluated with a time budget."},"score":{"$ref":"#/components/schemas/PiiV2Probability"},"hotwords":{"type":"object","additionalProperties":false,"properties":{"terms":{"type":"array","items":{"type":"string"}},"window":{"type":"integer","minimum":1,"maximum":200},"boost":{"type":"number"}}},"exclusions":{"type":"array","items":{"type":"string","maxLength":1024}}}}},"dictionaries":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["name","type"],"properties":{"name":{"type":"string","maxLength":128},"type":{"$ref":"#/components/schemas/PiiV2EntityType"},"terms":{"type":"array","items":{"type":"string","minLength":1}},"ref":{"type":"string","pattern":"^stored:[A-Za-z0-9._-]{1,128}$"}}}},"zero_shot":{"type":"object","additionalProperties":false,"required":["labels"],"properties":{"labels":{"type":"array","minItems":1,"maxItems":32,"items":{"type":"string","minLength":1,"maxLength":64}},"threshold":{"$ref":"#/components/schemas/PiiV2Probability"}}}}},"spans":{"type":"object","additionalProperties":false,"properties":{"merge_persons":{"type":"boolean","default":true},"complete":{"type":"boolean","default":true},"complete_names":{"type":"boolean","default":true,"description":"Protect every occurrence of a detected value in the batch."},"sweep_repeats":{"type":"boolean","default":true},"segment":{"type":"string","enum":["auto","sentence","none"],"default":"auto","description":"How the model reads long texts: `auto` (whole text up to 1,200 characters, above that also per sentence), `sentence` (always per sentence as well), `none` (whole text only)."}}},"engine_options":{"type":"object","additionalProperties":false,"description":"Reserved for operator tuning; answers 403 forbidden_scope for API keys.","properties":{"reflow":{"type":"boolean"},"recall_floor":{"$ref":"#/components/schemas/PiiV2Probability"},"decoder_settings":{"type":"object"}}},"ocr":{"type":"object","additionalProperties":false,"description":"Options of the packaged OCR for image inputs.","properties":{"languages":{"type":"array","minItems":1,"maxItems":4,"uniqueItems":true,"items":{"$ref":"#/components/schemas/PiiV2Language"},"description":"OCR language packs (BCP 47 primary subtags). Default: the input or detection language plus English when a pack exists for it, else the deployment's fallback set (default de and en). capabilities.ocr.languages lists the provisioned packs. A pack the deployment does not provision answers 422."},"min_confidence":{"type":"integer","minimum":0,"maximum":100,"default":0,"description":"Drop OCR words below this recogniser confidence. 0 keeps every word."},"layout":{"type":"string","enum":["block","auto","line"],"default":"block","description":"block: one uniform text block (screenshots, forms). auto: automatic page segmentation (scans with columns). line: a single text line."}}}}},"PiiV2Entity":{"type":"object","additionalProperties":false,"required":["id","type","span","confidence","source"],"properties":{"id":{"$ref":"#/components/schemas/PiiV2Id"},"type":{"$ref":"#/components/schemas/PiiV2EntityType"},"subtype":{"type":"string","pattern":"^[A-Z][A-Z0-9_]{0,63}$","description":"Open refinement, for example US_SSN, DE_TAX_ID, VIN."},"vendor_type":{"type":"string","maxLength":128,"description":"Type in the requested vocabulary, when one was requested."},"span":{"$ref":"#/components/schemas/PiiV2Span"},"text":{"type":"string","description":"Present only when output.include_text is true."},"confidence":{"$ref":"#/components/schemas/PiiV2Probability"},"evidence":{"type":"string","enum":["argmax","floor"],"description":"Model entities only: argmax = the model's decision; floor = rescued by the recall floor, confidence is the entity mass. Treat floor spans by your own policy."},"tier":{"type":"string","pattern":"^[a-z][a-z_]{0,31}$","description":"How common the value is, for example names common|uncommon|rare, cities major|medium|small, organisations international|national|regional; std for format types. Model entities only."},"validated":{"type":"boolean","description":"A checksum or format validator accepted the value."},"source":{"type":"string","enum":["model","pattern","user_value","custom_regex","dictionary","zero_shot","known_value","name_completion","bias","carrier","provided"]},"detector":{"type":"string","maxLength":128},"attrs":{"type":"object","additionalProperties":false,"properties":{"origin":{"type":"string","maxLength":32},"gender_expression":{"type":"string","enum":["feminine","masculine","neutral","unknown"]},"name_part":{"type":"string","enum":["given","family","full","other"]}}},"coords":{"$ref":"#/components/schemas/PiiV2Coords"},"action":{"type":"string"},"replacement":{"type":"string"},"mapping_id":{"$ref":"#/components/schemas/PiiV2Id"},"output_span":{"$ref":"#/components/schemas/PiiV2Span"}}},"PiiV2ErrorCode":{"type":"string","enum":["unauthorized","insufficient_records","forbidden_scope","not_found","method_not_allowed","idempotency_conflict","mapping_conflict","session_expired","too_large","validation_failed","rate_limited","capability_unavailable","degraded_refused","backend_unavailable","deadline_exceeded","internal_error"]},"PiiV2ErrorResponse":{"type":"object","additionalProperties":false,"required":["error"],"properties":{"error":{"type":"object","additionalProperties":false,"required":["code","message","request_id","retryable"],"properties":{"code":{"$ref":"#/components/schemas/PiiV2ErrorCode"},"message":{"type":"string","maxLength":512,"description":"Human-readable. Never echoes input values."},"request_id":{"type":"string"},"retryable":{"type":"boolean"},"processing_started":{"type":"boolean"},"charged":{"type":"boolean"},"use":{"type":"string","description":"Alternative resource, for example /v2/jobs on too_large."},"details":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["pointer","reason"],"properties":{"pointer":{"type":"string","description":"JSON Pointer into the request."},"reason":{"type":"string","maxLength":256}}}}}}}},"PiiV2Input":{"oneOf":[{"$ref":"#/components/schemas/PiiV2TextInput"},{"$ref":"#/components/schemas/PiiV2TableInput"},{"$ref":"#/components/schemas/PiiV2JsonInput"},{"$ref":"#/components/schemas/PiiV2TranscriptInput"},{"$ref":"#/components/schemas/PiiV2PageInput"},{"$ref":"#/components/schemas/PiiV2ImageInput"},{"$ref":"#/components/schemas/PiiV2FileInput"},{"$ref":"#/components/schemas/PiiV2AudioInput"},{"$ref":"#/components/schemas/PiiV2VideoInput"}],"discriminator":{"propertyName":"kind"}},"PiiV2TextInput":{"type":"object","additionalProperties":false,"required":["kind","text"],"properties":{"id":{"$ref":"#/components/schemas/PiiV2Id"},"kind":{"const":"text"},"text":{"type":"string"},"language":{"$ref":"#/components/schemas/PiiV2Language"},"entities":{"type":"array","items":{"$ref":"#/components/schemas/PiiV2ProvidedEntity"}}}},"PiiV2ProvidedEntity":{"type":"object","additionalProperties":false,"required":["type","span"],"properties":{"type":{"$ref":"#/components/schemas/PiiV2EntityType"},"span":{"$ref":"#/components/schemas/PiiV2Span"},"confidence":{"$ref":"#/components/schemas/PiiV2Probability"},"vendor_type":{"type":"string","maxLength":128}},"description":"Caller spans for detection.mode provided or merge (for example Presidio analyzer_results)."},"PiiV2TableInput":{"type":"object","additionalProperties":false,"required":["kind","columns","rows"],"properties":{"id":{"$ref":"#/components/schemas/PiiV2Id"},"kind":{"const":"table"},"columns":{"type":"array","minItems":1,"items":{"type":"object","additionalProperties":false,"required":["name"],"properties":{"name":{"type":"string","minLength":1},"language":{"$ref":"#/components/schemas/PiiV2Language"}}}},"rows":{"type":"array","items":{"type":"array","items":{"type":["string","number","boolean","null"]}}},"language":{"$ref":"#/components/schemas/PiiV2Language"}}},"PiiV2JsonInput":{"type":"object","additionalProperties":false,"required":["kind","value"],"properties":{"id":{"$ref":"#/components/schemas/PiiV2Id"},"kind":{"const":"json"},"value":{},"include_keys":{"type":"boolean","default":false,"description":"Also inspect object keys. Keys are never used as map keys in the output."},"language":{"$ref":"#/components/schemas/PiiV2Language"}},"description":"Tool-call plane: every string leaf is inspected; entity coords carry a JSON Pointer."},"PiiV2TranscriptInput":{"type":"object","additionalProperties":false,"required":["kind","forms"],"properties":{"id":{"$ref":"#/components/schemas/PiiV2Id"},"kind":{"const":"transcript"},"speaker":{"type":"string","maxLength":64},"primary_form":{"type":"string","enum":["display","itn","masked_itn","lexical"],"default":"display"},"forms":{"type":"object","additionalProperties":false,"required":["display"],"properties":{"display":{"type":"string"},"itn":{"type":"string"},"masked_itn":{"type":"string"},"lexical":{"type":"string"}}},"atoms_form":{"type":"string","enum":["display","itn","masked_itn","lexical"],"default":"lexical"},"time_unit":{"type":"string","enum":["100ns","ms","s"],"default":"100ns"},"atoms":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["text","t0","t1"],"properties":{"text":{"type":"string"},"t0":{"type":"number","minimum":0},"t1":{"type":"number","minimum":0}}}},"language":{"$ref":"#/components/schemas/PiiV2Language"},"entities":{"type":"array","items":{"$ref":"#/components/schemas/PiiV2ProvidedEntity"},"description":"Caller spans on the primary form."}},"description":"Speech transcript with word timings (Azure conversation forms). redaction_plan.intervals maps entities to audio time."},"PiiV2PageInput":{"type":"object","additionalProperties":false,"required":["kind","text","atoms"],"properties":{"id":{"$ref":"#/components/schemas/PiiV2Id"},"kind":{"const":"page"},"text":{"type":"string"},"atoms":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["start","end","page","box"],"properties":{"start":{"type":"integer","minimum":0},"end":{"type":"integer","minimum":0},"page":{"type":"integer","minimum":1},"box":{"type":"array","items":{"type":"number"},"minItems":4,"maxItems":4}}},"description":"Word boxes of the text: each atom covers text[start:end] (code points, 0 <= start <= end <= len(text)) on a page, in box_unit. Entities get the boxes of every atom their span overlaps."},"box_unit":{"type":"string","enum":["pt","px","norm"],"default":"pt"},"language":{"$ref":"#/components/schemas/PiiV2Language"},"entities":{"type":"array","items":{"$ref":"#/components/schemas/PiiV2ProvidedEntity"}}},"description":"Extracted page text plus word boxes (OCR or PDF text layer)."},"PiiV2ImageInput":{"type":"object","additionalProperties":false,"required":["kind","media_type","data_b64"],"properties":{"id":{"$ref":"#/components/schemas/PiiV2Id"},"kind":{"const":"image"},"media_type":{"type":"string","enum":["image/png","image/jpeg","image/bmp","image/tiff","image/webp"]},"data_b64":{"type":"string","contentEncoding":"base64","maxLength":8388608,"description":"At most 6 MiB decoded and capabilities.ocr.max_pixels pixels (413 too_large above either). Recognition runs on a copy of at most capabilities.ocr.work_pixels; boxes and the protected image are in the source's pixels. Larger files use /v2/jobs."},"language":{"$ref":"#/components/schemas/PiiV2Language"}},"description":"A raster image; the service reads its text with the packaged OCR and answers synchronously with pixel boxes (box_unit px, page 1)."},"PiiV2FileInput":{"type":"object","additionalProperties":false,"required":["kind","source"],"properties":{"id":{"$ref":"#/components/schemas/PiiV2Id"},"kind":{"const":"file"},"source":{"$ref":"#/components/schemas/PiiV2Source"},"media_type":{"type":"string","maxLength":128},"language":{"$ref":"#/components/schemas/PiiV2Language"}},"description":"Jobs only. PDF, DOCX, images, audio and video."},"PiiV2Source":{"oneOf":[{"type":"object","additionalProperties":false,"required":["upload"],"properties":{"upload":{"$ref":"#/components/schemas/PiiV2Id"}}},{"type":"object","additionalProperties":false,"required":["s3"],"properties":{"s3":{"type":"object","additionalProperties":false,"required":["uri"],"properties":{"uri":{"type":"string","pattern":"^s3://"},"role_binding":{"type":"string"}}}}},{"type":"object","additionalProperties":false,"required":["azure_blob"],"properties":{"azure_blob":{"type":"object","additionalProperties":false,"required":["url"],"properties":{"url":{"type":"string","format":"uri"},"managed_identity_client_id":{"type":"string"}}}}},{"type":"object","additionalProperties":false,"required":["gcs"],"properties":{"gcs":{"type":"object","additionalProperties":false,"required":["uri"],"properties":{"uri":{"type":"string","pattern":"^gs://"}}}}},{"type":"object","additionalProperties":false,"required":["local"],"properties":{"local":{"type":"object","additionalProperties":false,"required":["mapping","path"],"properties":{"mapping":{"type":"string"},"path":{"type":"string"}}}}}]},"PiiV2AudioInput":{"type":"object","additionalProperties":false,"required":["kind","source"],"properties":{"id":{"$ref":"#/components/schemas/PiiV2Id"},"kind":{"const":"audio"},"source":{"$ref":"#/components/schemas/PiiV2Source"},"media_type":{"type":"string","maxLength":128},"language":{"$ref":"#/components/schemas/PiiV2Language"}},"description":"Served asynchronously by jobs where capabilities say so; /v2/detect and /v2/protect answer 501 capability_unavailable until capabilities list it."},"PiiV2VideoInput":{"type":"object","additionalProperties":false,"required":["kind","source"],"properties":{"id":{"$ref":"#/components/schemas/PiiV2Id"},"kind":{"const":"video"},"source":{"$ref":"#/components/schemas/PiiV2Source"},"media_type":{"type":"string","maxLength":128},"language":{"$ref":"#/components/schemas/PiiV2Language"}},"description":"Served asynchronously by jobs where capabilities say so; /v2/detect and /v2/protect answer 501 capability_unavailable until capabilities list it."},"PiiV2KnownEntry":{"type":"object","additionalProperties":false,"required":["original","replacement"],"properties":{"original":{"type":"string","minLength":1},"replacement":{"type":"string","minLength":1},"type":{"$ref":"#/components/schemas/PiiV2EntityType"}}},"PiiV2MappingBlock":{"type":"object","additionalProperties":false,"properties":{"consistency":{"type":"string","enum":["input","batch","session","account"],"default":"batch","description":"input: one map per input. batch: one map for the request; the next request draws new surrogates. session: the server-held map of `session`. account: a value keeps its surrogate across all requests of the account (explicit opt-in; it lets anyone with the key build an original-to-surrogate table by repetition). For consistency across requests prefer a session or `known`."},"session":{"$ref":"#/components/schemas/PiiV2Id"},"known":{"type":"array","maxItems":20000,"items":{"$ref":"#/components/schemas/PiiV2KnownEntry"},"description":"The caller's existing map: original, replacement and optional type per entry. Values here keep their replacement. PII is never a JSON key."},"reserved":{"type":"array","maxItems":20000,"items":{"type":"string","minLength":1},"description":"Replacements already in use; new ones avoid them."},"return":{"type":"string","enum":["delta","full","none"],"default":"delta"}}},"PiiV2Part":{"type":"object","additionalProperties":false,"required":["original","replacement","role"],"properties":{"original":{"type":"string"},"replacement":{"type":"string"},"role":{"type":"string","enum":["given","family","middle","particle","other"]}}},"PiiV2MappingEntry":{"type":"object","additionalProperties":false,"required":["id","type","original","replacement","reversible"],"properties":{"id":{"$ref":"#/components/schemas/PiiV2Id"},"type":{"$ref":"#/components/schemas/PiiV2EntityType"},"original":{"type":"string"},"replacement":{"type":"string"},"reversible":{"type":"boolean"},"fallback":{"type":"boolean","default":false,"description":"True when a bind rule failed and an opaque fixed-width token was used."},"parts":{"type":"array","items":{"$ref":"#/components/schemas/PiiV2Part"}}}},"PiiV2MappingResult":{"type":"object","additionalProperties":false,"required":["rev"],"properties":{"rev":{"type":"integer","minimum":0},"delta":{"type":"array","items":{"$ref":"#/components/schemas/PiiV2MappingEntry"}},"full":{"type":"array","items":{"$ref":"#/components/schemas/PiiV2MappingEntry"}},"unprotected":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["input_id","reason"],"properties":{"input_id":{"$ref":"#/components/schemas/PiiV2Id"},"reason":{"type":"string","enum":["policy_keep","not_detected_type","capability_unavailable"]}}}}}},"PiiV2Policy":{"oneOf":[{"type":"object","additionalProperties":false,"required":["template"],"properties":{"template":{"$ref":"#/components/schemas/PiiV2Id"}}},{"$ref":"#/components/schemas/PiiV2PolicyBody"}]},"PiiV2PolicyBody":{"type":"object","additionalProperties":false,"properties":{"preset":{"type":"string","enum":["pseudonymize","mask","label","strict","private-only","phi"],"default":"pseudonymize"},"default":{"$ref":"#/components/schemas/PiiV2StrictAction"},"rules":{"type":"array","items":{"$ref":"#/components/schemas/PiiV2Rule"}},"fields":{"type":"array","items":{"$ref":"#/components/schemas/PiiV2FieldRule"}},"media":{"type":"object","additionalProperties":false,"properties":{"image":{"type":"object","additionalProperties":false,"properties":{"op":{"const":"fill"},"color":{"type":"string","pattern":"^#[0-9A-Fa-f]{6}$","default":"#000000"},"all_text":{"type":"boolean","default":false},"pad_px":{"type":"integer","minimum":0,"maximum":16,"default":2}},"description":"How image inputs are protected: every entity whose text action is not keep is filled with color; all_text fills every recognised word; pad_px widens the fill only, never the reported boxes."},"audio":{"type":"object","additionalProperties":false,"properties":{"op":{"type":"string","enum":["silence","bleep"]},"pad_ms":{"type":"integer","minimum":0,"maximum":1000}}},"video":{"type":"object","additionalProperties":false,"properties":{"op":{"const":"track_fill"},"color":{"type":"string","pattern":"^#[0-9A-Fa-f]{6}$"}}}}}}},"PiiV2StrictAction":{"allOf":[{"$ref":"#/components/schemas/PiiV2Action"}],"unevaluatedProperties":false},"PiiV2Action":{"type":"object","required":["action"],"properties":{"action":{"type":"string","enum":["keep","mask","partial","label","surrogate","synthetic","generalize","hash","date_shift","bucket","time_part","dictionary","replace","remove","drop_row","crypto"]},"mask":{"type":"object","additionalProperties":false,"properties":{"char":{"type":"string","minLength":1,"maxLength":1},"keep_first":{"type":"integer","minimum":0},"keep_last":{"type":"integer","minimum":0},"count":{"type":"integer","minimum":0},"reverse":{"type":"boolean"},"ignore":{"type":"string","maxLength":64}}},"label":{"type":"object","additionalProperties":false,"properties":{"format":{"type":"string","maxLength":64,"default":"[{TYPE}_{n}]"},"numbering":{"type":"string","enum":["none","per_value","per_occurrence"],"default":"per_value"}}},"surrogate":{"type":"object","additionalProperties":false,"properties":{"realm":{"type":"string","enum":["preserve","neutralize"],"default":"preserve"},"arity":{"const":"same"},"preserve_format":{"type":"boolean","default":true},"valid_checksum":{"type":"boolean","default":true}}},"synthetic":{"type":"object","additionalProperties":false,"properties":{"preserve_format":{"type":"boolean","default":false}}},"generalize":{"type":"object","additionalProperties":false,"properties":{"level":{"type":"integer","minimum":1,"maximum":3}}},"hash":{"type":"object","additionalProperties":false,"required":["key"],"properties":{"alg":{"type":"string","enum":["hmac-sha256","hmac-sha512"],"default":"hmac-sha256"},"key":{"$ref":"#/components/schemas/PiiV2KeyRef"}}},"date_shift":{"type":"object","additionalProperties":false,"required":["min_days","max_days"],"properties":{"min_days":{"type":"integer","minimum":-36500,"maximum":36500},"max_days":{"type":"integer","minimum":-36500,"maximum":36500},"key":{"$ref":"#/components/schemas/PiiV2KeyRef"}}},"bucket":{"type":"object","additionalProperties":false,"required":["bounds"],"properties":{"bounds":{"type":"array","minItems":1,"items":{"type":"number"}},"labels":{"type":"array","items":{"type":"string"}}}},"time_part":{"type":"object","additionalProperties":false,"required":["part"],"properties":{"part":{"type":"string","enum":["year","month","day_of_month","day_of_week","week_of_year","hour_of_day"]}}},"dictionary":{"type":"object","additionalProperties":false,"required":["ref"],"properties":{"ref":{"type":"string","pattern":"^stored:[A-Za-z0-9._-]{1,128}$"}}},"replace":{"type":"object","additionalProperties":false,"required":["value"],"properties":{"value":{"type":"string","maxLength":256}}},"crypto":{"type":"object","description":"Planned (decision D13): format-preserving or deterministic encryption. Answers 501 today."}},"description":"Reversible actions: surrogate, and label with numbering per_value. Every other action is one-way."},"PiiV2Rule":{"allOf":[{"$ref":"#/components/schemas/PiiV2Action"}],"type":"object","required":["types","action"],"properties":{"types":{"type":"array","minItems":1,"items":{"type":"string","minLength":1,"maxLength":128}}},"unevaluatedProperties":false},"PiiV2FieldRule":{"oneOf":[{"allOf":[{"$ref":"#/components/schemas/PiiV2Action"}],"type":"object","required":["columns","action"],"properties":{"columns":{"type":"array","minItems":1,"items":{"type":"string"}},"when":{"$ref":"#/components/schemas/PiiV2Condition"}},"unevaluatedProperties":false},{"type":"object","additionalProperties":false,"required":["drop_row_when"],"properties":{"drop_row_when":{"$ref":"#/components/schemas/PiiV2Condition"}}}]},"PiiV2Condition":{"type":"object","additionalProperties":false,"required":["column","op"],"properties":{"column":{"type":"string"},"op":{"type":"string","enum":["eq","ne","lt","le","gt","ge","exists"]},"value":{"type":["string","number","boolean","null"]}}},"PiiV2Output":{"type":"object","additionalProperties":false,"properties":{"offset_unit":{"default":"codepoint","$ref":"#/components/schemas/PiiV2OffsetUnit"},"extra_offset_units":{"type":"array","uniqueItems":true,"items":{"$ref":"#/components/schemas/PiiV2OffsetUnit"}},"include_text":{"type":"boolean","default":false,"description":"Echo entity text. Off by default: responses carry no originals unless asked."},"include":{"type":"array","uniqueItems":true,"items":{"type":"string","enum":["entities","annotations","mapping","restore_table","forward_table","redaction_plan","audit","linkage_risk","explanation","stats"]}},"max_entities":{"type":"object","additionalProperties":false,"properties":{"per_input":{"type":"integer","minimum":1,"maximum":100000}},"description":"Caps the length of each result's `entities` list (document order). Protection is not capped; `entities_omitted` counts the rest."},"box_granularity":{"type":"string","enum":["word","line"],"default":"line","description":"Boxes per entity on page and image inputs: line = one box per text line, the union of the entity's own words; word = one box per word."}}},"PiiV2Processing":{"type":"object","additionalProperties":false,"properties":{"tier":{"type":"string","enum":["standard","realtime","batch"],"default":"standard"},"deadline_ms":{"type":"integer","minimum":100,"maximum":600000},"on_degraded":{"type":"string","enum":["fail","allow"],"default":"fail","description":"fail: 503 degraded_refused, no output, no charge, when a requested layer did not run."}}},"PiiV2DetectRequest":{"type":"object","additionalProperties":false,"description":"Send `inputs`, or for plain text the shorthand `text` (one input) or `texts` (one input per string, ids 1, 2, ...).","oneOf":[{"required":["inputs"]},{"required":["text"]},{"required":["texts"]}],"properties":{"text":{"type":"string","description":"Shorthand for inputs: [{id: \"1\", kind: \"text\", text}]."},"texts":{"type":"array","minItems":1,"maxItems":256,"items":{"type":"string"},"description":"Shorthand for one text input per string, ids \"1\", \"2\", ..."},"language":{"description":"Shorthand for detection.language.","$ref":"#/components/schemas/PiiV2Language"},"inputs":{"type":"array","minItems":1,"maxItems":256,"items":{"$ref":"#/components/schemas/PiiV2Input"}},"detection":{"$ref":"#/components/schemas/PiiV2Detection"},"output":{"$ref":"#/components/schemas/PiiV2Output"},"processing":{"$ref":"#/components/schemas/PiiV2Processing"}}},"PiiV2ProtectRequest":{"type":"object","additionalProperties":false,"description":"Send `inputs`, or for plain text the shorthand `text` (one input) or `texts` (one input per string, ids 1, 2, ...).","oneOf":[{"required":["inputs"]},{"required":["text"]},{"required":["texts"]}],"properties":{"text":{"type":"string","description":"Shorthand for inputs: [{id: \"1\", kind: \"text\", text}]."},"texts":{"type":"array","minItems":1,"maxItems":256,"items":{"type":"string"},"description":"Shorthand for one text input per string, ids \"1\", \"2\", ..."},"language":{"description":"Shorthand for detection.language.","$ref":"#/components/schemas/PiiV2Language"},"inputs":{"type":"array","minItems":1,"maxItems":256,"items":{"$ref":"#/components/schemas/PiiV2Input"}},"detection":{"$ref":"#/components/schemas/PiiV2Detection"},"policy":{"$ref":"#/components/schemas/PiiV2Policy"},"mapping":{"$ref":"#/components/schemas/PiiV2MappingBlock"},"output":{"$ref":"#/components/schemas/PiiV2Output"},"processing":{"$ref":"#/components/schemas/PiiV2Processing"}}},"PiiV2RestoreRequest":{"type":"object","additionalProperties":false,"required":["inputs"],"oneOf":[{"required":["table"]},{"required":["session"]},{"required":["mapping"]}],"properties":{"table":{"$ref":"#/components/schemas/PiiV2RestoreTable"},"session":{"$ref":"#/components/schemas/PiiV2Id"},"mapping":{"type":"object","additionalProperties":false,"required":["known"],"properties":{"known":{"type":"array","items":{"$ref":"#/components/schemas/PiiV2KnownEntry"}}}},"inputs":{"type":"array","minItems":1,"maxItems":256,"items":{"oneOf":[{"type":"object","additionalProperties":false,"required":["id","text"],"properties":{"id":{"$ref":"#/components/schemas/PiiV2Id"},"text":{"type":"string"}}},{"type":"object","additionalProperties":false,"required":["id","value"],"properties":{"id":{"$ref":"#/components/schemas/PiiV2Id"},"value":{},"include_keys":{"type":"boolean","default":false}}}]}}},"description":"Reference restore for non-streaming callers; the conformance oracle for client implementations."},"PiiV2RestoreTable":{"type":"object","additionalProperties":false,"required":["algorithm","keys"],"properties":{"algorithm":{"type":"string","pattern":"^shinrai-restore/[0-9]+(\\.[0-9]+)?$"},"table_id":{"$ref":"#/components/schemas/PiiV2Id"},"mapping_rev":{"type":"integer","minimum":0},"direction":{"type":"string","enum":["restore","forward"],"default":"restore"},"word_class":{"oneOf":[{"type":"string","pattern":"^shinrai-word/[0-9]+$"},{"$ref":"#/components/schemas/PiiV2RangeList"}],"default":"shinrai-word/1"},"max_key_len":{"type":"integer","minimum":0},"ignorable":{"$ref":"#/components/schemas/PiiV2RangeList"},"keys":{"type":"array","items":{"$ref":"#/components/schemas/PiiV2RestoreKey"}},"dropped":{"type":"object","additionalProperties":{"type":"integer","minimum":0},"description":"Variants the service left out, by reason (for example ambiguous_parts)."},"markers":{"type":"object","additionalProperties":false,"required":["prefix","suffix"],"properties":{"prefix":{"type":"string","minLength":1},"suffix":{"type":"string","minLength":1},"max_body":{"type":"integer","minimum":1,"maximum":256},"on_unknown":{"type":"string","enum":["keep","remove","redact"],"default":"keep"},"redact_text":{"type":"string","maxLength":64}}}}},"PiiV2RangeList":{"type":"array","items":{"type":"array","prefixItems":[{"type":"integer","minimum":0,"maximum":1114111},{"type":"integer","minimum":0,"maximum":1114111}],"minItems":2,"maxItems":2}},"PiiV2RestoreKey":{"type":"object","additionalProperties":false,"required":["k","o"],"properties":{"k":{"type":"string","minLength":1},"o":{"type":"string"},"m":{"$ref":"#/components/schemas/PiiV2Id"},"b":{"type":"string","enum":["both","none"],"default":"both"},"v":{"type":"string","enum":["exact","case","part","translit","json_ascii"],"default":"exact"},"ch":{"type":"string","enum":["any","text","json"],"default":"any"}}},"PiiV2RestoreTablesRequest":{"type":"object","additionalProperties":false,"oneOf":[{"required":["mapping"]},{"required":["session"]}],"properties":{"mapping":{"type":"object","additionalProperties":false,"required":["known"],"properties":{"known":{"type":"array","items":{"$ref":"#/components/schemas/PiiV2KnownEntry"}}}},"session":{"$ref":"#/components/schemas/PiiV2Id"},"direction":{"type":"string","enum":["restore","forward"],"default":"restore"},"variants":{"type":"object","additionalProperties":false,"properties":{"case":{"type":"boolean","default":true},"parts":{"type":"boolean","default":true},"translit":{"type":"boolean","default":true},"json_ascii":{"type":"boolean","default":true}}},"markers":{"type":"boolean","default":true}},"description":"Compile a map into a restore table. No text is processed; not charged."},"PiiV2ReplacementRequest":{"type":"object","additionalProperties":false,"required":["value","type"],"properties":{"value":{"type":"string","minLength":1,"maxLength":1024},"type":{"$ref":"#/components/schemas/PiiV2EntityType"},"language":{"$ref":"#/components/schemas/PiiV2Language"},"action":{"$ref":"#/components/schemas/PiiV2StrictAction"},"mapping":{"$ref":"#/components/schemas/PiiV2MappingBlock"}},"description":"Mint one replacement for a caller-chosen value (replaces /api/get-replacement)."},"PiiV2SessionCreate":{"type":"object","additionalProperties":false,"properties":{"ttl_s":{"type":"integer","minimum":60,"maximum":86400,"default":3600,"description":"Time to live in seconds, at most 24 hours (capabilities.limits.sessions_max_ttl_s)."},"known":{"type":"array","items":{"$ref":"#/components/schemas/PiiV2KnownEntry"}}}},"PiiV2SessionPatch":{"type":"object","additionalProperties":false,"properties":{"ttl_s":{"type":"integer","minimum":60,"maximum":86400,"description":"Time to live in seconds, at most 24 hours (capabilities.limits.sessions_max_ttl_s)."},"known":{"type":"array","items":{"$ref":"#/components/schemas/PiiV2KnownEntry"}},"reserved":{"type":"array","items":{"type":"string","minLength":1}},"expected_rev":{"type":"integer","minimum":0}}},"PiiV2JobCreate":{"type":"object","additionalProperties":false,"required":["kind","inputs"],"properties":{"kind":{"type":"string","enum":["text_batch","document","image","audio","video"]},"inputs":{"type":"array","minItems":1,"maxItems":100000,"items":{"$ref":"#/components/schemas/PiiV2Input"}},"detection":{"$ref":"#/components/schemas/PiiV2Detection"},"policy":{"$ref":"#/components/schemas/PiiV2Policy"},"mapping":{"$ref":"#/components/schemas/PiiV2MappingBlock"},"output":{"type":"object","additionalProperties":false,"properties":{"artifacts":{"type":"array","uniqueItems":true,"items":{"type":"string","enum":["protected","entities","mapping","redaction_plan","transcript","audit"]}},"destination":{"$ref":"#/components/schemas/PiiV2Source"},"webhook":{"type":"object","additionalProperties":false,"required":["url"],"properties":{"url":{"type":"string","format":"uri","pattern":"^https://"},"secret_ref":{"type":"string"}}}}},"processing":{"$ref":"#/components/schemas/PiiV2Processing"}}},"PiiV2Usage":{"type":"object","additionalProperties":false,"required":["records","charged"],"properties":{"records":{"type":"number","minimum":0},"weighted_records":{"type":"number","minimum":0},"tier":{"type":"string"},"charged":{"type":"boolean"},"balance_after":{"type":"number"}}},"PiiV2Device":{"type":"string","enum":["cpu","cuda","unknown"],"description":"Where the model layer ran. unknown when the serve did not report it."},"PiiV2Engine":{"type":"object","additionalProperties":false,"required":["model","layers_requested","layers_run","degraded"],"properties":{"model":{"type":"string"},"device":{"$ref":"#/components/schemas/PiiV2Device"},"layers_requested":{"type":"array","items":{"type":"string","enum":["model","pattern","validated_identifiers","custom","zero_shot","bias","provided"]}},"layers_run":{"type":"array","items":{"type":"string"}},"degraded":{"type":"boolean"},"degraded_reasons":{"type":"array","items":{"type":"string"}},"effective_thresholds":{"type":"object","description":"The confidence floors applied to model entities: default, and per_type or per_language when the request set them.","properties":{"default":{"$ref":"#/components/schemas/PiiV2Probability"},"per_type":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/PiiV2Probability"}},"per_language":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/PiiV2Probability"}}},"additionalProperties":false}}},"PiiV2RedactionPlan":{"type":"object","additionalProperties":false,"properties":{"intervals":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/PiiV2Interval"}],"type":"object","properties":{"entity_id":{"type":"string"}},"unevaluatedProperties":false}},"boxes":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["page","box"],"description":"A Box (common.schema.json) plus the id of the entity it protects.","properties":{"page":{"type":"integer","minimum":1},"box":{"type":"array","minItems":4,"maxItems":4,"items":{"type":"number"},"description":"[x, y, width, height] in the input's box unit."},"t0":{"type":"number","minimum":0},"t1":{"type":"number","minimum":0},"entity_id":{"type":"string"}}}}}},"PiiV2Audit":{"type":"object","additionalProperties":false,"properties":{"model":{"type":"string"},"labels_version":{"type":"string"},"policy_hash":{"type":"string"},"input_hmac":{"type":"string","description":"Tenant-keyed HMAC of the input; never a plain hash."},"counts":{"type":"object","additionalProperties":{"type":"integer"}},"timing_ms":{"type":"integer"}}},"PiiV2ItemResult":{"type":"object","additionalProperties":false,"required":["input_id","status"],"properties":{"input_id":{"$ref":"#/components/schemas/PiiV2Id"},"status":{"type":"string","enum":["ok","failed","skipped"]},"output":{"description":"Protected text, table, JSON value or transcript forms, in the input's shape; for an image input an ImageOutput."},"entities":{"type":"array","items":{"$ref":"#/components/schemas/PiiV2Entity"}},"entities_omitted":{"type":"integer","minimum":1,"description":"Entities left out of `entities` by `output.max_entities`; they are still protected in `output`."},"annotations":{"type":"array","description":"Non-personal findings (types with `personal: false` in /v2/types: years, amounts, legal references, bias terms), returned with `output.include: [\"annotations\"]`. Protect never changes them.","items":{"$ref":"#/components/schemas/PiiV2Entity"}},"redaction_plan":{"$ref":"#/components/schemas/PiiV2RedactionPlan"},"stats":{"type":"object","additionalProperties":false,"properties":{"chars":{"type":"integer"},"records":{"type":"number"},"types":{"type":"object","additionalProperties":{"type":"integer"}},"max_confidence_by_type":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/PiiV2Probability"}}}},"audit":{"$ref":"#/components/schemas/PiiV2Audit"},"linkage_risk":{"type":"object","additionalProperties":false,"description":"A heuristic k-anonymity proxy (`output.include: [\"linkage_risk\"]`): how likely the input singles out a person, from entity rarity tiers, direct identifiers and quasi-identifier cues (age, role, education, relation). Not a cohort count.","required":["level","score","direct_identifiers","k_estimate","signals","method"],"properties":{"level":{"type":"string","enum":["low","medium","high"]},"score":{"type":"integer","minimum":0},"direct_identifiers":{"type":"integer","minimum":0},"k_estimate":{"type":"string","enum":["likely <= 5","uncertain","plausibly > 5"]},"signals":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["kind","weight"],"properties":{"kind":{"type":"string","enum":["rarity","quasi_identifier"]},"type":{"$ref":"#/components/schemas/PiiV2EntityType"},"tier":{"type":["string","null"]},"category":{"type":"string","enum":["age","role","education","relation"]},"weight":{"type":"integer"},"text":{"type":"string","description":"Only with `output.include_text`."}}}},"method":{"type":"string"}}},"error":{"type":"object","additionalProperties":false,"required":["code"],"properties":{"code":{"$ref":"#/components/schemas/PiiV2ErrorCode"},"message":{"type":"string"}}},"text":{"type":"string","description":"The text the service extracted from an image input (OCR). Only with output.include_text; never for other kinds."},"media":{"type":"object","additionalProperties":false,"required":["box_unit"],"description":"Geometry of a page or image input, so boxes can be applied to the source.","properties":{"media_type":{"type":"string"},"width":{"type":"integer","minimum":1},"height":{"type":"integer","minimum":1},"pages":{"type":"integer","minimum":1},"box_unit":{"type":"string","enum":["pt","px","norm"]},"ocr":{"type":"object","additionalProperties":false,"properties":{"engine":{"type":"string"},"languages":{"type":"array","items":{"$ref":"#/components/schemas/PiiV2Language"}},"layout":{"type":"string"},"words":{"type":"integer"},"mean_confidence":{"type":"number"}}}}}}},"PiiV2Result":{"type":"object","additionalProperties":false,"required":["request_id","api_version","offset_unit","engine","results"],"properties":{"request_id":{"type":"string"},"api_version":{"type":"string"},"offset_unit":{"$ref":"#/components/schemas/PiiV2OffsetUnit"},"engine":{"$ref":"#/components/schemas/PiiV2Engine"},"results":{"type":"array","items":{"$ref":"#/components/schemas/PiiV2ItemResult"}},"mapping":{"$ref":"#/components/schemas/PiiV2MappingResult"},"restore_table":{"$ref":"#/components/schemas/PiiV2RestoreTable"},"forward_table":{"$ref":"#/components/schemas/PiiV2RestoreTable"},"usage":{"$ref":"#/components/schemas/PiiV2Usage"},"timing_ms":{"type":"object","additionalProperties":{"type":"integer"}}}},"PiiV2RestoreResponse":{"type":"object","additionalProperties":false,"required":["results"],"properties":{"results":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["input_id"],"properties":{"input_id":{"type":"string"},"text":{"type":"string"},"value":{}}}},"restored":{"type":"integer","minimum":0}}},"PiiV2ReplacementResponse":{"type":"object","additionalProperties":false,"required":["replacement","entry"],"properties":{"replacement":{"type":"string"},"entry":{"$ref":"#/components/schemas/PiiV2MappingEntry"},"restore_table":{"$ref":"#/components/schemas/PiiV2RestoreTable"}}},"PiiV2Session":{"type":"object","additionalProperties":false,"required":["id","mapping_rev","expires_at"],"properties":{"id":{"$ref":"#/components/schemas/PiiV2Id"},"mapping_rev":{"type":"integer"},"entries":{"type":"integer"},"created_at":{"type":"string","format":"date-time"},"expires_at":{"type":"string","format":"date-time"}}},"PiiV2Upload":{"type":"object","additionalProperties":false,"required":["id","bytes","sha256","expires_at"],"properties":{"id":{"$ref":"#/components/schemas/PiiV2Id"},"media_type":{"type":"string"},"bytes":{"type":"integer"},"sha256":{"type":"string","pattern":"^[a-f0-9]{64}$"},"expires_at":{"type":"string","format":"date-time"}}},"PiiV2Job":{"type":"object","additionalProperties":false,"required":["id","kind","status","created_at"],"properties":{"id":{"$ref":"#/components/schemas/PiiV2Id"},"kind":{"type":"string"},"status":{"type":"string","enum":["queued","running","succeeded","failed","cancelled"]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"expires_at":{"type":"string","format":"date-time"},"progress":{"type":"object","additionalProperties":false,"properties":{"done":{"type":"integer"},"total":{"type":"integer"}}},"artifacts":{"type":"object","additionalProperties":{"type":"string","description":"Relative URL of /v2/jobs/{id}/artifacts/{name}."}},"error":{"type":"object","additionalProperties":false,"required":["code"],"properties":{"code":{"$ref":"#/components/schemas/PiiV2ErrorCode"},"message":{"type":"string"}}},"usage":{"$ref":"#/components/schemas/PiiV2Usage"},"beta":{"type":"boolean"}}},"PiiV2JobList":{"type":"object","additionalProperties":false,"required":["jobs"],"properties":{"jobs":{"type":"array","items":{"$ref":"#/components/schemas/PiiV2Job"}},"next":{"type":"string"}}},"PiiV2InputCapability":{"type":"object","additionalProperties":false,"required":["standard","realtime","jobs"],"properties":{"standard":{"$ref":"#/components/schemas/PiiV2Status"},"realtime":{"$ref":"#/components/schemas/PiiV2Status"},"jobs":{"$ref":"#/components/schemas/PiiV2Status"}}},"PiiV2Capabilities":{"type":"object","additionalProperties":false,"required":["api_version","profile","mode","inputs","actions","restore"],"properties":{"api_version":{"type":"string"},"profile":{"type":"string","enum":["internal","public","offline"]},"mode":{"type":"string","enum":["local","global","offline"]},"models":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["id"],"properties":{"id":{"type":"string"},"status":{"type":"string"},"languages":{"type":"array","items":{"type":"string"}}}}},"languages":{"type":"array","items":{"type":"string"}},"offset_units":{"type":"array","items":{"$ref":"#/components/schemas/PiiV2OffsetUnit"}},"inputs":{"type":"object","additionalProperties":false,"properties":{"text":{"$ref":"#/components/schemas/PiiV2InputCapability"},"table":{"$ref":"#/components/schemas/PiiV2InputCapability"},"json":{"$ref":"#/components/schemas/PiiV2InputCapability"},"transcript":{"$ref":"#/components/schemas/PiiV2InputCapability"},"page":{"$ref":"#/components/schemas/PiiV2InputCapability"},"image":{"$ref":"#/components/schemas/PiiV2InputCapability"},"file":{"$ref":"#/components/schemas/PiiV2InputCapability"},"audio":{"$ref":"#/components/schemas/PiiV2InputCapability"},"video":{"$ref":"#/components/schemas/PiiV2InputCapability"}}},"actions":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/PiiV2Status"}},"vocabularies":{"type":"array","items":{"type":"string"}},"sessions":{"$ref":"#/components/schemas/PiiV2Status"},"limits":{"type":"object","additionalProperties":{"type":"integer"}},"restore":{"type":"object","additionalProperties":false,"required":["algorithms"],"properties":{"algorithms":{"type":"array","items":{"type":"string"}},"word_classes":{"type":"array","items":{"type":"string"}}}},"engine":{"type":"object","additionalProperties":false,"properties":{"status":{"type":"string","enum":["ok","degraded","unavailable"],"description":"Whether the model layer can answer now. The public profile reports only this and the default model."},"mode":{"type":"string","enum":["local","remote","pattern-only"]},"model":{"type":["string","null"]},"device":{"$ref":"#/components/schemas/PiiV2Device"},"circuit_open":{"type":"boolean"}},"description":"The model layer of this deployment. Internal profiles add where it runs and the circuit state."},"tiers":{"type":"object","description":"Hosted and offline: which processing tiers the calling key's plan allows.","additionalProperties":{"type":"string","enum":["allowed","not_in_plan"]}},"metering":{"type":"object","description":"Hosted and offline: how requests are charged.","properties":{"unit":{"type":"string"},"image_minimum_records":{"type":"number"},"weights":{"type":"object","additionalProperties":{"type":"number"}},"free":{"type":"array","items":{"type":"string"}}}},"ocr":{"type":"object","additionalProperties":false,"required":["available"],"description":"The packaged OCR for image inputs.","properties":{"available":{"type":"boolean"},"engine":{"type":"string"},"languages":{"type":"array","items":{"$ref":"#/components/schemas/PiiV2Language"}},"max_pixels":{"type":"integer"},"work_pixels":{"type":"integer"},"max_bytes":{"type":"integer"}}}}},"PiiV2TypesResponse":{"type":"object","additionalProperties":false,"required":["canonical"],"properties":{"canonical":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["type"],"properties":{"type":{"$ref":"#/components/schemas/PiiV2EntityType"},"description":{"type":"string"},"subtypes":{"type":"array","items":{"type":"string"}},"group":{"type":"string"},"personal":{"type":"boolean","description":"True for personal data. False for findings that are not personal data on their own (years, amounts, legal references, bias terms): they are never replaced by default."},"sources":{"type":"array","items":{"type":"string","enum":["model","pattern","name_completion","user_value","bias"]}},"since":{"type":"string"}}}},"vocabularies":{"type":"object","additionalProperties":{"type":"object","additionalProperties":false,"required":["version","map"],"properties":{"version":{"type":"string"},"map":{"type":"object","additionalProperties":{"type":"string"}}}}}}},"PiiV2UsageResponse":{"type":"object","additionalProperties":false,"properties":{"plan":{"type":["string","null"]},"available_records":{"type":"number"},"last_30_days":{"type":"object","additionalProperties":{"type":"number"}}}}},"securitySchemes":{"BearerApiKey":{"type":"http","scheme":"bearer","description":"Your ShinrAI API key: Authorization: Bearer shr_live_... (sandbox: shr_test_...)."}},"parameters":{"IdempotencyKey":{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":128},"description":"Hosted and offline modes. A retry with the same key and body returns the recomputed result and is not billed again."},"RequestId":{"name":"X-Request-Id","in":"header","required":false,"schema":{"type":"string","pattern":"^[A-Za-z0-9._-]{8,64}$"}},"Deadline":{"name":"Shinrai-Deadline-Ms","in":"header","required":false,"schema":{"type":"integer","minimum":100,"maximum":600000}},"QLanguage":{"name":"language","in":"query","required":false,"schema":{"type":"string"},"description":"Raw bodies: detection.language (BCP 47)."},"QModel":{"name":"model","in":"query","required":false,"schema":{"type":"string"},"description":"Raw bodies: detection.model (latest or a served version)."},"QTypes":{"name":"types","in":"query","required":false,"schema":{"type":"string"},"description":"Raw bodies: comma-separated detection.types.include."},"QExclude":{"name":"exclude","in":"query","required":false,"schema":{"type":"string"},"description":"Raw bodies: comma-separated detection.types.exclude."},"QTier":{"name":"tier","in":"query","required":false,"schema":{"type":"string","enum":["standard","realtime","batch"]},"description":"Raw bodies: processing.tier."},"QOnDegraded":{"name":"on_degraded","in":"query","required":false,"schema":{"type":"string","enum":["fail","allow"]},"description":"Raw bodies: processing.on_degraded."},"QGranularity":{"name":"granularity","in":"query","required":false,"schema":{"type":"string","enum":["line","word"]},"description":"Raw bodies: output.box_granularity."},"QPreset":{"name":"preset","in":"query","required":false,"schema":{"type":"string","enum":["pseudonymize","mask","label","strict"]},"description":"Raw bodies: policy.preset."},"SessionId":{"name":"session_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Id"}},"JobId":{"name":"job_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Id"}}},"headers":{"NoStore":{"schema":{"type":"string","const":"no-store"}}},"responses":{"Result":{"description":"Per-input results, engine layers, mapping delta and optional restore table.","headers":{"Cache-Control":{"$ref":"#/components/headers/NoStore"},"X-Request-Id":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Result"}}}},"ProtectResult":{"description":"Per-input results as JSON. For a raw-body request that accepts it, the protected content itself: `Accept: image/*` returns the filled image, `Accept: text/plain` the protected text; `Shinrai-Usage-Records` and `Shinrai-Entities` headers carry the summary.","headers":{"Cache-Control":{"$ref":"#/components/headers/NoStore"},"X-Request-Id":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Result"}},"text/plain":{"schema":{"type":"string"}},"image/png":{"schema":{"type":"string","format":"binary"}},"image/jpeg":{"schema":{"type":"string","format":"binary"}},"image/webp":{"schema":{"type":"string","format":"binary"}}}},"Error":{"description":"Typed error. Never echoes input values.","headers":{"Cache-Control":{"$ref":"#/components/headers/NoStore"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}