> ## 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.

# JSON Response for Classification

export const classify = 'ADE Classify';

export const splitJSON = 'split rules';

export const split = 'ADE Split';

export const adePythonLibrary = 'ade-python';

export const dpt2mini = 'DPT-2 mini';

export const dpt2 = 'DPT-2';

export const dpt1 = 'DPT-1';

export const dpt = 'Document Pre-Trained Transformer';

export const companyName = 'LandingAI';

export const extract = 'ADE Extract';

export const parse = 'ADE Parse';

export const ade = 'Agentic Document Extraction';

When you classify a document with the [{classify} API](https://docs.landing.ai/api-reference/tools/ade-classify), the results are returned in a structured JSON format.

## Example Response

The following example shows a classification response for a nine-page document containing bank statements and pay stubs:

```json [expandable] theme={null}
{
  "classification": [
    {
      "class": "bank statement",
      "reason": "Checking account statement for Sarah J. Mitchell from Builder's Bank for the period of September 1 to September 30, 2025.",
      "suggested_class": null,
      "page": 0
    },
    {
      "class": "bank statement",
      "reason": "Continuation of the transaction history and account summary for the September 2025 bank statement.",
      "suggested_class": null,
      "page": 1
    },
    {
      "class": "bank statement",
      "reason": "Checking account statement for Sarah J. Mitchell from Builder's Bank for the period of October 1 to October 31, 2025.",
      "suggested_class": null,
      "page": 2
    },
    {
      "class": "bank statement",
      "reason": "Continuation of the transaction history and account summary for the October 2025 bank statement.",
      "suggested_class": null,
      "page": 3
    },
    {
      "class": "bank statement",
      "reason": "Informational page containing bank policies, fraud protection details, and contact information.",
      "suggested_class": null,
      "page": 4
    },
    {
      "class": "pay stub",
      "reason": "Earnings statement from Acme Corporation for Sarah J. Mitchell for the pay period ending August 31, 2025.",
      "suggested_class": null,
      "page": 5
    },
    {
      "class": "pay stub",
      "reason": "Summary of gross pay, deductions, and net pay for the Acme Corporation earnings statement.",
      "suggested_class": null,
      "page": 6
    },
    {
      "class": "pay stub",
      "reason": "Earnings statement from Acme Corporation for Sarah J. Mitchell for the pay period ending September 15, 2025.",
      "suggested_class": null,
      "page": 7
    },
    {
      "class": "pay stub",
      "reason": "Summary of gross pay, deductions, and net pay for the second Acme Corporation earnings statement.",
      "suggested_class": null,
      "page": 8
    }
  ],
  "metadata": {
    "filename": "SarahMitchell-loan-docs.pdf",
    "org_id": "f6t71a157bx9",
    "page_count": 9,
    "duration_ms": 10865,
    "credit_usage": 4.5,
    "job_id": "c19ab8c311db41b391c50a56a4cdea5c",
    "version": "classify-20260420"
  }
}
```

## Response Structure

The response contains the following top-level fields:

| Field                                                | Type   | Description                                                              |
| ---------------------------------------------------- | ------ | ------------------------------------------------------------------------ |
| [`classification`](#per-page-results-classification) | array  | Per-page classification results.                                         |
| [`metadata`](#processing-metadata-metadata)          | object | Processing information including credit usage, duration, and page count. |

## Per-Page Results (`classification`)

The `classification` field contains an array of results, one per page in the document. Each object includes:

| Field             | Type           | Description                                                                                                                              |
| ----------------- | -------------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
| `page`            | number         | The page number (0-indexed).                                                                                                             |
| `class`           | string         | The class label assigned to this page (for example, `"Invoice"`). When a page cannot be confidently classified, this value is `unknown`. |
| `reason`          | string         | An explanation of why this class was assigned. Use this to understand the classification decision and refine your class list if needed.  |
| `suggested_class` | string \| null | The closest matching class when `class` is `unknown`; otherwise `null`.                                                                  |

### Unknown Pages

When a page cannot be confidently classified into any of the classes you defined, the API returns `unknown` in the `class` field and a value in `suggested_class`. Use this to review borderline pages or adjust your class list.

## Processing Metadata (`metadata`)

The `metadata` field provides information about the classification process:

| Field          | Type   | Description                                   |
| -------------- | ------ | --------------------------------------------- |
| `filename`     | string | The name of the input document.               |
| `org_id`       | string | Organization identifier.                      |
| `page_count`   | number | Total number of pages in the document.        |
| `duration_ms`  | number | Processing time in milliseconds.              |
| `credit_usage` | number | Number of credits consumed.                   |
| `job_id`       | string | Unique identifier for the classification job. |
| `version`      | string | The model version used for classification.    |
