Review Corrections from an Agent
The review loop for an agent: claim an item, inspect the cited page, submit a correction with an Idempotency-Key and read it back. Retries never apply twice.
This is the loop an agent runs to clear review work for a person. Every step acts with that person's permissions, and a retried write never applies twice.
- Claim:
POST /v1/field-reviews/checkoutreturns your batch. - Inspect:
GET /v1/field-reviews/{docId}/{fieldKey}/provenancegives the value, its checks and the cited page; open the page withGET /v1/documents/{id}/file. - Correct:
POST /v1/field-reviews/{docId}/{fieldKey}/resolvewithaction: correct, thecorrected_value, and optionally anevidence_quotefrom the cited document, which is verified verbatim. Send anIdempotency-Key. - Continue: a corrected field resumes the rest of its processing; poll the run (
GET /v1/pipelines/{id}) or listen forrun.completed. - Receipt: the decision log (
GET /v1/field-reviews/decisions?pipeline_id=…) records the prior and final value, the action and the reason.
Submit a correction (safe to retry)
curl -s -X POST https://api.talonic.com/v1/field-reviews/2f6d1e8a-9c44-4b0d-a7f3-5e1c0d9b8a62/invoice_total/resolve \
-H "Authorization: Bearer $TALONIC_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: fix-invoice-total-2f6d" \
-d '{ "action": "correct", "corrected_value": "1240.00", "reason": "Total on page 2", "evidence_quote": "Gesamtbetrag 1.240,00 EUR", "document_id": "9a8b7c6d-5e4f-4a3b-9c2d-1e0f9a8b7c6d" }'Retries and Idempotency-Key
Send an Idempotency-Key (1 to 64 characters, unique per intended write) on review writes. A retry with the same key and the same request returns the stored response, with its original status and the header Idempotent-Replayed: true, and changes nothing. The same key on a different request answers 422 idempotency_key_reused; a retry while the first request is still running answers 409 idempotency_request_in_progress, so wait a moment and retry. A first request that failed leaves no stored response, so its retry runs for real. Keys are scoped to your workspace and replay for 24 hours.