List jobs for a document
curl --request GET \
--url http://localhost:8000/v1/documents/{document_id}/jobs \
--header 'Authorization: Bearer <token>'import requests
url = "http://localhost:8000/v1/documents/{document_id}/jobs"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('http://localhost:8000/v1/documents/{document_id}/jobs', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "8000",
CURLOPT_URL => "http://localhost:8000/v1/documents/{document_id}/jobs",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "http://localhost:8000/v1/documents/{document_id}/jobs"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("http://localhost:8000/v1/documents/{document_id}/jobs")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8000/v1/documents/{document_id}/jobs")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"jobs": [
{
"created_at": "2025-11-27T10:30:00Z",
"document_id": "6789def0-abcd-4567-ef01-23456789abcd",
"job_id": "550e8400-e29b-41d4-a716-446655440000",
"processing_completed_at": "2025-11-27T10:30:45Z",
"processing_time_seconds": 45.2,
"status": "completed"
}
],
"page": 1,
"per_page": 20,
"total": 50
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}jobs
List jobs for a document
List all extraction jobs for a specific document.
Returns the extraction history for a document, including any re-processing attempts. Jobs are ordered from newest to oldest.
Args: document_id: UUID of the document to list jobs for. session_and_auth: Database session and auth context (injected). page: Page number (1-indexed). Values < 1 are normalized to 1. per_page: Items per page (1-100). Values outside range are clamped.
Returns: JobListResponse: Paginated list of jobs for this document.
Raises: HTTPException 404: Document not found or not accessible by tenant.
Edge Cases:
- Document without jobs: Document exists but returns empty jobs list (rare).
- Re-processing history: Multiple jobs show extraction history over time.
- Latest job: First item (page=1, index=0) is the most recent job.
- Tenant isolation: Verifies document ownership before listing jobs.
GET
/
v1
/
documents
/
{document_id}
/
jobs
List jobs for a document
curl --request GET \
--url http://localhost:8000/v1/documents/{document_id}/jobs \
--header 'Authorization: Bearer <token>'import requests
url = "http://localhost:8000/v1/documents/{document_id}/jobs"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('http://localhost:8000/v1/documents/{document_id}/jobs', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "8000",
CURLOPT_URL => "http://localhost:8000/v1/documents/{document_id}/jobs",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "http://localhost:8000/v1/documents/{document_id}/jobs"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("http://localhost:8000/v1/documents/{document_id}/jobs")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8000/v1/documents/{document_id}/jobs")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"jobs": [
{
"created_at": "2025-11-27T10:30:00Z",
"document_id": "6789def0-abcd-4567-ef01-23456789abcd",
"job_id": "550e8400-e29b-41d4-a716-446655440000",
"processing_completed_at": "2025-11-27T10:30:45Z",
"processing_time_seconds": 45.2,
"status": "completed"
}
],
"page": 1,
"per_page": 20,
"total": 50
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
API Key authentication. Format: dk_test_ or dk_live_
Path Parameters
UUID of the document
Query Parameters
Page number (1-indexed)
Required range:
x >= 1Items per page (max 100)
Required range:
1 <= x <= 100Response
Paginated list of extraction jobs for the document