Document Inbox
List Inbox Documents
Return a unified, paginated, descending-by-created_at list combining customer PO, supplier invoice, vendor credit, and landed cost invoice OCR extractions. Each item is normalized to the same shape so a single mixed-type list can be rendered. Vendor credit extractions that are attached to an existing vendor credit (vendor_credit_attachment_id set) are excluded — they belong to that credit's documents, not the inbox.
Get Pending Count
Lightweight count of all extractions currently in 'pending_review' status (sales + purchase + vendor credit + landed cost invoice). Vendor credit extractions that belong to an existing credit (vendor_credit_attachment_id set) are excluded from the count. Polled by the navigation drawer every 60 seconds to render the inbox badge.
Retry Failed Extraction
Re-dispatch OCR processing for a failed extraction. Path param `type` must be one of `customer_po`, `supplier_invoice`, `vendor_credit`, or `landed_cost_invoice` (regex-constrained); `id` is the matching extraction ID.
Bulk Delete Inbox Documents
Bulk-delete a polymorphic mix of OCR extractions from the unified Document Inbox. Powers the bulk-actions toolbar shown when rows are selected in the inbox UI.
Get Adjacent Documents
Returns the previous and next document in the unified inbox relative to the given extraction. Powers the prev/next pager on the OCR review pages so the user can walk through the queue without bouncing back to the inbox list.
Reclassify Document Type
Reclassify an inbox extraction as a different document type — the user-facing escape hatch when automatic type detection got it wrong. Copies the original file into the target pipeline, creates a new extraction there, and rejects the source extraction with a back-reference.