> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.emtelligent.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.emtelligent.com/_mcp/server.

# Job Status

GET /jobs/{job_id}

Pipeline status + counters + service gauges.

``?timings=true`` adds ``page_timings`` (per-stage stats + per-page
timeline). Off by default, so the common poll skips the span-log read.

Reference: https://docs.emtelligent.com/ocr/api/job-status-jobs-job-id-get

## Request

### Path parameters

- `job_id` (string, required)

### Query parameters

- `timings` (boolean, optional, default: false)

## Response

### 200

Successful Response

- `job_id` (string, required)
- `filename` (string, required)
- `state` (enum, required)
  - Allowed values: `queued`, `rendering`, `ocr`, `done`, `failed`
- `created_at` (string, required)
- `updated_at` (string, required)
- `render` (RenderStage, required)
- `ocr` (OCRStage, required)
- `mime_type` (enum, optional, nullable)
  - Allowed values: `application/pdf`, `image/jpeg`, `image/png`, `image/tiff`
- `finished_at` (string, optional, nullable)
- `results_expire_at` (string, optional, nullable)
- `results_purged_at` (string, optional, nullable)
- `purge_reason` (enum, optional, nullable) — Why a job's content artifacts were removed (see retention.py).
  - Allowed values: `expired`, `deleted`
- `purged_by` (string, optional, nullable)
- `error` (string, optional, nullable)
- `page_timings` (PageTimingReport, optional, nullable) — Per-page timing for both stages, computed live from the span log.
- `ocr_service` (map from string to integer, optional, nullable)
- `page_budget` (map from string to integer, optional, nullable)
- `render_pool` (map from string to integer, optional, nullable)
- `result_available` (boolean, optional, default: false)

## Errors

### 422 Unprocessable Entity Error

Validation Error

- `detail` (list of ValidationError, optional)

## Types

### RenderStage

- `total_pages` (integer, optional, nullable)
- `rendered` (integer, optional, default: 0)
- `failed` (integer, optional, default: 0)
- `loaded_from_log` (integer, optional, default: 0)
- `in_flight_pages` (integer, optional, default: 0)

### OCRStage

- `submitted` (integer, optional, default: 0)
- `completed` (integer, optional, default: 0)
- `failed` (integer, optional, default: 0)
- `in_flight` (integer, optional, default: 0)

### PageTimingReport

Per-page timing for both stages, computed live from the span log.

- `render` (PageTimingStats, optional) — Distribution of per-page wall-clock durations for one stage, in ms. Folded from the job's span log (spans.jsonl). ``count`` is the number of pages that have *finished* this stage; pages still in flight are reported by the live stage counters (render.in_flight_pages / ocr.in_flight), not here. All summary fields are None until at least one page has finished.
- `ocr` (PageTimingStats, optional) — Distribution of per-page wall-clock durations for one stage, in ms. Folded from the job's span log (spans.jsonl). ``count`` is the number of pages that have *finished* this stage; pages still in flight are reported by the live stage counters (render.in_flight_pages / ocr.in_flight), not here. All summary fields are None until at least one page has finished.
- `span_ms` (double, optional, nullable)
- `pages` (list of PageTiming, optional)

### ValidationError

- `loc` (list of ValidationErrorLocItems, required)
- `msg` (string, required)
- `type` (string, required)
- `input` (any, optional)
- `ctx` (ValidationErrorCtx, optional)

### PageTimingStats

Distribution of per-page wall-clock durations for one stage, in ms. Folded from the job's span log (spans.jsonl). ``count`` is the number of pages that have *finished* this stage; pages still in flight are reported by the live stage counters (render.in_flight_pages / ocr.in_flight), not here. All summary fields are None until at least one page has finished.

- `count` (integer, optional, default: 0)
- `total_ms` (double, optional, default: 0)
- `min_ms` (double, optional, nullable)
- `max_ms` (double, optional, nullable)
- `mean_ms` (double, optional, nullable)
- `p50_ms` (double, optional, nullable)
- `p95_ms` (double, optional, nullable)
- `slowest_page` (integer, optional, nullable)

### PageTiming

One page's timeline row. All ms values are offsets from t0 (the first page span's start across the job), so render/OCR bars can be drawn on a shared axis. ``*_ms`` durations are the bar lengths. Fields are None for a stage the page has not finished.

- `page` (integer, required)
- `render_start_ms` (double, optional, nullable)
- `render_end_ms` (double, optional, nullable)
- `render_ms` (double, optional, nullable)
- `ocr_start_ms` (double, optional, nullable)
- `ocr_end_ms` (double, optional, nullable)
- `ocr_ms` (double, optional, nullable)

### ValidationErrorLocItems

- string
- integer

### ValidationErrorCtx

## Examples

**Response**

```json
{
  "job_id": "string",
  "filename": "string",
  "state": "queued",
  "created_at": "string",
  "updated_at": "string",
  "render": {
    "total_pages": 1,
    "rendered": 0,
    "failed": 0,
    "loaded_from_log": 0,
    "in_flight_pages": 0
  },
  "ocr": {
    "submitted": 0,
    "completed": 0,
    "failed": 0,
    "in_flight": 0
  },
  "mime_type": "application/pdf",
  "finished_at": "string",
  "results_expire_at": "string",
  "results_purged_at": "string",
  "purge_reason": "expired",
  "purged_by": "string",
  "error": "string",
  "page_timings": {
    "render": {
      "count": 0,
      "total_ms": 0,
      "min_ms": 1.1,
      "max_ms": 1.1,
      "mean_ms": 1.1,
      "p50_ms": 1.1,
      "p95_ms": 1.1,
      "slowest_page": 1
    },
    "ocr": {
      "count": 0,
      "total_ms": 0,
      "min_ms": 1.1,
      "max_ms": 1.1,
      "mean_ms": 1.1,
      "p50_ms": 1.1,
      "p95_ms": 1.1,
      "slowest_page": 1
    },
    "span_ms": 1.1,
    "pages": [
      {
        "page": 1,
        "render_start_ms": 1.1,
        "render_end_ms": 1.1,
        "render_ms": 1.1,
        "ocr_start_ms": 1.1,
        "ocr_end_ms": 1.1,
        "ocr_ms": 1.1
      }
    ]
  },
  "ocr_service": {},
  "page_budget": {},
  "render_pool": {},
  "result_available": false
}
```

**SDK Code**

```python
import requests

url = "https://api.example.com/jobs/job_id"

response = requests.get(url)

print(response.json())
```

```javascript
const url = 'https://api.example.com/jobs/job_id';
const options = {method: 'GET'};

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.example.com/jobs/job_id"

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

	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.example.com/jobs/job_id")

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

request = Net::HTTP::Get.new(url)

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.example.com/jobs/job_id")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.example.com/jobs/job_id');

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

```csharp
using RestSharp;

var client = new RestClient("https://api.example.com/jobs/job_id");
var request = new RestRequest(Method.GET);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let request = NSMutableURLRequest(url: NSURL(string: "https://api.example.com/jobs/job_id")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"

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()
```