> 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 Status

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

Returns a job's status and page-level usage.

**Terminal statuses:** `completed`, `partially_completed`, `failed`, `rejected`. Results and download URLs are only available after the job reaches a terminal status.

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

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: sarvam
  version: 1.0.0
paths:
  /doc-ai/v1/job/{job_id}/status:
    get:
      operationId: get_status
      summary: Get Document AI Job Status
      description: >-
        Returns a job's status and page-level usage.


        **Terminal statuses:** `completed`, `partially_completed`, `failed`,
        `rejected`. Results and download URLs are only available after the job
        reaches a terminal status.
      tags:
        - docAi
      parameters:
        - name: job_id
          in: path
          description: The unique identifier of the job
          required: true
          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/DocAIJobStatusResponse'
        '404':
          description: Job not found
          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
    DocAIJobStatusResponse:
      type: object
      properties:
        job_id:
          type: string
          description: The unique identifier of the job.
        status:
          type: string
          description: >-
            Current status of the job. Terminal statuses: `completed`,
            `partially_completed`, `failed`, `rejected`.
        pipeline:
          type: string
          description: 'Job pipeline: `digitise` or `extract`.'
        usage:
          $ref: '#/components/schemas/DocAIUsage'
        created_at:
          type: string
          description: Job creation timestamp.
        updated_at:
          type: string
          description: Timestamp of the last job update.
      required:
        - job_id
        - status
        - pipeline
        - usage
        - created_at
        - updated_at
      title: DocAIJobStatusResponse
    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



**Response**

```json
{
  "job_id": "string",
  "status": "string",
  "pipeline": "string",
  "usage": {
    "pages_total": 1,
    "pages_processed": 1,
    "pages_succeeded": 1,
    "pages_failed": 1
  },
  "created_at": "string",
  "updated_at": "string"
}
```

**SDK Code**

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

async function main() {
    const client = new SarvamAIClient({
        apiSubscriptionKey: "YOUR_API_KEY_HERE",
    });
    await client.docAi.getStatus("job_id");
}
main();

```

```python
from sarvamai import SarvamAI

client = SarvamAI(
    api_subscription_key="YOUR_API_KEY_HERE",
)

client.doc_ai.get_status(
    job_id="job_id",
)

```

```go
package main

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

func main() {

	url := "https://api.sarvam.ai/doc-ai/v1/job/job_id/status"

	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
require 'uri'
require 'net/http'

url = URI("https://api.sarvam.ai/doc-ai/v1/job/job_id/status")

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
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/job_id/status")
  .header("api-subscription-key", "<apiSubscriptionKey>")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.sarvam.ai/doc-ai/v1/job/job_id/status', [
  'headers' => [
    'api-subscription-key' => '<apiSubscriptionKey>',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.sarvam.ai/doc-ai/v1/job/job_id/status");
var request = new RestRequest(Method.GET);
request.AddHeader("api-subscription-key", "<apiSubscriptionKey>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.sarvam.ai/doc-ai/v1/job/job_id/status")! 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()
```