v1/classify-file
Classify the contents of an uploaded file. Accepts text, JSON, columnar (CSV, Excel), image, PDF, SVG, and code files. To classify a text string directly, use v1/classify.
Request
The request must be multipart/form-data with two parts:
file
file
The file to classify. Required.
content
string
JSON object with filter options. Required (send {} to apply no filters).
content filter options
Only filters is supported in the content part. The full set of body options available on v1/classify is not available for file uploads.
filters
string[]
Allow-list of element labels to report. Omit or pass an empty array to report every supported element.
Limits
Multipart form size
32 MB
Text file content
500 KB
Text files larger than 500 KB are truncated to the first 500 KB before classification. The multipart form limit applies to the entire request including the file.
Response
The response shape depends on the file type:
Text, SVG, parseable files — array of Classification objects. Each object has the same fields as described in the v1/classify response.
JSON files — a JSON-specific classification structure. Falls back to the text path only if JSON parsing fails.
Columnar files (CSV, Excel, Parquet) — columnar structure grouped by column.
Image files — array of image classification objects with bounding-box coordinates.
PDF files — array of per-page classification objects.
Code files — array of code classification objects with line and column offsets. The
filtersfield incontentis not applied to code files.
If the file type cannot be determined, the endpoint returns an empty 200 response.
Related
v1/classify — classify a text string directly.
v1/scrub-file — redact instead of detect.
Entity Taxonomy — valid element labels for
filters.
Last updated
Was this helpful?
