Scan a file
Content type multipart/form-data
Scans a spreadsheet or delimited file for personal data and tells you which rows hold what. The call is synchronous: you get back the finished run, already charged, with a downloadable report under output_urls.report.
Request
curl -X POST "https://studioapi.kriyam.ai/models/mask/pii/v1" \ -H "X-API-Key: $KRIYAM_API_KEY" \ -F "file=@customers.csv" \ --form-string 'types=["phone", "aadhaar"]' \ -F "mask_style=box"
Response
Authentication
Send your key in the X-API-Key header. See Authentication.
Request
Body
| Name | Type | Required | Description |
|---|---|---|---|
file | file | Required | The file to scan. |
types | array | Optional | PDF or image only. Repeat for each kind of data to find and mask (e.g. |
mask_style | string | Optional | PDF or image only. Default boxlabel |
Response
200 OK
Returns the run envelope. The fields below are what this tool puts inside it.
| Field | Type | Description |
|---|---|---|
result.scan.rows_flagged | integer | How many rows contain personal data, across the whole file — not capped. |
result.scan.type_counts | object | How many rows each kind was found in, keyed by type. Also whole-file. |
result.scan.findings[] | object[] | The flagged rows, at most 500 of them, each |
result.scan.truncated | boolean | True when there were more than 500 flagged rows and |
result.scan.unparsed_lines | integer | Lines of the underlying report that couldn't be interpreted. Non-zero means the scan is incomplete — surface it, or a low finding count reads as a clean file. |
output_urls.report | string | The full scan log, always kept whatever the parse recovered. Presigned and short-lived. |
Errors
| Status | Code | When |
|---|---|---|
| 400 | — | The file is empty or can't be read. |
Every keyed call can also get401402403404429— see Errors.
