> For the complete documentation index, see [llms.txt](https://docs.teleskope.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.teleskope.ai/the-platform/api-service/scanning-api/v1-classify-file.md).

# 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](/the-platform/api-service/scanning-api/v1-classify.md).

{% openapi src="/files/cGyOSqpybs6wM3Oy8JMJ" path="/v1/classify-file" method="post" %}
[{"openapi":"3.12.json](https://2383928706-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgO8NOoWqwRd6MduHoEy7%2Fuploads%2Fgit-blob-8868525e0357b58fd3f49b11e1b4d888773e49fc%2F%7B%22openapi%22%3A%223.12.json?alt=media)
{% endopenapi %}

## Request

The request must be `multipart/form-data` with two parts:

| Part      | Type   | Description                                                                |
| --------- | ------ | -------------------------------------------------------------------------- |
| `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](/the-platform/api-service/scanning-api/v1-classify.md) is not available for file uploads.

| Field     | Type      | Description                                                                                            |
| --------- | --------- | ------------------------------------------------------------------------------------------------------ |
| `filters` | string\[] | Allow-list of element labels to report. Omit or pass an empty array to report every supported element. |

### Limits

| Limit               | Value  |
| ------------------- | ------ |
| 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](/the-platform/api-service/scanning-api/v1-classify.md#response-fields).
* **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 `filters` field in `content` is not applied to code files.

If the file type cannot be determined, the endpoint returns an empty `200` response.

***

## Related

* [v1/classify](/the-platform/api-service/scanning-api/v1-classify.md) — classify a text string directly.
* [v1/scrub-file](/the-platform/api-service/redaction-api/v1-scrub-file.md) — redact instead of detect.
* [Entity Taxonomy](/specifications/entity-taxonomy-v2.md) — valid element labels for `filters`.
