2026 customs changesWhat it means

API Reference

Shipment Endpoints
CargoLint REST API.

List, inspect, add to, re-evaluate, settle, export and share shipments, the document bundles behind the cross-document checks.

Shipment Endpoints

A shipment groups the documents that travel together: the invoice, packing list, transport documents, certificates and declarations. CargoLint checks them against each other (Shipment Consistency Checks) and builds an expected-documents checklist for the shipment’s destination. Every upload joins a shipment; see How a document joins a shipment.

All endpoints are scoped to your organization. A shipment of another organization returns 404. The checklist, shipment facts, dispositions, line links and destination endpoints have their own page: Checklist and Shipment Facts.

List shipments

GET /shipments
Parameter Default Description
status - pass, warning, error, pending (never evaluated) or settled. pass, warning and error match open shipments whose latest evaluation has that overall status
search - Text within the reference
startDate, endDate - Range on the latest evaluation date
sortBy most recently updated reference, status, evaluated or updated
sortDirection desc asc or desc
page, pageSize 1, 25 Paging; pageSize at most 100
{
  "items": [
    {
      "id": "0c9a7b6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d",
      "reference": "Shipment-2026-10-22-004",
      "isSettled": false,
      "documentCount": 4,
      "latestConsistencyReportId": "5d6e7f80-1a2b-4c3d-8e9f-0a1b2c3d4e5f",
      "latestOverallStatus": "Warning",
      "latestGeneratedAt": "2026-10-22T10:32:05Z",
      "errorCount": 0,
      "warningCount": 2,
      "infoCount": 1,
      "evaluationPending": false,
      "createdAt": "2026-10-22T10:30:00Z",
      "updatedAt": "2026-10-22T10:32:05Z"
    }
  ],
  "total": 1,
  "page": 1,
  "pageSize": 25
}

evaluationPending is true while a newer evaluation is still due, including one queued by a declared fact, a correction or a skip, so the status shown is provisional. The finding counts never include the expected-documents checklist.

Status summary

GET /shipments/status-summary

Counts the organization’s shipments by state: total, settled, consistent, needsReview, critical, awaitingCheck and needsDocuments.

Get shipment detail

GET /shipments/{id}

Returns the shipment, its documents and its latest evaluation:

Field Description
id, reference, userSetReference, isSettled, createdAt, updatedAt The shipment
evaluationPending A newer evaluation is still due
comparableDocumentCount Active documents the checks can compare: not replaced, not failed and not recognized only. The checks run from two; with fewer the shipment needs documents
correctionCount Reviewer corrections across its documents
documents Every attached document, including replaced ones: id, fileName, title, status, detectedDocumentType, createdAt, processedAt, generatedFromId, supersededByDocumentId, supersededAt
deletedDocuments Documents deleted recently, until they are purged
latestReport The latest consistency evaluation: id, engineVersion, generatedAt, overallStatus and ruleResults
route The destination, export country, first port of arrival and legs the shipment is checked against, and documentsDestination, the destination the documents’ consignee addresses give even while one set on the shipment replaces it
destinationOverride, destinationOverrideSetAt, destinationOverrideSetBy A destination set on the shipment, which replaces the one read from its documents
coverage What the checks covered and what they could not check
destinationFindings Findings from the destination’s requirements on each active document, listed apart from the consistency findings
checklist The expected-documents checklist
declaredFacts Facts users declared about the shipment

route, coverage, checklist, declaredFacts and the destination fields are described in Checklist and Shipment Facts.

Each entry of latestReport.ruleResults is one finding:

