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
Example response
{
"transformations": [
{
"components": [
{
"original": "John",
"twin": "Maria",
"type": "FIRST_NAME"
}
]
}
],
"mimeType": "text/markdown",
"fileName": "customer-report.pdf.md"
}