> 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 full documentation content in one file, see https://docs.sarvam.ai/llms-full.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.sarvam.ai/_mcp/server.

# Get Job Results

GET https://api.sarvam.ai/doc-ai/v1/job/{job_id}/results

Returns terminal job results. Results are never available while a job is running; requesting them before a terminal status returns `409`.

**Digitise results** include `job_id`, `type`, `status`, `usage` and `documents`.

**Extract results** include `job_id`, `type`, `status`, `usage`, `result`, `annotations` and `version`. `annotations` mirrors the result shape; every leaf has `confidence` and `sources`.

Reference: https://docs.sarvam.ai/api-reference/doc-ai/job/results

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: sarvam
  version: 1.0.0
paths:
  /doc-ai/v1/job/{job_id}/results:
    get:
      operationId: get_results
      summary: Get Document AI Job Results
      description: >-
        Returns terminal job results. Results are never available while a job is
        running; requesting them before a terminal status returns `409`.


        **Digitise results** include `job_id`, `type`, `status`, `usage` and
        `documents`.


        **Extract results** include `job_id`, `type`, `status`, `usage`,
        `result`, `annotations` and `version`. `annotations` mirrors the result
        shape; every leaf has `confidence` and `sources`.
      tags:
        - docAi
      parameters:
        - name: job_id
          in: path
          description: The unique identifier of the job
          required: true
          schema:
            type: string
        - name: format
          in: query
          description: Output format of the results, e.g. `json`.
          required: false
          schema:
            type: string
        - name: api-subscription-key
          in: header
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/docAI_get_results_Response_200'
        '404':
          description: Job not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocAIErrorModel'
        '409':
          description: Results requested before the job reached a terminal status
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocAIErrorModel'
servers:
  - url: https://api.sarvam.ai
    description: Production
components:
  schemas:
    DocAIUsage:
      type: object
      properties:
        pages_total:
          type: integer
          description: Total pages in the job.
        pages_processed:
          type: integer
          description: Pages processed so far.
        pages_succeeded:
          type: integer
          description: Pages processed successfully.
        pages_failed:
          type: integer
          description: Pages that failed processing.
      title: DocAIUsage
    DocAiV1JobJobIdResultsGetResponsesContentApplicationJsonSchemaDiscriminatorMappingExtractResult:
      type: object
      properties: {}
      description: >-
        Structured field values, shaped by the schema or `config_id` used to
        create the job.
      title: >-
        DocAiV1JobJobIdResultsGetResponsesContentApplicationJsonSchemaDiscriminatorMappingExtractResult
    DocAiV1JobJobIdResultsGetResponsesContentApplicationJsonSchemaDiscriminatorMappingExtractAnnotations:
      type: object
      properties: {}
      description: >-
        Mirrors `result`, with each leaf replaced by its `confidence` and
        `sources`.
      title: >-
        DocAiV1JobJobIdResultsGetResponsesContentApplicationJsonSchemaDiscriminatorMappingExtractAnnotations
    DocAiV1JobJobIdResultsGetResponsesContentApplicationJsonSchemaDiscriminatorMappingDigitiseDocumentsItemsPagesItems:
      type: object
      properties:
        page_number:
          type: integer
        content:
          type: string
          description: Page content in the requested output_format (HTML or Markdown).
      title: >-
        DocAiV1JobJobIdResultsGetResponsesContentApplicationJsonSchemaDiscriminatorMappingDigitiseDocumentsItemsPagesItems
    DocAiV1JobJobIdResultsGetResponsesContentApplicationJsonSchemaDiscriminatorMappingDigitiseDocumentsItems:
      type: object
      properties:
        file_name:
          type: string
        pages:
          type: array
          items:
            $ref: >-
              #/components/schemas/DocAiV1JobJobIdResultsGetResponsesContentApplicationJsonSchemaDiscriminatorMappingDigitiseDocumentsItemsPagesItems
      title: >-
        DocAiV1JobJobIdResultsGetResponsesContentApplicationJsonSchemaDiscriminatorMappingDigitiseDocumentsItems
    docAI_get_results_Response_200:
      oneOf:
        - type: object
          properties:
            type:
              type: string
              enum:
                - extract
              description: 'Discriminator value: extract'
            job_id:
              type: string
              description: The unique identifier of the job.
            status:
              type: string
              description: >-
                Terminal status of the job: `completed`, `partially_completed`,
                `failed`, or `rejected`.
            usage:
              $ref: '#/components/schemas/DocAIUsage'
            result:
              $ref: >-
                #/components/schemas/DocAiV1JobJobIdResultsGetResponsesContentApplicationJsonSchemaDiscriminatorMappingExtractResult
              description: >-
                Structured field values, shaped by the schema or `config_id`
                used to create the job.
            annotations:
              $ref: >-
                #/components/schemas/DocAiV1JobJobIdResultsGetResponsesContentApplicationJsonSchemaDiscriminatorMappingExtractAnnotations
              description: >-
                Mirrors `result`, with each leaf replaced by its `confidence`
                and `sources`.
            version:
              type: integer
              description: Version of the schema or config used.
          required:
            - type
            - job_id
            - status
            - usage
            - result
            - annotations
            - version
          description: Job results for the `extract` pipeline.
        - type: object
          properties:
            type:
              type: string
              enum:
                - digitise
              description: 'Discriminator value: digitise'
            job_id:
              type: string
              description: The unique identifier of the job.
            status:
              type: string
              description: >-
                Terminal status of the job: `completed`, `partially_completed`,
                `failed`, or `rejected`.
            usage:
              $ref: '#/components/schemas/DocAIUsage'
            documents:
              type: array
              items:
                $ref: >-
                  #/components/schemas/DocAiV1JobJobIdResultsGetResponsesContentApplicationJsonSchemaDiscriminatorMappingDigitiseDocumentsItems
              description: One entry per input document, each holding per-page content.
          required:
            - type
            - job_id
            - status
            - usage
            - documents
          description: Job results for the `digitise` pipeline.
      discriminator:
        propertyName: type
      title: docAI_get_results_Response_200
    DocAIErrorDetail:
      type: object
      properties:
        location:
          type: string
          description: >-
            Where the error occurred, e.g. 'body.items[3].tags' or
            'path.thing-id'.
        message:
          type: string
          description: Error message text.
        value:
          description: The value at the given location.
      title: DocAIErrorDetail
    DocAIErrorModel:
      type: object
      properties:
        type:
          type: string
          format: uri
          default: about:blank
          description: A URI reference to human-readable documentation for the error.
        title:
          type: string
          description: A short, human-readable summary of the problem type.
        status:
          type: integer
          description: HTTP status code.
        detail:
          type: string
          description: >-
            A human-readable explanation specific to this occurrence of the
            problem.
        instance:
          type: string
          format: uri
          description: >-
            A URI reference that identifies the specific occurrence of the
            problem.
        errors:
          type:
            - array
            - 'null'
          items:
            $ref: '#/components/schemas/DocAIErrorDetail'
          description: Optional list of individual error details.
      title: DocAIErrorModel
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: api-subscription-key