{
  "id": "9e8d7c6b-5a49-4382-a1b0-c9d8e7f6a5b4",
  "ruleId": "shipment.package-count-consistency",
  "ruleVersion": "1.2.0",
  "severity": "Warning",
  "reasonCode": "PACKAGE_COUNT_BOL_PL_MISMATCH",
  "message": "Total packages on the bill of lading (40) and packing list (42) don't agree.",
  "evidenceJson": "{...}",
  "contributingDocumentIds": "6b0f7c1e-2d1a-4a8e-9f0e-1c2b3d4e5f60,1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
  "profileId": null,
  "profileVersion": null,
  "explanation": "What the finding means and what to check."
}
  • severity is Error, Warning or Info; latestReport.overallStatus is Error, Warning or Pass.
  • evidenceJson is a JSON string with the values each document gave.
  • contributingDocumentIds is a comma-separated list of the documents behind the finding.
  • explanation says what the finding means; it is null when the message says everything.

A missing expected document is never a finding here and never changes overallStatus; it is a row of the checklist. A shipment with fewer than two active documents has no report; its route, coverage and checklist are still returned.

Reference helpers

GET   /shipments/next-reference                 - preview the next generated reference
GET   /shipments/check-reference?reference=...  - whether a reference is free
GET   /shipments/suggest?q=...                  - type-ahead over references, document numbers, parties and extracted values
PATCH /shipments/{id}/reference                 - { "reference": "..." }, up to 64 characters

next-reference takes an optional timeZone (IANA, such as America/Toronto): the reference then carries that day’s date, as the reference of a document uploaded with the same timeZone does; without it, the UTC date. suggest finds a shipment by its own reference even before it holds a document, leaves settled shipments out unless excludeSettled=false, and returns up to 25 results (limit, default 10). Renaming returns 409 when another shipment already uses the reference or when the shipment is settled, and updates the reference on every attached document.

Add documents to a shipment

POST /shipments/{id}/documents

Multipart upload of one or more files in files (or a single file). An optional uploadBatchId query parameter groups them; several files sent together share a batch either way. The same file rules apply as for uploads, with up to 50 MB per request.

curl -X POST "https://api.cargolint.com/api/v1/shipments/{id}/documents" \
  -H "X-API-Key: cl_YOUR_API_KEY" \
  -F "files=@packing-list.pdf" \
  -F "files=@certificate-of-origin.pdf"
{
  "documentIds": ["...", "..."],
  "shipmentReference": "Shipment-2026-10-22-004",
  "reEvaluationJobId": "0c9a7b6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d"
}

Returns 409 when the shipment is settled. Each file counts as one document against the plan. A document of a kind the shipment already holds replaces the older one for checks, as described in Document Kinds and Statuses; the older one stays attached. Poll the shipment detail for the new evaluation.

Create a blank document

POST /shipments/draft-document
{ "documentType": "AirWaybill", "shipmentId": "0c9a7b6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d" }

Creates an empty document of a kind CargoLint reads, to be filled in by hand, and returns documentId and shipmentId. Pass a shipmentId or a shipmentReference; without either, the document starts a new shipment. A kind CargoLint does not read returns 400. The new document counts against the plan, and its checks run when it is first saved.

Re-evaluate

POST /shipments/{id}/reevaluate

Runs the shipment’s evaluation now and returns reportId and overallStatus. While a document’s own checks are still running it answers 202 with a Retry-After header, and the evaluation runs on its own once they are in. A shipment with fewer than two active documents answers 409, and an unknown shipment 404. Evaluations also run on their own whenever a document of the shipment is read, corrected, added or deleted, and when a fact, a line link or the destination changes.

Settle and re-open

POST /shipments/{id}/settle
POST /shipments/{id}/unsettle

Settling marks the shipment as finished and queues a push through every active connection that sends on settle; see Pushes to your systems. It returns 409 while an active document is still in RequiresReview or PendingApproval, with the reason in error (such as "2 documents still need review") and the count in unreviewedDocuments; a document that could not be read (Failed) does not block it. A settled shipment is locked: adding documents, creating a document in it, renaming it, changing its destination, facts, invoice line links or checklist dispositions, and submitting, approving or resolving corrections on its documents return 409 with {"error": "This shipment is settled. Re-open it to change it."}. Unsettling re-opens it. Both are idempotent.

Pushes to your systems

