> 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 ## Authentication - `api-subscription-key` header (required) — API Key authentication via header ## Request ### Path parameters - `job_id` (string, required) — The unique identifier of the job ## Response ### 200 OK - `job_id` (string, required) — The unique identifier of the job. - `status` (string, required) — Current status of the job. Terminal statuses: `completed`, `partially_completed`, `failed`, `rejected`. - `pipeline` (string, required) — Job pipeline: `digitise` or `extract`. - `usage` (DocAIUsage, required) - `created_at` (string, required) — Job creation timestamp. - `updated_at` (string, required) — Timestamp of the last job update. ## Errors ### 404 Not Found Error Job not found - `type` (string, optional, default: about:blank) — A URI reference to human-readable documentation for the error. - `title` (string, optional) — A short, human-readable summary of the problem type. - `status` (integer, optional) — HTTP status code. - `detail` (string, optional) — A human-readable explanation specific to this occurrence of the problem. - `instance` (string, optional) — A URI reference that identifies the specific occurrence of the problem. - `errors` (list of DocAIErrorDetail, optional, nullable) — Optional list of individual error details. ## Types ### DocAIUsage - `pages_total` (integer, optional) — Total pages in the job. - `pages_processed` (integer, optional) — Pages processed so far. - `pages_succeeded` (integer, optional) — Pages processed successfully. - `pages_failed` (integer, optional) — Pages that failed processing. ### DocAIErrorDetail - `location` (string, optional) — Where the error occurred, e.g. 'body.items[3].tags' or 'path.thing-id'. - `message` (string, optional) — Error message text. - `value` (any, optional) — The value at the given location. ## 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** ```python import requests url = "https://api.sarvam.ai/doc-ai/v1/job/job_id/status" headers = {"api-subscription-key": ""} response = requests.get(url, headers=headers) print(response.json()) ``` ```javascript const url = 'https://api.sarvam.ai/doc-ai/v1/job/job_id/status'; const options = {method: 'GET', headers: {'api-subscription-key': ''}}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```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", "") 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"] = '' response = http.request(request) puts response.read_body ``` ```java import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.get("https://api.sarvam.ai/doc-ai/v1/job/job_id/status") .header("api-subscription-key", "") .asString(); ``` ```php request('GET', 'https://api.sarvam.ai/doc-ai/v1/job/job_id/status', [ 'headers' => [ 'api-subscription-key' => '', ], ]); 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", ""); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let headers = ["api-subscription-key": ""] 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() ```