Encode File
Changed onUpload 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'
});
Request
- Base URLhttps://api.privacypal.ai
- AuthHTTP bearer
- TypeScriptA function with typed inputs. Its response is checked against the schema.
Request body multipart/form-data
Example request
{
"fileName": "customer-report.pdf",
"platform": "node_sdk"
}Response
File encoded successfully
Example response
{
"transformations": [
{
"components": [
{
"original": "John",
"twin": "Maria",
"type": "FIRST_NAME"
}
]
}
],
"mimeType": "text/markdown",
"fileName": "customer-report.pdf.md"
}Changes
- breaking
the response's body type changed from no type to
objectfor status - info
added the optional property
to the response with the status - info
added the optional property
to the response with the status - info
added the optional property
to the response with the status - info
added the optional property
to the response with the status - info
added the optional property
to the response with the status - info
added the optional property
to the response with the status - info
added the optional property
to the response with the status - info
added the optional property
to the response with the status - info
added the optional property
to the response with the status
- breaking
- info
endpoint added
- info