```

## Examples

### Extract results



**Response**

```json
{
  "type": "extract",
  "annotations": {
    "insured_name": {
      "confidence": 0.95,
      "sources": [
        {
          "document_id": "019fb7da-5106-7839-adc6-4245e437dfe6",
          "filename": "policy.pdf",
          "page_num": 1
        }
      ]
    },
    "policy_number": {
      "confidence": 0.98,
      "sources": [
        {
          "document_id": "019fb7da-5106-7839-adc6-4245e437dfe6",
          "filename": "policy.pdf",
          "page_num": 1
        }
      ]
    },
    "sum_insured": {
      "confidence": 0.92,
      "sources": [
        {
          "document_id": "019fb7da-5106-7839-adc6-4245e437dfe6",
          "filename": "policy.pdf",
          "page_num": 2
        }
      ]
    }
  },
  "job_id": "20260707_6eb74174-e2c3-490d-afe5-d2e7e9e2b6c7",
  "result": {
    "insured_name": "Aditya Chaudhary",
    "policy_number": "ABC-1234",
    "sum_insured": 500000
  },
  "status": "completed",
  "usage": {
    "pages_total": 2,
    "pages_processed": 2,
    "pages_succeeded": 2,
    "pages_failed": 0
  },
  "version": 1
}
```

**SDK Code**

```typescript Extract results
import { SarvamAIClient } from "sarvamai";

async function main() {
    const client = new SarvamAIClient({
        apiSubscriptionKey: "YOUR_API_KEY_HERE",
    });
    await client.docAi.getResults("20260707_6eb74174-e2c3-490d-afe5-d2e7e9e2b6c7", {
        format: "json",
    });
}
main();

```

```python Extract results
from sarvamai import SarvamAI

client = SarvamAI(
    api_subscription_key="YOUR_API_KEY_HERE",
)

client.doc_ai.get_results(
    job_id="20260707_6eb74174-e2c3-490d-afe5-d2e7e9e2b6c7",
    format="json",
)

```

```go Extract results
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.sarvam.ai/doc-ai/v1/job/20260707_6eb74174-e2c3-490d-afe5-d2e7e9e2b6c7/results?format=json"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("api-subscription-key", "<apiSubscriptionKey>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Extract results
require 'uri'
require 'net/http'

