Encoding

Encode File

Upload and encode a file for PII detection. Supports PDF, DOCX, CSV, images, and more. The file is processed server-side and returned as base64-encoded content with PII replaced by Privacy Twins.

SDK Usage:

const result = await client.encodeFile({
  file: blob,
  fileName: 'customer-report.pdf',
  processImages: true,
  platform: 'node_sdk'
});
post/api/scanner/encode/file

Response

File encoded successfully

successboolean
encodedFilestring

Base64-encoded file content with PII replaced

continuationIdstring
mimeTypestring

MIME type of the processed output

fileNamestring

Output file name

originalContentstring

Original extracted text content

encodedContentstring

Text content with Privacy Twins applied

imageBypassedboolean

Whether image processing was bypassed

Example response

{
  "transformations": [
    {
      "components": [
        {
          "original": "John",
          "twin": "Maria",
          "type": "FIRST_NAME"
        }
      ]
    }
  ],
  "mimeType": "text/markdown",
  "fileName": "customer-report.pdf.md"
}

Changes