Skip to main content

Bulk Approval and Choosing Values

Approve many pending results at once, compare what each source said for an approval decision, and record the value to keep for a field.

Results held by an approval gate wait for a decision. Approve many of them in one call, or, where sources disagree, compare them field by field and record the value to keep. Decisions are attributed to the person behind your credential.

Writes need the reviews:write scope and the workspace edit permission; the comparison read needs read or reviews:read. Send an Idempotency-Key header (up to 64 characters) on this write. A retry with the same key and body returns the first response with Idempotent-Replayed: true and changes nothing; the same key with a different body is refused with 422 idempotency_key_reused.

POST/v1/structuring/approvals/bulk-approve
GET/v1/structuring/approval-decisions/:id/diffs
POST/v1/structuring/approval-decisions/:id/canonical

Body

field_name*stringThe field.
canonical_value*stringThe value to keep.
selection_method*stringsource_pick or free_text.
source_values*arrayThe values that were on offer (source_label, value, source_text, document_id).

Bulk approve

curl -X POST https://api.talonic.com/v1/structuring/approvals/bulk-approve \
  -H "Authorization: Bearer tlnc_..." -H "Content-Type: application/json" \
  -H "Idempotency-Key: approve-batch-42" \
  -d '{"result_ids": ["RES_1", "RES_2"]}'

Errors

Error responses

400validation_errorThe body is missing a required field or a value is malformed.
401unauthorizedMissing or invalid API key.
403insufficient_scope / insufficient_roleThe credential lacks the scope, or its person lacks the workspace permission. reason says which.
404not_foundThe resource is not in your workspace, or is on a document you cannot see.
409idempotency_request_in_progressA request with the same Idempotency-Key is still running. Retry shortly.
422idempotency_key_reusedThe Idempotency-Key was used for a different request, or by a different credential.
429rate_limitedToo many requests. Retry after the period in the Retry-After header.

Frequently asked questions

Can I retry a bulk approval?+
Yes. With the same Idempotency-Key the first answer is returned. Without one, already-approved results count as failed on the retry.