Jobs

Confirm extraction field values

PATCH
/jobs/{id}/review

Confirm that a field should say a given value, signed by the caller, without mutating the machine result. expected_version provides optimistic concurrency; stale writes return 409. Every confirmation and retraction appends an actor- and timestamp-attributed event.

A confirmation whose value matches what extraction produced is a plain sign-off; one that differs also corrects the field. There is no separate approval: who stands behind a value is derived from live confirmations. Retractions are applied first, then confirmations.

A retraction peels the caller's own current tip on that path and restores the value the confirmation replaced. Two retractions of the same path undo two confirmations, in order. A retraction cannot be combined with a confirmation on the same or overlapping path. The tip is not retractable when someone else made it, or when a later overlapping confirmation named a different value. A co-signature of the same value becomes the tip, so only that co-signer can take it back. Completing the review still freezes everything. Provide at least one confirmation or retraction.

Authorization

bearerAuth
AuthorizationBearer <token>

Existing Eigenpal API key presented as a bearer token.

In: header

Path Parameters

id*string

Durable OCR job identifier (opj_…).

Match^opj_[A-Za-z0-9_-]+$
Lengthlength <= 128

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Optimistic review update. Retractions peel one current tip each, in order, then confirmations apply. A retraction and a confirmation that overlap are rejected. At least one confirmation or retraction is required.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X PATCH "https://example.com/jobs/opj_V1StGXR8_Z5jdHi6B-myT/review" \  -H "Authorization: Bearer $OPENPARSER_API_KEY" \  -H "Content-Type: application/json" \  -d '{    "expected_version": 0  }'
{  "job_id": "opj_V1StGXR8_Z5jdHi6B-myT",  "status": "pending",  "machine_output": null,  "corrected_output": null,  "lineage": {    "format": "lineage@1",    "id": "string",    "profiles": [      "string"    ],    "entities": {},    "activities": {},    "agents": {},    "derivations": [],    "relations": [],    "outputs": [],    "attributes": {      "property1": null,      "property2": null    }  },  "version": 0,  "events": [    {      "version": 1,      "actor_id": "string",      "created_at": "2019-08-24T14:15:22Z",      "type": "field_confirmed",      "path": "string",      "previous_value": null,      "value": null,      "note": "string"    }  ],  "created_at": "2019-08-24T14:15:22Z",  "updated_at": "2019-08-24T14:15:22Z",  "completed_at": "2019-08-24T14:15:22Z",  "reviewed_by_actor_id": "string",  "viewer_actor_id": "string"}
{  "error": {    "code": "malformed_request",    "message": "multipart field `request` is not valid JSON",    "request_id": "req_01h2example",    "retryable": false  }}
{  "error": {    "code": "unauthorized",    "message": "invalid API key",    "request_id": "req_01h2example",    "retryable": false  }}
{  "error": {    "code": "forbidden",    "message": "API key lacks required scope",    "request_id": "req_01h2example",    "retryable": false  }}
{  "error": {    "code": "job_not_found",    "message": "job not found",    "request_id": "req_01h2example",    "retryable": false  }}
{  "error": {    "code": "string",    "message": "string",    "request_id": "string",    "retryable": true,    "details": {      "property1": null,      "property2": null    }  }}
{  "error": {    "code": "string",    "message": "string",    "request_id": "string",    "retryable": true,    "details": {      "property1": null,      "property2": null    }  }}
{  "error": {    "code": "string",    "message": "string",    "request_id": "string",    "retryable": true,    "details": {      "property1": null,      "property2": null    }  }}

{  "error": {    "code": "rate_limited",    "message": "request rate limit exceeded",    "request_id": "req_01h2example",    "retryable": true  }}