---
title: "HTML"
method: POST
path: "/api/Redact/html"
tags: ["Text Redaction"]
---

# HTML

`POST /api/Redact/html`

Returns a modified version of the HTML that redacts or synthesizes the detected entity values. The redacted HTML has the same structure as the input HTML. Only the text contained in the HTML elements is modified.

## Request body

- HtmlRedactionRequest — Request to redact PII from an HTML document.
  - `generatorConfig` object — A dictionary of entity types to their transformation type.
  - `generatorDefault` 'Off' | 'Synthesis' | 'Redaction' | 'GroupingSynthesis' | 'ReplacementSynthesis' — <p>Possible values:</p> <ul> <li><b>Off</b>: Ignore the PII type</li> <li><b>Synthesis</b>: Synthesize a new, realistic entity</li> <li><b>Redaction</b>: Tokenize the entity, e.g. [NAME_GIVEN_ssys5]</li> <li><b>GroupingSynthesis</b>: Synthesize entities using consistent grouping across the document</li> <li><b>ReplacementSynthesis</b>: Replace entities with LLM generated values. ReplacementSynthesis is no longer used</li> </ul>
  - `docXImagePolicy` 'Redact' | 'Ignore' | 'Remove' — <p>Possible values:</p> <ul> <li><b>Redact</b>: Run images through OCR and redact sensitive text</li> <li><b>Ignore</b>: Leave images alone</li> <li><b>Remove</b>: Cover image with opaque black box</li> </ul>
  - `rtfImagePolicy` 'Ignore' | 'Remove' — <p>Possible values:</p> <ul> <li><b>Ignore</b>: Leave images alone</li> <li><b>Remove</b>: Replace each image with an opaque black box of the same size</li> </ul>
  - `docXCommentPolicy` 'Remove' | 'Ignore' — <p>Possible values:</p> <ul> <li><b>Remove</b>: Remove all comments for file</li> <li><b>Ignore</b>: Leave comments alone</li> </ul>
  - `pdfSignaturePolicy` 'Redact' | 'Ignore' — <p>Possible values:</p> <ul> <li><b>Redact</b>: Cover signature with opaque black box</li> <li><b>Ignore</b>: Do not attempt to detect signature</li> </ul>
  - `pdfSynthModePolicy` 'V1' | 'V2' | 'V5' — <p>Possible values:</p> <ul> <li><b>V1</b>: Original mode with incorrect font, size and style</li> <li><b>V2</b>: Legacy style-aware mode. Persisted V2 values now use the V5 font detector.</li> <li><b>V5</b>: Style-aware mode backed by the V5 OpenVINO font model</li> </ul>
  - `docXTablePolicy` 'Redact' | 'Remove' — <p>Possible values:</p> <ul> <li><b>Redact</b>: Treat table content normally, feed into redaction process.</li> <li><b>Remove</b>: Replace all characters and symbols in table with a placeholder.</li> </ul>
  - `llmClassificationPolicy` 'Disabled' | 'Enabled' | 'PdfIdentificationAndSynthesis' — <p>Possible values:</p> <ul> <li><b>Disabled</b>: Do not use LLM for structured data classification</li> <li><b>Enabled</b>: Use LLM to classify structured data for PII detection</li> <li><b>PdfIdentificationAndSynthesis</b>: Use an LLM instead of the NER model and C# generators for PDF PII identification and synthesis. Other file types continue to use their existing detection and synthesis paths.</li> </ul>
  - `llmTableClassificationPolicy` 'Disabled' | 'Enabled' | 'PdfIdentificationAndSynthesis' — <p>Possible values:</p> <ul> <li><b>Disabled</b>: Do not use LLM for structured data classification</li> <li><b>Enabled</b>: Use LLM to classify structured data for PII detection</li> <li><b>PdfIdentificationAndSynthesis</b>: Use an LLM instead of the NER model and C# generators for PDF PII identification and synthesis. Other file types continue to use their existing detection and synthesis paths.</li> </ul>
  - `labelBlockLists` object — A list of regexes to match against the specified entity type for exclusion. Legacy strings inputs are accepted and normalized into regexes.
  - `labelAllowLists` object — A list of regexes to match against the specified entity type for inclusion. Legacy strings inputs are accepted and normalized into regexes.
  - `generatorMetadata` object — A dictionary mapping entity type names to their transformation metadata configuration.
  - `recordApiRequestOptions` RecordApiRequestOptions — Options for recording an API request for audit review, including tagging.
    - `tags` string[], nullable — Tags to assign to the request, makes search and retrieval easier. Optional: omitting it is equivalent to an empty list.
    - `record` boolean, nullable — When explicitly false, suppresses recording of this request regardless of the organization's request auditing settings. When true or null, recording defers to the organization's settings (a per-request opt-in does not force recording).
  - `customPiiEntityIds` string[], nullable — A list of custom Pii Entity names to use for NER
  - `customEntityRankingModes` object, nullable — Optional per-entity ranking overrides for custom-PII and model-based entities detected in this request. Keys are entity Names (the same identifiers used in Solar.Core.Models.BaseApiRedactionRequest.CustomPiiEntityIds); values control whether the custom entity always wins an exact-boundary overlap against a built-in entity (`Prioritized`) or is compared by score (`Standard`). Omit to keep today's behavior of treating every requested custom entity as Prioritized. Supplying a key that does not match any requested custom-PII or model-based entity Name is rejected as a 400 error.
  - `customEntityConfidenceThresholds` object, nullable — Optional per-entity minimum detection confidence thresholds for custom-PII and model-based entities detected in this request. Keys are entity Names (the same identifiers used in Solar.Core.Models.BaseApiRedactionRequest.CustomPiiEntityIds); each value is in (0, 1], and detections for that entity whose score falls below it are ignored. Omit to keep today's behavior of no confidence cutoff. Supplying a key that does not match any requested custom-PII or model-based entity Name, or a value outside (0, 1], is rejected as a 400 error.
  - `htmlText` string — The HTML document redact

## Response `200`

Returns the redacted HTML

- RedactionSdkModel — The result of a redaction operation, containing the original text, redacted text, and details of each entity replacement.
  - `originalText` string — The original input text before redaction.
  - `redactedText` string — The text after redaction has been applied.
  - `usage` integer — The number of words processed.
  - `deIdentifyResults` ReplacementSdkModel[] — The list of entity replacements that were made during redaction.
    - `start` integer — The start character index of the detected entity in the original text.
    - `end` integer — The end character index of the detected entity in the original text.
    - `newStart` integer — The start character index of the replacement in the redacted text.
    - `newEnd` integer — The end character index of the replacement in the redacted text.
    - `label` string — The entity type label (e.g. NAME_GIVEN, LOCATION, DATE_TIME).
    - `text` string — The original text of the detected entity.
    - `newText` string, nullable — The replacement text that was substituted for the original entity.
    - `score` number, double — The confidence score of the entity detection, between 0 and 1.
    - `language` string, nullable — The detected language of the text containing the entity.
    - `exampleRedaction` string, nullable — An example of what the redacted value looks like, if applicable.
    - `jsonPath` string, nullable — The JSON path of the entity, if the source was a JSON document.
    - `xmlPath` string, nullable — The XML path of the entity, if the source was an XML document.
    - `idx` integer, nullable — The index of the text in the bulk request array, if from a bulk redaction operation.

## Other responses

- `400` — Invalid HTML input

---

[API](https://skmtc.net/tonic/apis/textual-api.md) · [All operations](https://skmtc.net/tonic/apis/textual-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/tonic/textual-api/revisions/41da8739a690/schema)