GET    /shipments/{id}/pushes                    - the shipment's pushes, newest first, and its links
POST   /shipments/{id}/pushes                    - { "connectionId": "...", "acknowledge": false }
POST   /shipments/{id}/pushes/review             - { "connectionId": "...", "operation": "patch" }
POST   /shipments/{id}/pushes/approvals          - { "reviewToken": "..." }
POST   /shipments/{id}/links                     - { "connectionId": "...", "reference": "OIM-24117" }
DELETE /shipments/{id}/links/{connectionId}
GET    /shipments/{id}/pushes/{pushId}/file      - the file a file connection rendered

A push sends the shipment’s approved data through one of the organization’s connections. Creating and changing connections is a separate set of endpoints for an Owner or Admin, signed in.

List and send

Any member can list and send, and so can the organization’s API key, which is then recorded as the push’s actor.

GET answers { items, links }: the pushes, newest first, and one link per connection that holds a record for the shipment.

POST /pushes queues a push and answers 200 with pushId. Through a direct connection it fills the linked job with every approved document’s values, first looking the job up when the shipment has none, at any time. Through a file connection it renders the file of a settled shipment. It answers:

  • 404 for an unknown shipment, or an unknown, deleted or another organization’s connection
  • 409 when the connection is disabled, when a file connection’s shipment is not settled, or when acknowledge is sent for a direct connection, whose overwrites go through a review
  • 403 with "code": "PLAN_FEATURE_UNAVAILABLE" when the plan does not include the connection

After a file push ends as changes_pending, "acknowledge": true sends the second file that outcome warned about.

Review and approve

A create on a direct target, a write of values the job already holds, a guarded field and a full update of a target that cannot be read back are sent only once a signed-in Owner or Admin approves them. The organization’s API key receives 403, and so does a member.

POST /pushes/review reads the job now and answers what the operation would do:

Field Description
operation create, patch (write chosen values to the linked job) or update (replace the record in full). When the request names none: create without a link, patch with one on a target that can be read back, update otherwise
connectionId, connectionName, targetId, targetLabel Where it goes
externalIds, recordUrl The linked job; null for a create
writes Each value it writes: path, targetValue (what the job holds, null when empty) and recordValue
held Each value it leaves alone: path, targetValue, recordValue, reason (finding or notOnJob) and detail
blockers What stops it now, such as a document a create still needs or checks still running
protection vendorCondition, readCompare or none: how the writes are protected against a change made in the target meanwhile
reviewToken, expiresAt The token that approves exactly this, valid for 30 minutes; both null while anything in blockers remains

POST /pushes/approvals with that token queues the push and answers 200 with pushId. The same token approved again answers the same pushId. The approval binds the shipment’s approved data, the connection’s settings, the job and the values: when any of them changed, it answers 409 and asks for a new review. The push it queues checks them again before it writes, and ends as needs_review, writing nothing, when they no longer match.

Both answer:

  • 400 for an operation that does not exist
  • 403 for the API key, a member, a token another user reviewed, or a plan without the connection
  • 404 for an unknown shipment or connection
  • 409 when the operation does not apply (a file connection, a create on a shipment already linked, a patch without a link), when the review expired or something changed, or when a push to the same job is still active
  • 502 when the target could not be reached to read the job

POST /links reads the job the reference names in the target, confirms it belongs to the shipment, and stores the link; it answers 200 with the link. A connection that fills on approval then fills the job with every approved document’s values. The link appears in the shipment’s pushes as a push with operation link, and sends push.sent. It answers:

  • 400 without a reference
  • 403 for the API key or a member
  • 404 for an unknown shipment or connection
  • 409 when the shipment is already linked through the connection (unlink it first) or the target cannot look a job up
  • 422 when the target has no such job, or the job does not confirm, with the reason in error, such as The GoFreight job OIM-24117 carries the master bill MAEU1234567; the shipment's is MAEU7654321.
  • 502 when the target could not be reached

DELETE /links/{connectionId} removes the link and answers 204; 404 when there is none, 409 while a push to the job is active.

Each link carries:

