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.
This endpoint currently requires session authentication; Personal Access Token scope support is in progress.
Request body:
items(required, array, min:1) — list of extractions to deleteitems.*.type(required, string, in:customer_po,supplier_invoice,vendor_credit,landed_cost_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_poto the API::deleteExtraction,supplier_invoiceto the API::deleteExtraction,vendor_creditto the API::deleteExtraction, andlanded_cost_invoiceto the API::deleteExtraction(deletes the S3 file and soft-deletes the extraction row) - All managers delete the S3 file (if any) and the DB record (vendor credit deletes skip the S3 delete when the file belongs to an attachment on an existing credit)
- 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
- 401
- 403
- 422
- 429
Successful response
Unauthenticated — the bearer token is missing, revoked, expired, or malformed. Never retry automatically; fix the credential. See the Errors guide.
Forbidden — the token lacks a required scope, the endpoint is not available to API tokens, or the user behind the token lacks the permission. A human must adjust the token scopes or user permissions; do not retry.
Validation failed — the body is a field → messages map (Laravel shape) or the platform envelope with a stable machine-readable code. Fix the payload and resubmit.
Rate limited — platform limit is 1,000 requests/min; individual tokens may carry lower limits. Honor the Retry-After header before retrying. See the Rate Limits guide.