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

# Response Format

> Response shape from the /classify endpoint, with examples for each job state.

A completed classification job returns the overall document classification, a confidence score, and per-page results. The example below is a real response from classifying an invoice against four candidate categories.

```json theme={null}
{
  "job_id": "97ba5215-2367-47f8-9298-da43c0722d20",
  "status": "completed",
  "progress": "Classification completed",
  "error": null,
  "result": {
    "success": true,
    "classification": "Invoice",
    "confidence": 0.9999994487765023,
    "total_pages": 1,
    "processed_pages": 1,
    "page_results": [
      {
        "page": 1,
        "success": true,
        "classification": "Invoice",
        "raw_result": "Invoice",
        "confidence": 0.9999994487765023
      }
    ]
  }
}
```

## Top-Level Fields

* **`job_id`:** unique identifier for the classification job
* **`status`:** job state (`completed`, `failed`, or an in-progress value such as `processing`)
* **`progress`:** human-readable progress message
* **`error`:** error message if the job failed, otherwise `null`
* **`result`:** the classification result object (described below)

## Result Object

* **`success`:** whether the classification operation succeeded
* **`classification`:** the overall predicted category for the document
* **`confidence`:** confidence score for the overall classification (0–1)
* **`total_pages`:** total number of pages in the document
* **`processed_pages`:** number of pages successfully processed
* **`page_results`:** per-page classifications (described below)

## Page Result Object

Each item in `page_results` describes the classification of one page:

* **`page`:** page number, 1-indexed
* **`success`:** whether classification succeeded for that page
* **`classification`:** the predicted category for the page
* **`raw_result`:** the model's raw output before normalization to a category name; usually identical to `classification`
* **`confidence`:** confidence score for the page's classification (0–1)

## Other Job States

The submit response (before polling kicks in) returns a smaller body:

```json theme={null}
{
  "job_id": "660e8400-e29b-41d4-a716-446655440001",
  "status": "processing",
  "message": "Classification started",
  "quota_remaining": 400
}
```

A job that's still running returns the current progress without a `result`:

```json theme={null}
{
  "job_id": "660e8400-e29b-41d4-a716-446655440001",
  "status": "processing",
  "progress": "Analyzing document...",
  "error": null
}
```

A failed job returns an `error` message:

```json theme={null}
{
  "job_id": "660e8400-e29b-41d4-a716-446655440001",
  "status": "failed",
  "progress": "Classification failed",
  "error": "Invalid PDF format"
}
```

For the full request and response specification, see the [Classify API reference](/api-reference/classification/classify-document).
