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.
Authorizations
API Key authentication. Format: dk_test_ or dk_live_
Path Parameters
UUID of the document
Response
Current extraction status with timestamps and processing details
Response for job status queries (GET /v1/documents/{job_id}).
Unique identifier for the ingestion job
Current job status
pending, processing, completed, failed GCS path to the document in Cold Vault
Job creation timestamp (ISO 8601)
Processing start timestamp (ISO 8601, null if not started)
Processing completion timestamp (ISO 8601, null if not completed)
Total processing duration in seconds (null if not completed)
Number of pages in the document (null if not processed)
Error details (only present if status is 'failed')