Field Description
connectionId, connectionName, connectionDeleted, targetId The connection
externalIds, reference, recordUrl The target’s identifiers for the record, its reference, and where it opens when the target has a page for it
linkSource created (a push created it), found (the target’s lookup keys found it) or manual (a person gave its reference)
linkedAt, linkedByUserId, lastSentAt When it was linked, by whom for a manual link, and when CargoLint last wrote to it

Each push

Field Description
id, connectionId, connectionName, targetId The push and where it went
connectionDeleted The connection was deleted since; the push stays listed
operation create, link, fill, patch or update
triggerDocumentId For a fill queued by a document’s approval: that document
outcome pending, sending, accepted, outcome_unknown, sent, unchanged, changes_pending, needs_review or failed; labels for each come from GET /config as pushStatuses
triggeredBy system for a push on approval or settle, the organization's API key, or the user id
approvedBy The Owner or Admin whose approval the push carries
createdAt, completedAt, attempts, attemptHistory, lastError When it ran, each attempt’s time, outcome and error, and the last error
externalIds, recordUrl The target’s identifiers, and where the record opens when the target has a page for it
written The values written to the job: path, targetValue (what it held before) and recordValue
differences Values changed in the target and left alone: path, targetValue, recordValue
held Values left alone for another reason: path, targetValue, recordValue, reason (changedInCargoLint, guarded, finding or notOnJob) and detail
searched, adopted The lookup keys tried, such as master bill MAEU1234567, and whether the job was found by them
blockers What still stops a create or a write
changedFields For changes_pending: the fields that changed since the last send
pendingAction For changes_pending: createDuplicate (a second file, sent with acknowledge) or overwrite (a full update, sent through a review)
partsNotSent, notIncluded The record parts this target does not send, and the documents left out with their status
artifactsAttached, attachError How many corrected PDF exports were attached, and why not when they could not be
fileName, fileDownloadPath, emailOutcome For a file: its name, its download path while it is kept, and whether it was emailed (sent, unconfirmed, tooLarge or none)

A file is kept for 30 days; after that the download answers 404. Pushes and links are served only by these endpoints: the shipment detail, a partner’s view of a shared shipment, a share link and the audit packet carry none of them.

Audit packet

POST /shipments/{id}/audit-packet

Returns a ZIP with shipment.json, the latest consistency report (shipment-consistency.json) and, for each document under documents/{documentId}/, the same files as the document audit packet.

Table export

GET /shipments/{id}/export?format=xlsx
GET /shipments/{id}/export?format=csv

Every current document’s corrected fields and line items as one table, a row per line item. See Export Formats.

POST /shipments/{id}/share          - { "recipients": [ { "email": "...", "company": "..." } ] }
GET  /shipments/shares/quota
GET  /public/shared-shipments                   - the link's token in the X-Link-Token header, never in the URL

Sends a read-only summary of the shipment’s results to people outside your organization, with the same limits as document sharing. It needs a user session, and returns 409 until the shipment has been evaluated.

Partner sharing

A partnership links two CargoLint organizations. Once the other organization accepts the request, an Owner or Admin can share a shipment with the partner, whose members then see the shipment’s documents, findings, checklist and coverage, read-only and live, until the share or the partnership ends. These endpoints need a user session; an API key receives 401. Reading is open to every member; requesting, accepting, declining, revoking and sharing need the Owner or Admin role.

GET    /partners                                   - partnerships, with Status Pending, Active, Declined, Revoked or Cancelled
POST   /partners/requests                          - { "email": "...", "companyName": "..." }
POST   /partners/{id}/accept | decline | revoke
GET    /shipments/{id}/partner-grants              - the partners a shipment is shared with
POST   /shipments/{id}/partner-grants              - { "partnershipId": "..." }
DELETE /shipments/{id}/partner-grants/{grantId}
GET    /partners/shared-shipments                  - shipments partners share with you
GET    /partners/shared-shipments/{grantId}        - one of them: the owner's shipment detail, read-only
GET    /partners/shared-shipments/{grantId}/documents/{documentId}/content

What’s next