Bulk Delete Inbox Documents
POST/api/document-inbox/bulk-destroy
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.
Request body:
items(required, array, min:1) — list of extractions to deleteitems.*.type(required, string, in:customer_po,supplier_invoice) — which OCR extraction model the id belongs toitems.*.id(required, integer) — extraction ID
Behavior:
- Validates the entire payload with Laravel validation (returns 422 on shape errors)
- Iterates each item; routes
customer_potoCustomerPOOcrManager::deleteExtraction()andsupplier_invoicetoSupplierInvoiceOcrManager::deleteExtraction() - Both managers delete the S3 file (if any) and the DB record
- Confirmed extractions are SKIPPED (cannot be deleted — same constraint as the single-record DELETE endpoints)
- Missing IDs are reported in
not_foundrather than failing the whole request — partial success is allowed
Response 200:
{
"deleted": 2,
"skipped": [
{ "type": "customer_po", "id": 91, "reason": "confirmed" }
],
"not_found": [],
"message": "2 document(s) deleted successfully. 1 skipped (confirmed)."
}
Request
Responses
- 200
Successful response