De-identify files
Upload a file and get a de-identified file back in the same format.
| Endpoint | Accepts | Notes |
|---|---|---|
POST /api/v1/deidentify/text/proprietary/outputs/csv | .csv, .xlsx, .xls | Every cell is processed. Returned in the same format. |
POST /api/v1/deidentify/text/proprietary/outputs/docx | .docx | Formatting is kept. Convert .doc to .docx first. |
POST /api/v1/deidentify/text/proprietary/outputs/pdf | .pdf | Needs selectable text. Scanned PDFs are coming soon. |
POST /api/v1/deidentify/text/proprietary/outputs/txt | .txt |
Request
Send multipart/form-data:
| Field | Required | Description |
|---|---|---|
file | Yes | The file to de-identify. |
masking_type | No | transform (used if you don't set one), redact or placeholder. |
pii_entities | No | Comma-separated categories, such as PERSON,EMAIL_ADDRESS. Leave empty or send ALL for everything. |
curl -X POST "https://privacy.custodianlabs.io/api/v1/deidentify/text/proprietary/outputs/pdf" \
-H "X-API-Key: $CUSTODIAN_API_KEY" \
-F "file=@report.pdf" \
-F "masking_type=redact" \
-F "pii_entities=PERSON,PHONE_NUMBER" \
-o deid_report.pdf
Response
The response body is the de-identified file. A Content-Disposition header names it
with a deid_ prefix, such as deid_report.pdf.
A file of the wrong type returns 400.
SDK equivalents: deidentify_file() in Python and deidentifyFile() in TypeScript pick
the endpoint from the file extension.