Review Queue API
Programmatically interact with the CargoLint review queue to list, correct, approve and skip document extractions.
For dashboard-based review instructions, see How to Review Documents.
Listing the Review Queue
curl -X GET "https://api.cargolint.com/api/v1/review?page=1&pageSize=20" \
-H "X-API-Key: YOUR_API_KEY"
The queue holds the documents in RequiresReview and PendingApproval, leaving out documents replaced by a newer version in their shipment. The response is { items, totalCount, page, pageSize }. Each item carries the document’s qualityScore (0 to 100), its qualityLevel (none, warning or serious), problemCount, the problems that need fixing and warnings the score counts (null when the document is not scored), flaggedFieldCount, the number of fields a counted problem is about, and source (Email for a document that arrived by email). The queue’s documents are the ones GET /documents?status=RequiresReview,PendingApproval lists.
Query parameters:
| Parameter | Description |
|---|---|
page, pageSize |
Pagination; defaults 1 and 20, pageSize at most 100 |
sortBy |
document, reference, status, qualityScore, problems, flagged or date (the default) |
sortDir |
asc for ascending; anything else sorts descending |
documentType |
A kind id, such as Invoice or AirWaybill |
search |
Text to match |
startDate, endDate |
Upload date range |
GET /api/v1/review/stats returns { pendingReviewCount, reviewedToday }.
Getting Review Details
curl -X GET https://api.cargolint.com/api/v1/review/{document_id} \
-H "X-API-Key: YOUR_API_KEY"
Returns the document’s details, its qualityScore and qualityLevel, and its extracted fields, each with fieldName, value, confidence (the AI’s rating of how clearly it read the value) and boundingBox. GET /api/v1/documents/{document_id}/issues lists the problems and the fields each is about.
Submitting Corrections
Submitting corrections approves the document with the corrected values:
curl -X POST https://api.cargolint.com/api/v1/review/{document_id} \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"correctedFields": [
{
"fieldName": "InvoiceId",
"originalValue": "INV-2026-00l234",
"correctedValue": "INV-2026-001234"
}
],
"removedLineItemIndices": []
}'
The response gives the new status (Completed), the number of fields corrected, and the next document waiting for review with the count remaining.
Approving Without Changes
curl -X POST https://api.cargolint.com/api/v1/review/{document_id}/approve \
-H "X-API-Key: YOUR_API_KEY"
Skipping a Document
curl -X POST https://api.cargolint.com/api/v1/review/{document_id}/skip \
-H "X-API-Key: YOUR_API_KEY"
A skipped document has the status Skipped and leaves the queue. It can still be corrected or approved later.
A document of a kind CargoLint recognizes but does not read yet (Recognized) has no fields and cannot be submitted, approved or skipped.
What Routes a Document to Review
Documents are routed to RequiresReview when the reading found one problem that needs fixing, or two warnings, HS codes await confirmation, the scan is degraded, the document’s own checks found an exact sanctions match, a CITES Appendix I species or a check that did not complete, or a shipment consistency check finds a conflict. There is no score threshold: problems in the document itself, such as a missing field or totals that do not add up, lower the Quality score (10% per warning, 20% per problem that needs fixing, down to 0%) without routing it. See How the Quality Score Works.