Get document extraction status
curl --request GET \
--url http://localhost:8000/v1/documents/{document_id}/status \
--header 'Authorization: Bearer <token>'import requests
url = "http://localhost:8000/v1/documents/{document_id}/status"
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}/status', 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}/status",
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}/status"
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}/status")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8000/v1/documents/{document_id}/status")
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{
"completed_at": "2025-11-22T18:30:45Z",
"created_at": "2025-11-22T18:30:00Z",
"job_id": "550e8400-e29b-41d4-a716-446655440000",
"processing_time_seconds": 45,
"status": "completed",
"vault_uri": "gs://docintel-vault-prod/tenant-123/2025/550e8400.pdf"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}jobs
Get document extraction status
Check the current extraction status of a document.
Returns the status, timestamps, and processing details for a document’s most recent extraction job.
Args: document_id: UUID of the document to check status for. session_and_auth: Database session and auth context (injected).
Returns: DocumentStatusResponse: Current status with timestamps and processing details.
Raises: HTTPException 404: Document not found or not accessible by tenant. HTTPException 404: No extraction job exists for this document.
Edge Cases:
- Tenant isolation: RLS ensures tenants can only see their own documents. A 404 is returned for documents belonging to other tenants (not 403).
- Multiple jobs: Returns the LATEST job by created_at timestamp. Use GET /documents//jobs to see all jobs for re-processed documents.
- Invalid UUID: FastAPI validates UUID format; returns 422 if invalid.
GET
/
v1
/
documents
/
{document_id}
/
status
Get document extraction status
curl --request GET \
--url http://localhost:8000/v1/documents/{document_id}/status \
--header 'Authorization: Bearer <token>'import requests
url = "http://localhost:8000/v1/documents/{document_id}/status"
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}/status', 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}/status",
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}/status"
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}/status")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8000/v1/documents/{document_id}/status")
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{
"completed_at": "2025-11-22T18:30:45Z",
"created_at": "2025-11-22T18:30:00Z",
"job_id": "550e8400-e29b-41d4-a716-446655440000",
"processing_time_seconds": 45,
"status": "completed",
"vault_uri": "gs://docintel-vault-prod/tenant-123/2025/550e8400.pdf"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Response
Current extraction status with timestamps and processing details
Response for job status queries (GET /v1/documents/{job_id}).