## Change Extract Review Fields

`extract.review.change_fields(strjob_id, ReviewChangeFieldsParams**kwargs)  -> ExtractReview`

**post** `/api/v2/extract/{job_id}/review/fields`

Beta: answers 403 until extract review is enabled for the caller and their organization.

Confirm, correct, clear, restore or undo fields of a completed job.

The changes apply in order, in one write. A job without a review gets one with
the default settings, at revision 0. A path that is not a field of the job, or a
value the field's schema refuses, answers 400 and changes nothing.
A job that has not completed answers 409 with `code: job_not_reviewable`. A `revision` other than the review's latest answers 409 with `code: stale_revision` and the latest `revision`.

### Parameters

- `job_id: str`

- `changes: Iterable[Change]`

  Changes to apply, in order.

  - `change: Literal["clear", "confirm", "correct", 2 more]`

    confirm, correct to `value`, clear, restore the model's value, or undo.

    - `"clear"`

    - `"confirm"`

    - `"correct"`

    - `"restore"`

    - `"undo"`

  - `path: str`

    JSON Pointer of the field.

  - `value: Optional[object]`

    The corrected value, for `correct`.

- `revision: int`

  The review's revision as the caller last read it.

- `organization_id: Optional[str]`

- `project_id: Optional[str]`

### Returns

- `class ExtractReview: …`

  An extract job's review: its settings, flags, field actions and decision,
  with the result as read and as reviewed.

  - `id: str`

    Unique identifier of the review.

  - `confidence_threshold: float`

    Fields read below this confidence are flagged.

  - `created_at: datetime`

    When review was turned on.

  - `decided_at: Optional[datetime]`

    When it was approved or rejected.

  - `decided_by: Optional[str]`

    ID of the user who approved or rejected it.

  - `decided_reason: Optional[str]`

    Why it was rejected.

  - `field_actions: Dict[str, FieldActions]`

    The latest action per field, keyed by JSON Pointer.

    - `action: Literal["clear", "confirm", "correct"]`

      confirm, correct or clear.

      - `"clear"`

      - `"confirm"`

      - `"correct"`

    - `actor_id: str`

      ID of the user who acted.

    - `at: datetime`

      When they acted.

    - `value: Optional[object]`

      The corrected value, for `correct`.

  - `fields_in_scope: List[str]`

    JSON Pointers of the fields the threshold applies to; empty means all.

  - `flags: List[Flag]`

    Fields the review asks a person to check.

    - `handled: bool`

      Whether someone confirmed, corrected or cleared it.

    - `path: str`

      JSON Pointer of the field.

    - `reason: Literal["below_threshold", "required_empty"]`

      below_threshold, or required_empty for a required field left empty.

      - `"below_threshold"`

      - `"required_empty"`

    - `cell: Optional[FlagCell]`

      Where in a list the least confident value is.

      - `row: int`

        Index of the row, from 0.

      - `column: Optional[str]`

        Property of the row, when rows are objects.

    - `confidence: Optional[float]`

      The field's confidence; for a list, its least confident value.

  - `job_id: str`

    The extract job reviewed.

  - `open_flags: List[str]`

    JSON Pointers of flagged fields nobody checked.

  - `original_result: Optional[Dict[str, object]]`

    The result as the model read it.

  - `required_fields: List[str]`

    JSON Pointers of fields flagged when empty.

  - `retain_until: datetime`

    When the job and its document may be deleted.

  - `reviewed_result: Dict[str, object]`

    The result with the field actions.

  - `revision: int`

    Bumped by every change; actions name the one they saw.

  - `source_file_id: Optional[str]`

    The file the job read, or the file behind the parse job it read; null for a URL.

  - `status: Literal["approved", "pending", "rejected"]`

    pending until approved or rejected.

    - `"approved"`

    - `"pending"`

    - `"rejected"`

  - `updated_at: datetime`

    When the review last changed.

### Example

```python
import os
from llama_cloud import LlamaCloud

client = LlamaCloud(
    api_key=os.environ.get("LLAMA_CLOUD_API_KEY"),  # This is the default and can be omitted
)
extract_review = client.extract.review.change_fields(
    job_id="job_id",
    changes=[{
        "change": "correct",
        "path": "/total",
    }],
    revision=0,
)
print(extract_review.id)
```

#### Response

```json
{
  "id": "id",
  "confidence_threshold": 0,
  "created_at": "2019-12-27T18:11:19.117Z",
  "decided_at": "2019-12-27T18:11:19.117Z",
  "decided_by": "decided_by",
  "decided_reason": "decided_reason",
  "field_actions": {
    "foo": {
      "action": "clear",
      "actor_id": "actor_id",
      "at": "2019-12-27T18:11:19.117Z",
      "value": {}
    }
  },
  "fields_in_scope": [
    "string"
  ],
  "flags": [
    {
      "handled": true,
      "path": "path",
      "reason": "below_threshold",
      "cell": {
        "row": 0,
        "column": "column"
      },
      "confidence": 0
    }
  ],
  "job_id": "job_id",
  "open_flags": [
    "string"
  ],
  "original_result": {
    "foo": "bar"
  },
  "required_fields": [
    "string"
  ],
  "retain_until": "2019-12-27T18:11:19.117Z",
  "reviewed_result": {
    "foo": "bar"
  },
  "revision": 0,
  "source_file_id": "source_file_id",
  "status": "approved",
  "updated_at": "2019-12-27T18:11:19.117Z"
}
```
