> ## Documentation Index
> Fetch the complete documentation index at: https://docs.landing.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Classify

> Label each page of a document by type to route pages before parsing or extraction.

Use the [Classify API](https://docs.landing.ai/api-reference/classify/ade-classify.md) to classify each page in a document by type. You provide a document and a list of classes, and the API assigns a class to each page.

Use those classes to decide how to handle each page downstream, for example which pages to parse, how to split a batch, or which extraction schema to apply.

Classify runs as a synchronous request at `https://api.ade.landing.ai/v1/ade/classify` (EU: `https://api.ade.eu-west-1.landing.ai/v1/ade/classify`). It works on the original document, so you can call it before or alongside [Parse](https://docs.landing.ai/dpt3/parse.md).

## Example Use Cases

* **Financial Services**: Financial institutions receiving batches of mixed documents can classify pages to identify bank statements, utility bills, and identification documents before routing them to the appropriate processing pipeline.

* **Healthcare**: Healthcare systems ingesting patient records can classify pages to identify intake forms, pathology reports, and medication lists before parsing or extraction.

* **Legal**: Legal teams processing incoming documents can classify pages by section type (for example, cover page, terms, signature page) before routing each page to the appropriate review workflow.

* **Insurance**: Insurance companies receiving claim submissions can classify pages to identify claim forms, invoices, and medical records before extraction.

> [!NOTE]
>
> For credit consumption rates, see [Credit Consumption](https://docs.landing.ai/dpt3/credit-consumption.md#classify).

## Process Overview

Follow these steps to classify pages in a document:

1. **Define your class list** by creating the classes that describe the page types in your document. Learn more about [Classes](#classes).

2. **Classify your document** using the [Classify API](https://docs.landing.ai/api-reference/classify/ade-classify.md). Pass your document and class list. All pages are classified concurrently.

3. **Use the classification results** in your downstream workflows. Route pages to [Parse](https://docs.landing.ai/dpt3/parse.md), [Split](https://docs.landing.ai/dpt3/split.md), [Extract](https://docs.landing.ai/dpt3/extract.md), or other systems based on the class assigned to each page. Learn more about the [response structure](https://docs.landing.ai/dpt3/classify-response.md).

## Classes

A class is an object with a required `class` name and an optional `description`.

Include a description when the class name alone may be ambiguous (for example, `"spec"` vs `"manual"`). You can omit the description when the name is self-explanatory.

You can mix classes with and without descriptions in the same request.

## Classify with the API

Classify the pages in a document by calling the [Classify](https://docs.landing.ai/api-reference/classify/ade-classify.md) endpoint. In the EU, send the request to `https://api.ade.eu-west-1.landing.ai` with an EU API key. See [European Union (EU)](https://docs.landing.ai/dpt3/eu.md).

This example classifies a document that may contain invoices, bank statements, and earnings statements. The `invoice` and `bank_statement` classes include descriptions, and `earnings statement` does not.

```shell theme={null}
curl -X POST 'https://api.ade.landing.ai/v1/ade/classify' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -F 'classes=[{"class":"invoice","description":"A commercial bill with line items, totals, and payment terms"},{"class":"bank_statement","description":"A monthly summary of account transactions"},{"class":"earnings statement"}]' \
  -F 'document=@document.pdf'
```

### Parameters

Get the full parameters from the [API reference](https://docs.landing.ai/api-reference/classify/ade-classify.md).

| Parameter | Required | Description |
| - | - | - |
| `document` | Required (choose one) | The document file to classify. |
| `document_url` | Required (choose one) | A URL pointing to the document to classify. |
| `classes` | Required | A JSON array of class objects. Each object requires a `class` name and accepts an optional `description`. Pass as a JSON string in form data. |
| `model` | Optional | The classification model version to use. If omitted, the API uses the latest version. |

## Use Classify with Our Libraries

Click one of the tiles to learn how to use the [Classify](https://docs.landing.ai/api-reference/classify/ade-classify.md) API with our libraries.

> [card] [Python Library](https://docs.landing.ai/dpt3/ade-python.md#classify-pages)
>
> Use Classify with our Python library.

> [card] [TypeScript Library](https://docs.landing.ai/dpt3/ade-typescript.md#classify-pages)
>
> Use Classify with our TypeScript library.

## Supported File Types

The Classify API accepts PDFs, images, Office text documents, and PowerPoint presentations, up to 50 MiB per request. Office text documents and presentations are converted to PDF before classification. Spreadsheets (XLSX, CSV) and legacy PowerPoint (PPT) files are not supported.

| Category | Formats |
| - | - |
| PDF | PDF |
| Images | JPEG, PNG, GIF, BMP, TIFF, WEBP, DCX, DDS, ICNS, JP2, PBM, PCX, PGM, PPM, PSD, TGA |
| Office text documents | DOCX, DOC, ODT, RTF |
| Presentations | PPTX |

## Share Your Feedback

To share your experience with Classify, [schedule a feedback session with us](https://landing-ai.zoom.us/zbook/landingai-fatimasalehbhai/landingai-ade-feedback).

Come prepared to discuss:

* What is working well
* Any challenges you've encountered and how the feature could improve
* The email address for your Agentic Document Extraction account, found in your [profile page](https://ade.landing.ai/settings/personal/profile)
* The documents you used
* The code you used


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.