## Change Extract Review Fields

`ExtractReview extract().review().changeFields(ReviewChangeFieldsParamsparams, RequestOptionsrequestOptions = RequestOptions.none())`

**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

- `ReviewChangeFieldsParams params`

  - `Optional<String> jobId`

  - `Optional<String> organizationId`

  - `Optional<String> projectId`

  - `List<Change> changes`

    Changes to apply, in order.

    - `InnerChange change`

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

      - `CLEAR("clear")`

      - `CONFIRM("confirm")`

      - `CORRECT("correct")`

      - `RESTORE("restore")`

      - `UNDO("undo")`

    - `String path`

      JSON Pointer of the field.

    - `Optional<JsonValue> value`

      The corrected value, for `correct`.

  - `long revision`

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

### Returns

- `class ExtractReview:`

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

  - `String id`

    Unique identifier of the review.

  - `double confidenceThreshold`

    Fields read below this confidence are flagged.

  - `LocalDateTime createdAt`

    When review was turned on.

  - `Optional<LocalDateTime> decidedAt`

    When it was approved or rejected.

  - `Optional<String> decidedBy`

    ID of the user who approved or rejected it.

  - `Optional<String> decidedReason`

    Why it was rejected.

  - `FieldActions fieldActions`

    The latest action per field, keyed by JSON Pointer.

    - `Action action`

      confirm, correct or clear.

      - `CLEAR("clear")`

      - `CONFIRM("confirm")`

      - `CORRECT("correct")`

    - `String actorId`

      ID of the user who acted.

    - `LocalDateTime at`

      When they acted.

    - `Optional<JsonValue> value`

      The corrected value, for `correct`.

  - `List<String> fieldsInScope`

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

  - `List<Flag> flags`

    Fields the review asks a person to check.

    - `boolean handled`

      Whether someone confirmed, corrected or cleared it.

    - `String path`

      JSON Pointer of the field.

    - `Reason reason`

      below_threshold, or required_empty for a required field left empty.

      - `BELOW_THRESHOLD("below_threshold")`

      - `REQUIRED_EMPTY("required_empty")`

    - `Optional<Cell> cell`

      Where in a list the least confident value is.

      - `long row`

        Index of the row, from 0.

      - `Optional<String> column`

        Property of the row, when rows are objects.

    - `Optional<Double> confidence`

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

  - `String jobId`

    The extract job reviewed.

  - `List<String> openFlags`

    JSON Pointers of flagged fields nobody checked.

  - `Optional<OriginalResult> originalResult`

    The result as the model read it.

  - `List<String> requiredFields`

    JSON Pointers of fields flagged when empty.

  - `LocalDateTime retainUntil`

    When the job and its document may be deleted.

  - `ReviewedResult reviewedResult`

    The result with the field actions.

  - `long revision`

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

  - `Optional<String> sourceFileId`

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

  - `Status status`

    pending until approved or rejected.

    - `APPROVED("approved")`

    - `PENDING("pending")`

    - `REJECTED("rejected")`

  - `LocalDateTime updatedAt`

    When the review last changed.

### Example

```java
package ai.llamaindex.llamacloud.example;

import ai.llamaindex.llamacloud.client.LlamaCloudClient;
import ai.llamaindex.llamacloud.client.okhttp.LlamaCloudOkHttpClient;
import ai.llamaindex.llamacloud.models.extract.review.ExtractReview;
import ai.llamaindex.llamacloud.models.extract.review.ReviewChangeFieldsParams;

public final class Main {
    private Main() {}

    public static void main(String[] args) {
        LlamaCloudClient client = LlamaCloudOkHttpClient.fromEnv();

        ReviewChangeFieldsParams params = ReviewChangeFieldsParams.builder()
            .jobId("job_id")
            .addChange(ReviewChangeFieldsParams.Change.builder()
                .change(ReviewChangeFieldsParams.Change.InnerChange.CORRECT)
                .path("/total")
                .build())
            .revision(0L)
            .build();
        ExtractReview extractReview = client.extract().review().changeFields(params);
    }
}
```

#### 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"
}
```
