Discrepancy Runs
Compare a batch of documents for facts they state differently with a discrepancy run, and read each disagreement with its severity, values and quotes.
A discrepancy run compares a batch of documents and finds the facts they state differently, for instance two documents that give different totals, dates or party names for the same subject. It is the right tool when no rule exists yet and the question is only whether the documents agree with each other. For judging documents against a framework's rules, use evaluations; for judging a group of documents together against rules, use document sets.
A run starts with POST /v1/compliance/discrepancy-runs, returns at once, waits for the text of every document, and then makes one model call. With the external decider the run waits as a task for the workspace's own agent instead (status: "waiting"). A run is pending, processing, waiting, completed or error; a processing run older than the staleness limit reads as error.
Counts and lists consider only documents whose framework is ON. documents[].active tells whether a document's framework is ON, discrepancy_count counts the discrepancies at least two active documents still disagree on, and active_document_count counts the documents that take part. The detail route lists only the discrepancies at least two documents of ON frameworks still disagree on, with only those documents' values, so turning a framework OFF removes it from a run's result without deleting the run.
/v1/compliance/discrepancy-runsBody fields
cURL: Compare two documents
curl -X POST "https://api.talonic.com/v1/compliance/discrepancy-runs" \
-H "Authorization: Bearer $TALONIC_API_KEY" \
-H "Content-Type: application/json" \
-d '{"document_ids": ["5b7e2a91-6c44-4d0f-9a3e-71c8d2f0b6a5", "a83c06d2-9e1f-4b57-8c20-4d7f1e95a6b3"]}'/v1/compliance/discrepancy-runsRun fields
/v1/compliance/discrepancy-runs/{runId}Discrepancy fields
Response: 200 Run with one discrepancy (excerpt)
{
"id": "7c4e19a3-5f08-4d62-b1a7-e3908d56c2f4",
"status": "completed",
"error": null,
"documents": [
{ "id": "5b7e2a91-6c44-4d0f-9a3e-71c8d2f0b6a5", "filename": "supplier-contract.pdf", "deleted": false, "active": true },
{ "id": "a83c06d2-9e1f-4b57-8c20-4d7f1e95a6b3", "filename": "declaration.pdf", "deleted": false, "active": true }
],
"discrepancy_count": 1,
"active_document_count": 2,
"decided_by": null,
"created_at": "2026-10-20T11:02:44.000Z",
"finished_at": "2026-10-20T11:03:21.000Z",
"discrepancies": [
{
"id": "d905e3b8-2a61-4f7c-8e04-6b1c7a52f093",
"subject": "Supplier legal name",
"severity": "medium",
"explanation": "The two documents name different legal entities.",
"values": [
{ "document_id": "5b7e2a91-6c44-4d0f-9a3e-71c8d2f0b6a5", "value": "ACME GmbH", "quote": "between ACME GmbH and the Buyer" },
{ "document_id": "a83c06d2-9e1f-4b57-8c20-4d7f1e95a6b3", "value": "ACME Ltd", "quote": "Supplier: ACME Ltd" }
]
}
]
}