---
title: "Compare a batch of documents for discrepancies"
method: POST
path: "/v1/compliance/discrepancy-runs"
tags: ["Compliance"]
---

# Compare a batch of documents for discrepancies

`POST /v1/compliance/discrepancy-runs`

## Request

- Base URL: `https://api.talonic.com`
- URL: `https://api.talonic.com/v1/compliance/discrepancy-runs`
- Auth: HTTP bearer

Starts a comparison and returns at once; the run waits for every document's text, then makes one model call (or, with the `external` decider, waits as a task).

## Request body

- object
  - `document_ids` string[], required: The configured maximum (20 by default) applies on top.

## Response `201`

The run.

- ComplianceDiscrepancyRun
  - `id` string, uuid
  - `status` 'pending' | 'processing' | 'waiting' | 'completed' | 'error': `waiting`: offered to the workspace's own agent. A `processing` run older than the staleness limit reads `error`.
  - `error` string, nullable
  - `documents` object[]
    - `id` string, uuid
    - `filename` string
    - `deleted` boolean
    - `active` boolean: Whether the document's framework is ON.
  - `discrepancy_count` integer: Discrepancies at least two active documents still disagree on.
  - `active_document_count` integer
  - `decided_by` string, nullable: The external agent's label when the platform's model did not compare.
  - `created_at` string, date-time
  - `finished_at` string, date-time, nullable

## Other responses

- `400`: The request is invalid.
- `403`: The API key does not have the required scope.
- `404`: The requested resource was not found.
- `422`: The request is well-formed but violates the declared task contract.

## Changes

- **2026-10-28** `0a485a46163e`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/talonic/apis/talonic-api/changes/v1/compliance/discrepancy-runs/post.md)

---

[API](https://skmtc.dev/talonic/apis/talonic-api.md) - [All operations](https://skmtc.dev/talonic/apis/talonic-api/llms.txt) - [OpenAPI document](https://skmtc.dev/talonic/apis/talonic-api/revisions/9f6d53e2ab5e?raw)
