File Endpoints
File endpoints de-identify uploaded files and return a processed file.
Use these endpoints for document or tabular workflows. For plain text strings, use Text Endpoints.
All file endpoints require multipart/form-data and the X-API-Key header.
Shared Form Fields
| Field | Type | Required | Description |
|---|---|---|---|
file | file | Yes | File to de-identify. |
domain | string | No | General, Medical, Finance, or Custom. Defaults to General. |
pca_dimension | integer | No | Detection setting used by the endpoint. Supported values are 1, 2, and 3. Defaults to 2. |
masking_type | string | No | transform or redact. Defaults to transform. |
pii_entities | string | No | Comma-separated entity list, such as PERSON,EMAIL_ADDRESS. Leave empty or pass ALL to process all supported entities. |
CSV, XLSX, and XLS
POST /api/v1/deidentify/text/proprietary/outputs/csv
Accepted file types:
.csv.xlsx.xls
Example:
curl -X POST "$CUSTODIAN_API_BASE_URL/api/v1/deidentify/text/proprietary/outputs/csv" \
-H "X-API-Key: $CUSTODIAN_API_KEY" \
-F "file=@customers.csv" \
-F "domain=General" \
-F "masking_type=transform" \
-F "pii_entities=PERSON,EMAIL_ADDRESS,PHONE_NUMBER" \
--output deid_customers.csv
DOCX
POST /api/v1/deidentify/text/proprietary/outputs/docx
Accepted file type:
.docx
.doc files are not accepted. Convert .doc to .docx before upload.
Example:
curl -X POST "$CUSTODIAN_API_BASE_URL/api/v1/deidentify/text/proprietary/outputs/docx" \
-H "X-API-Key: $CUSTODIAN_API_KEY" \
-F "file=@case-notes.docx" \
-F "masking_type=redact" \
--output deid_case-notes.docx
PDF
POST /api/v1/deidentify/text/proprietary/outputs/pdf
Accepted file type:
.pdf
PDF processing works best when the PDF contains extractable text.
Example:
curl -X POST "$CUSTODIAN_API_BASE_URL/api/v1/deidentify/text/proprietary/outputs/pdf" \
-H "X-API-Key: $CUSTODIAN_API_KEY" \
-F "file=@report.pdf" \
-F "masking_type=transform" \
--output deid_report.pdf
TXT
POST /api/v1/deidentify/text/proprietary/outputs/txt
Accepted file type:
.txt
Example:
curl -X POST "$CUSTODIAN_API_BASE_URL/api/v1/deidentify/text/proprietary/outputs/txt" \
-H "X-API-Key: $CUSTODIAN_API_KEY" \
-F "file=@notes.txt" \
-F "masking_type=transform" \
--output deid_notes.txt
Response
File endpoints return the processed file directly.
The response includes a Content-Disposition header with a downloadable filename prefixed by deid_.