Skip to main content

Judge Decision

Accept or decline the LLM judge recommendation for an N-Shot comparison. Accepted decisions apply the recommended shot value as an override automatically.

POST /v1/jobs/runs/{runId}/nshot/judge-decision accepts or declines the LLM judge's recommendation for a specific N-Shot comparison. When a run has both N-Shot and the LLM judge enabled in its validation configuration, the judge evaluates flagged (yellow/red) cells and records a judgement on each: a recommended_shot, the recommended_value, and a reasoning string explaining the choice. This endpoint records your verdict on that recommendation.

When accepted is true, the recommended shot's value is automatically applied as an override with actor_id: "judge" — no separate call to the override endpoint is needed. When false, the recommendation is recorded as declined and no override is applied; the cell keeps its majority value unless you override it manually. Either way the judgement is stamped with decided_by: "api" and a decided_at timestamp, and the full updated comparison is returned.

The intended workflow is batch review: fetch the run's [comparisons](nshot-list-shots), filter for entries where judgement.accepted is null, read each recommendation's reasoning, and submit decisions in a loop. Because accepting creates the override in the same call, a full review pass over a run is one GET plus one POST per pending recommendation.

Decisions are revisable: submitting a new decision with the opposite accepted value updates the judgement record. Note the asymmetry — accepting applies an override, but a later decline does not remove the override it created. To change the applied value after accepting, submit a [manual override](nshot-select) for the cell, which replaces the judge's override with your own.

A decision on a comparison that has no judge recommendation is a no-op: the comparison is returned unchanged and nothing is recorded. Only runs whose validation configuration enabled the LLM judge produce judgements, and only on flagged cells.
POST/v1/jobs/runs/{runId}/nshot/judge-decision

Body parameters

document_id*uuidDocument ID.
field_name*stringField name.
accepted*booleanWhether to accept the LLM judge recommendation.

Request

curl -X POST https://api.talonic.com/v1/jobs/runs/a1b2c3d4-e5f6-7890-abcd-ef1234567890/nshot/judge-decision \
  -H "Authorization: Bearer tlnc_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "document_id": "d4e5f6a7-b8c9-0123-defa-234567890123",
    "field_name": "total_amount",
    "accepted": true
  }'

Response

Response fields

idstringComparison UUID.
run_idstringJob run UUID.
document_idstringDocument UUID.
field_namestringField name.
statusstringAgreement status — unchanged by the decision.
majority_valuestring | nullOriginal majority value.
valuesarrayPer-shot entries: shot_number, value, confidence, source_text.
overrideobject | nullOverride created automatically when accepted is true (actor_id "judge").
judgementobjectThe updated judgement record.
judgement.recommended_shotintegerShot number the LLM recommended.
judgement.recommended_valuestring | nullValue the LLM recommended.
judgement.reasoningstringThe judge's explanation of the recommendation.
judgement.acceptedbooleanThe decision just recorded.
judgement.decided_bystringAlways "api" when decided via this endpoint.
judgement.decided_atstringISO 8601 timestamp of the decision.

Response

{
  "id": "5f8e2b1a-3c4d-4e5f-8a9b-0c1d2e3f4a5b",
  "run_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "document_id": "d4e5f6a7-b8c9-0123-defa-234567890123",
  "field_name": "total_amount",
  "status": "yellow",
  "agreement_score": 0.6667,
  "majority_value": "12450.00",
  "comparison_method": "exact",
  "values": [
    { "shot_number": 1, "value": "12450.00", "confidence": 0.95, "source_text": "Total due: 12,450.00 EUR" },
    { "shot_number": 2, "value": "12450.00", "confidence": 0.94, "source_text": "Total due: 12,450.00 EUR" },
    { "shot_number": 3, "value": "12,450.00", "confidence": 0.91, "source_text": "Total due: 12,450.00 EUR" }
  ],
  "override": {
    "selected_shot": 1,
    "actor_id": "judge",
    "overridden_at": "2026-07-14T11:05:00.000Z",
    "from_value": "12450.00",
    "to_value": "12450.00"
  },
  "judgement": {
    "recommended_shot": 1,
    "recommended_value": "12450.00",
    "reasoning": "Shots agree on the amount; shot 3 kept the thousands separator. The canonical decimal form matches the field's number type.",
    "accepted": true,
    "decided_by": "api",
    "decided_at": "2026-07-14T11:05:00.000Z"
  },
  "created_at": "2026-07-14T10:32:00.000Z",
  "links": {
    "self": "/v1/jobs/runs/a1b2c3d4-e5f6-7890-abcd-ef1234567890/nshot/comparison?document_id=d4e5f6a7-b8c9-0123-defa-234567890123&field_name=total_amount"
  }
}

Errors

Error responses

400validation_errorThe request body failed validation, e.g. document_id is not a UUID or accepted is not a boolean.
401unauthorizedMissing or invalid API key.
403forbiddenThe API key lacks the write scope required by this endpoint.
404not_foundNo job run with this ID exists for your organization, or no comparison found for the given document_id and field_name.
429rate_limitedDaily request quota for your tier reached. The counter resets at midnight UTC.

Frequently asked questions

What happens if there is no LLM judge recommendation to accept?+
The decision is a no-op: the comparison is returned unchanged, no judgement is recorded, and no override is applied. Check judgement on the comparison first; only comparisons with an existing recommendation can receive decisions.
Can I change a judge decision after submitting it?+
Yes — submit a new decision with the opposite accepted value and the judgement record updates. But declining after accepting does not remove the override that acceptance created; use the override endpoint to change the applied value manually.
How do I batch-review judge recommendations?+
List comparisons via GET /v1/jobs/runs/{runId}/nshot/comparisons, filter for entries where judgement.accepted is null, and call this endpoint for each with accepted: true or false. Accepted decisions create the override automatically, so no separate override call is needed.
Why do some flagged comparisons have no judgement?+
The judge runs only when the run's validation configuration enables it alongside N-Shot, and it evaluates flagged cells at comparison time. A run configured with N-Shot alone produces comparisons without judgements — review those with manual overrides instead.