Skip to main content

Correct Fields

Fix wrong extraction values with PATCH /v1/extractions/:id/data. Send a map of field names to corrected values; each field is locked at confidence 1.0.

The Correct Fields endpoint, PATCH /v1/extractions/:id/data, submits corrections to specific fields in a completed extraction. The request body is a flat JSON object mapping field names to their corrected values. Corrected fields are locked at confidence 1.0 and will not be overwritten by future re-extractions, so use this to fix extraction errors programmatically.

Only the fields you include in the body change; all other extracted values remain untouched. A field name that does not exist on the extraction is added as a new locked field rather than rejected — useful for filling in a value the extraction missed entirely, but it also means a typo in a field name silently creates a new field instead of correcting the intended one. Match the keys exactly as they appear in the data object of [GET /v1/extractions/:id](get-extraction).

The response returns the full updated extraction, so you can verify the applied values, the recalculated confidence, and the updated locked_fields array in one round trip. Each correction is timestamped internally, and value types are preserved: send 14500.00 as a JSON number to keep the field numeric, since a quoted "14500.00" stores a string. This endpoint requires write scope; POST /v1/extractions/:id/correct is an [exact alias](correct-extraction) — same body, same behavior, same response.

Corrections propagate to every subsequent read: the [data endpoint](get-extraction-fields) and its CSV export return the corrected values, and the recalculated confidence.overall reflects the 1.0 scores of the locked fields. This makes the endpoint a good target for a human-in-the-loop review UI — read the extraction, present low-confidence fields for review, and PATCH the confirmed values back so downstream consumers always see the vetted data.

Corrected fields are locked permanently: re-extraction will not overwrite them, and there is no unlock operation. A later correction to the same field replaces the value but the field stays locked, so treat corrections as authoritative ground truth, not experiments.
PATCH/v1/extractions/:id/data

Request body

{
  "vendor_name": "Acme Corporation Ltd.",
  "total_amount": 14500.00
}

Body parameters

(field_name)*anyEach key is the name of a field to correct; the value is the corrected value. Include one or more fields. Unknown field names are added as new locked fields.

curl

curl -s -X PATCH https://api.talonic.com/v1/extractions/a1b2c3d4-e5f6-7890-abcd-ef1234567890/data \
  -H "Authorization: Bearer tlnc_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{ "total_amount": 14500.00 }'

Response

Response fields

iduuidExtraction UUID.
statusstringExtraction status: complete, processing, failed.
documentobjectSource document summary: id, filename, pages, type_detected.
dataobjectUpdated extracted field values including the applied corrections.
confidenceobjectConfidence scores: overall and per-field. Corrected fields have confidence 1.0.
locked_fieldsarrayField names that have been manually corrected and locked, including the fields from this request.
processingobjectProcessing metadata: duration_ms, pages_processed, region.
created_atstringISO 8601 creation timestamp.
linksobjectRelated resource URLs: self, data, document, dashboard.

Response

{
  "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "status": "complete",
  "document": {
    "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "filename": "invoice-0847.pdf",
    "pages": 2,
    "type_detected": "invoice"
  },
  "data": {
    "vendor_name": "Acme Corp",
    "invoice_number": "INV-2026-0847",
    "total_amount": 14500.00,
    "due_date": "2026-03-15"
  },
  "confidence": {
    "overall": 0.97,
    "fields": {
      "vendor_name": 0.99,
      "invoice_number": 0.98,
      "total_amount": 1.0,
      "due_date": 0.91
    }
  },
  "locked_fields": ["total_amount"],
  "processing": {
    "duration_ms": 3420,
    "pages_processed": 2,
    "region": "eu-west"
  },
  "created_at": "2026-07-14T10:33:12.000Z",
  "links": {
    "self": "/v1/extractions/a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "data": "/v1/extractions/a1b2c3d4-e5f6-7890-abcd-ef1234567890/data",
    "document": "/v1/documents/a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "dashboard": "https://app.talonic.com/documents/a1b2c3d4-e5f6-7890-abcd-ef1234567890"
  }
}

Errors

Error responses

401unauthorizedMissing or invalid API key.
403forbiddenThe API key lacks the write scope required to modify extraction data.
404not_foundNo extraction with this ID exists for your organization — also returned for documents your Sources IAM rules hide from this key (a document you cannot read is never writable).
429rate_limitedToo many requests. Retry after the period indicated in the Retry-After header.

Frequently asked questions

How do I correct a wrong extraction value via the API?+
Send a PATCH request to /v1/extractions/:id/data with a JSON object mapping each field name to its corrected value. The response is the full updated extraction with the corrections applied and those fields locked.
Can I correct multiple fields in a single request?+
Yes. Include as many field-name keys as you need in the request body object. All corrections in the body are applied in the same request.
What happens to the confidence score of a corrected field?+
Corrected fields are automatically set to confidence 1.0 and added to the `locked_fields` array. The overall confidence score is recalculated to reflect the correction.
What happens if I send a field name that does not exist?+
It is added to the extraction as a new locked field with the value you supplied — the request never rejects unknown names. That makes it easy to fill in a missed field, but it also means a misspelled key creates a stray field instead of correcting the intended one, so copy field names exactly from the extraction's data object.
Can I unlock a corrected field?+
No — there is no unlock operation, and re-extraction never overwrites locked fields. Submitting another correction for the same field replaces its value (the field remains locked at confidence 1.0), which is the supported way to fix a wrong correction.