url = URI("https://api.sarvam.ai/doc-ai/v1/job/20260707_6eb74174-e2c3-490d-afe5-d2e7e9e2b6c7/results?format=json")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["api-subscription-key"] = '<apiSubscriptionKey>'

response = http.request(request)
puts response.read_body
```

```java Extract results
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.sarvam.ai/doc-ai/v1/job/20260707_6eb74174-e2c3-490d-afe5-d2e7e9e2b6c7/results?format=json")
  .header("api-subscription-key", "<apiSubscriptionKey>")
  .asString();
```

```php Extract results
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.sarvam.ai/doc-ai/v1/job/20260707_6eb74174-e2c3-490d-afe5-d2e7e9e2b6c7/results?format=json', [
  'headers' => [
    'api-subscription-key' => '<apiSubscriptionKey>',
  ],
]);

echo $response->getBody();
```

```csharp Extract results
using RestSharp;

var client = new RestClient("https://api.sarvam.ai/doc-ai/v1/job/20260707_6eb74174-e2c3-490d-afe5-d2e7e9e2b6c7/results?format=json");
var request = new RestRequest(Method.GET);
request.AddHeader("api-subscription-key", "<apiSubscriptionKey>");
IRestResponse response = client.Execute(request);
```

```swift Extract results
import Foundation

let headers = ["api-subscription-key": "<apiSubscriptionKey>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.sarvam.ai/doc-ai/v1/job/20260707_6eb74174-e2c3-490d-afe5-d2e7e9e2b6c7/results?format=json")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Digitise results



**Response**

```json
{
  "type": "digitise",
  "documents": [
    {
      "file_name": "policy.pdf",
      "pages": [
        {
          "page_number": 1,
          "content": "<h1>Policy Document</h1><p>Policy Number: ABC-1234</p>"
        },
        {
          "page_number": 2,
          "content": "<h1>Terms &amp; Conditions</h1><p>...</p>"
        }
      ]
    }
  ],
  "job_id": "20260707_9f1c2b3a-4d5e-6f70-8a9b-c0d1e2f3a4b5",
  "status": "completed",
  "usage": {
    "pages_total": 2,
    "pages_processed": 2,
    "pages_succeeded": 2,
    "pages_failed": 0
  }
}
```

**SDK Code**

```typescript Digitise results
import { SarvamAIClient } from "sarvamai";

async function main() {
    const client = new SarvamAIClient({
        apiSubscriptionKey: "YOUR_API_KEY_HERE",
    });
    await client.docAi.getResults("20260707_9f1c2b3a-4d5e-6f70-8a9b-c0d1e2f3a4b5", {
        format: "json",
    });
}
main();

```

```python Digitise results
from sarvamai import SarvamAI

client = SarvamAI(
    api_subscription_key="YOUR_API_KEY_HERE",
)

client.doc_ai.get_results(
    job_id="20260707_9f1c2b3a-4d5e-6f70-8a9b-c0d1e2f3a4b5",
    format="json",
)

```

```go Digitise results
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.sarvam.ai/doc-ai/v1/job/20260707_9f1c2b3a-4d5e-6f70-8a9b-c0d1e2f3a4b5/results?format=json"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("api-subscription-key", "<apiSubscriptionKey>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Digitise results
require 'uri'
require 'net/http'

url = URI("https://api.sarvam.ai/doc-ai/v1/job/20260707_9f1c2b3a-4d5e-6f70-8a9b-c0d1e2f3a4b5/results?format=json")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["api-subscription-key"] = '<apiSubscriptionKey>'

response = http.request(request)
puts response.read_body
```

```java Digitise results
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.sarvam.ai/doc-ai/v1/job/20260707_9f1c2b3a-4d5e-6f70-8a9b-c0d1e2f3a4b5/results?format=json")
  .header("api-subscription-key", "<apiSubscriptionKey>")
  .asString();
```

```php Digitise results
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.sarvam.ai/doc-ai/v1/job/20260707_9f1c2b3a-4d5e-6f70-8a9b-c0d1e2f3a4b5/results?format=json', [
  'headers' => [
    'api-subscription-key' => '<apiSubscriptionKey>',
  ],
]);

echo $response->getBody();
```

```csharp Digitise results
using RestSharp;

var client = new RestClient("https://api.sarvam.ai/doc-ai/v1/job/20260707_9f1c2b3a-4d5e-6f70-8a9b-c0d1e2f3a4b5/results?format=json");
var request = new RestRequest(Method.GET);
request.AddHeader("api-subscription-key", "<apiSubscriptionKey>");
IRestResponse response = client.Execute(request);
```

```swift Digitise results
import Foundation

let headers = ["api-subscription-key": "<apiSubscriptionKey>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.sarvam.ai/doc-ai/v1/job/20260707_9f1c2b3a-4d5e-6f70-8a9b-c0d1e2f3a4b5/results?format=json")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```