Skip to content

Response Format

mask() returns a VARIANT containing parsed JSON. The examples below show the fields callers can receive from the public SQL function.

{
"columns": [...],
"entity_ledger": [...]
}

Array with one entry per input text. For the STRING overload, exactly one entry. For the ARRAY overload, one entry per array element.

Array of every detected entity with its original value, placeholder token, and final replacement. Shared across all columns in a single call.

{
"index": 0,
"deidentified_text": "[PERSON_1] lives at [LOCATION_1]",
"analyzer_results": [
{
"entity_type": "PERSON",
"start": 0,
"end": 11,
"score": 0.97
}
]
}
FieldTypeDescription
indexINTZero-based position of this column in the input array.
deidentified_textSTRINGThe masked output text.
analyzer_resultsARRAYSpan-level detection details.
original_textSTRINGOriginal input (documents only — for documents, input is base64-encoded so the readable text lives here).
document_metadataOBJECTExtracted document metadata such as file type, page count, image dimensions, or OCR confidence.
redacted_documentSTRINGBase64-encoded, zlib-compressed de-identified file (when include_redacted_document=true).
redaction_metadataOBJECTPixel redaction audit data when include_redaction_metadata=true.

If include_analyzer_results=false, analyzer_results is omitted.

FieldTypeDescription
entity_typeSTRINGThe detected type (e.g., PERSON, US_SSN, or your custom entity name).
startINTCharacter offset of the entity in the original text.
endINTEnd offset (exclusive).
scoreFLOATDetection confidence 0.01.0.
{
"entity_type": "PERSON",
"original": "John Smith",
"placeholder": "[REDACTED_PERSON_1]",
"replacement": "[PERSON_1]"
}
FieldTypeDescription
entity_typeSTRINGType of the detected entity.
originalSTRINGExact source text that was detected.
placeholderSTRINGDetection placeholder token ([REDACTED_PERSON_1]). Reported in the ledger only; use replacement to match the value written to deidentified_text.
replacementSTRINGActual text that appears in deidentified_text. For the default type_numbered operator this is [PERSON_1]; for faker, hash, encrypt, or constant it is the operator output.
seededBOOLEAN (conditional)Present (true) only on entries whose binding came from ledger_seed. Absence means the entry was bound in this request.
canonical_originalSTRING (conditional)Present only on entries merged into another by identity resolution: the canonical value this alias was grouped under. Absence means this entry is the canonical value, or no merge occurred.

The ledger emits detected entries only. ledger_seed entries that never appeared in the row are omitted; compare the returned ledger with the seed you supplied to find unused seed entries. Pass-through cases where the operator left the value unchanged by design, such as date_shift on relative phrases, time-only values, bare years, or month-year values, are also omitted; keep operator entries are always emitted because cataloging is their purpose.

Present only when non-empty. Carries row-level processing signals, including SEED_REMAPPED_BY_COLLAPSE records (see identity resolution). The include_* flags do not control warnings.

ZIP inputs return an archive-shaped column instead of deidentified_text at the column level:

{
"index": 0,
"archive": {
"documents": [
{
"filename": "note.txt",
"deidentified_text": "Patient [PERSON_1]",
"metadata": {"file_type": "txt"},
"original_text": "Patient Jane Smith"
}
],
"skipped_files": [
{"filename": "binary.dat", "reason": "Unsupported file type"}
]
}
}

When include_redacted_document=true, archive document entries that support binary redaction can include redacted_document. If at least one entry has a redacted binary, archive.redacted_archive contains a base64-encoded ZIP with those redacted files.

For PDF, image, and DICOM pixel redaction, include_redaction_metadata=true adds:

{
"entities_redacted": 2,
"coordinate_system": "pixels",
"bounding_boxes": [
{"left": 120, "top": 80, "width": 210, "height": 32, "page": 0, "entity_type": "PERSON"}
]
}

page is zero-based. Single-image inputs use page 0.

app_public.mask() returns the parsed JSON VARIANT shown in this reference. Callers do not need to decode a binary payload before reading fields such as columns, entity_ledger, or error.

When a row-level processing error occurs, the row result has an error object and an empty columns array:

{
"error": {
"message": "Failed to preprocess text: invalid document",
"code": 400
},
"columns": []
}

When app_public.mask() rejects the call before row processing, such as an expired trial, the top-level response is:

{
"error": "7-day trial expired. Contact the provider for continued access."
}