> This page is for Document AI.

> Sarvam Voice Agents (Samvaad) is a voice AI agent platform for Indian languages: build, test and deploy AI calling agents on your own phone numbers, from ₹3 a minute. Start here: https://docs.sarvam.ai/voice-agents/why-voice-agents.
> For clean Markdown of any page, append `.md` to the page URL.
> For a complete documentation index, see https://docs.sarvam.ai/llms.txt. For a section index, append `/llms.txt` to any section URL (for example https://docs.sarvam.ai/voice-agents/llms.txt).
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.sarvam.ai/_mcp/server.

# Classify documents

> Sort documents into types you define, with a confidence score and a short reason for every decision.

**Classify** tells you what kind of document each file is. You define the document types, for example *Bank statement*, *Identity document*, or *Invoice*. Sarvam assigns one to each file and gives a confidence score and a short reason.

Use it to route incoming documents to the right team, check that a customer uploaded the right paperwork, or pick the right Extract schema for each file.

## Step 1: Add your documents

Click **Classify** under **Products** in the sidebar. Drag and drop your files, click **Upload documents**, or pick a demo document (**Bank statement.pdf** or **PAN card.pdf**).

> **Note**
>
> Accepted formats: **PDF, JPEG, PNG, TIFF, ZIP**. Each run takes up to **10 files or 20 pages in total**. For more, use the [Classify API](/api/api-guides-tutorials/document-intelligence/how-to/classify).

## Step 2: Define document types

Under **Define document types**, add one row per type:

* **Document type.** The label you want back, for example *Identity document*.
* **Description.** What this type looks like, for example *A PAN card, Aadhaar card or passport*. Clear descriptions make a big difference when two types look alike.

Click **+ Add type** for more rows, drag the handle to reorder, and click **×** to remove one. Switch to **JSON** to edit the list as raw JSON, or use **Load saved list** to reuse types from a saved Config.

![Classify page with a sample PAN card on the left and, on the right, Define document types listing Bank statement and Identity document with descriptions, an Instructions box, and Advanced settings showing Number of pages to read for classification set to 3.](/_fern-files/_img/8f258240dd6358da02122ce4acca6839441a084bb781677e276801a573429424.webp)

Use the optional **Instructions** box for anything that applies to every document.

### Advanced settings

Expand **Advanced settings** to control cost and behaviour:

| Setting                                        | What it does                                                                                                                                      |
| ---------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Number of pages to read for classification** | How many pages from the start of each document Sarvam looks at. Fewer pages cost fewer credits. The cost per document is shown under the setting. |
| **Page ranges to read**                        | Read specific pages instead of the first ones, for example when the cover page is the same for every document.                                    |
| **When no type matches**                       | **Suggest a type** lets Sarvam propose a new label. **Mark as Other** returns *Other* instead.                                                    |

## Step 3: Run and review

Click **Run classify**. The credits needed are shown under the button. When the run is **Done**, the **Output** tab shows one row per document:

![Classify output with one row for PAN card.pdf, 1 page, Read 1 of 1 page; Document type Identity document; Confidence 100%; and a Reasoning column explaining that the document is titled Permanent Account Number Card.](/_fern-files/_img/e2b107c169ed83cd8ab382cbbcde2bf0045219b14f8f664226f19e876a9ac08d.webp)

| Column            | Meaning                                                       |
| ----------------- | ------------------------------------------------------------- |
| **Document name** | The file, its page count, and how many pages were read        |
| **Document type** | The assigned type. Change it from the dropdown if it's wrong. |
| **Confidence**    | How sure Sarvam is about the type                             |
| **Reasoning**     | A one-line reason, useful for checking edge cases             |

Switch to **JSON** to see the raw output. Go back to **Setup** to change the types and **Run again**.

## Step 4: Download or reuse

* **Download** saves the results.
* **Save config** saves your document types and settings for reuse. See [Save and reuse Configs](/doc-ai/how-to/save-and-reuse-configs).
* **View API code** gives you cURL, Python, or JavaScript for the [Classify API](/api/api-guides-tutorials/document-intelligence/how-to/classify).

> **Tip**
>
> Classify looks at each **file** as a whole. If one PDF contains several different documents, use [Split](/doc-ai/how-to/split-a-document-bundle) instead. Split finds where each document starts and ends.

Next: [Split a document bundle](/doc-ai/how-to/split-a-document-bundle).