Products · Human Review V1

Human review

Review only the fields the system is unsure about, with the evidence beside each one.

Version 1 · A person checks flagged fieldsDesigned, not builtModule 5 of 15

InterfacesAPI SpecSections

API Spec Designed

Base address: https://01scale.com/api/review/v1. Open an endpoint for its inputs, constraints, errors and samples.

POST/tasksCreate a review task

Takes a set of fields that need a person's check and keeps its own copy of them. Review never reads another service's data: whatever it needs is sent here. Signed in

Scope: review:write

Inputs

referencebodystringrequired
The caller's own label, returned in events. DocFlow sends docflow:{document_id}.
1 to 200 characters. Opaque to Review.
fields[]bodyarrayrequired
The values to review.
1 to 500 fields.
fields[].namebodystringrequired
The field's name, shown as its label.
1 to 64 characters; unique with line_index within the task.
fields[].line_indexbodyintegeroptional
Which line item, for repeated fields.
0 or more.
fields[].typebodystringrequired
How an edit is checked: a real date, a decimal number, a 3-letter currency code, or free text. This keeps Review independent of any one document type.
One of text, date, decimal, currency.
fields[].valuebodystring or nullrequired
The value to check.
Null when not found on the document. Decimals as strings.
fields[].confidencebodynumberrequired
How sure the system was; orders the queue.
0 to 1.
fields[].source_page, fields[].source_quotebodyinteger, stringoptional
The evidence shown beside the value.
Page 1 or more; quote 1 to 500 characters.
fields[].flagged, fields[].flag_reasonsbodyboolean, string[]required
Whether a person must decide on this field, and why.
Flagged exactly when there is at least one reason.
holdbodybooleanoptional
Hold the unflagged fields for the app until it releases them (REVIEW-V1-E4-06). The owner still sees and decides every flagged field.
Only with a delegated token: the acting app (its act claim) becomes the holder. Default false.
Idempotency-Keyheaderstringoptional
Makes a retried request safe.
1 to 255 characters.

What it does

  • Validates every field, stores the task as open with its own copy of the fields (each pending), and records review.task_created.
  • With hold: true, records the acting app from the delegated token's act claim as held_by (REVIEW-V1-E4-06). A person's own token or an API key cannot place a hold.

Responses

  • 201The task was created. task.
  • 422validation_failed A field is malformed; errors[] lists each one.
  • 422hold_requires_app hold: true without a delegated token, so there is no app to hold the fields for.
  • 422duplicate_field Two fields share a name and line index.
  • 422idempotency_key_reused Same key, different body.
  • 401not_authenticated No valid access token.

Sample request

POST /api/review/v1/tasks HTTP/1.1
Host: 01scale.com
Authorization: Bearer <access token>
Idempotency-Key: 4d2a-review-1
Content-Type: application/json

{
  "reference": "docflow:0193b0c4-91aa-7b33-8c44-5d6e7f8a9b0c",
  "fields": [
    {
      "name": "vendor_name",
      "type": "text",
      "value": "Acme Supplies Ltd",
      "confidence": 0.97,
      "source_page": 1,
      "source_quote": "Acme Supplies Ltd",
      "flagged": false,
      "flag_reasons": []
    },
    {
      "name": "total",
      "type": "decimal",
      "value": "1240.00",
      "confidence": 0.3,
      "source_page": 2,
      "source_quote": "TOTAL DUE  $1,240.00",
      "flagged": true,
      "flag_reasons": [
        "Total \u2260 subtotal + tax (1,150.00 + 80.00 = 1,230.00)"
      ]
    }
  ]
}

Sample response

{
  "task": {
    "id": "0193b0f2-3c4d-7e5f-8a6b-7c8d9e0f1a2b",
    "reference": "docflow:0193b0c4-91aa-7b33-8c44-5d6e7f8a9b0c",
    "status": "open",
    "resolved": 0,
    "total": 2,
    "flagged": 1,
    "can_complete": false,
    "checks_overridden": false,
    "held_by": "service:docflow",
    "released_at": null,
    "created_at": "2026-11-17T09:14:43Z",
    "completed_at": null
  }
}
GET/tasks/{taskId}Get the review queue

The task and its fields: flagged fields first, lowest confidence first. Unflagged fields only when asked. Signed in

Scope: review:read

Inputs

taskIdpathuuidrequired
The task.
A UUID.
allquerybooleanoptional
For 'Show all fields'.
true adds the unflagged fields after the flagged ones.

What it does

  • Read only. resolved counts flagged fields no longer pending; can_complete is true when none is pending.
  • While the task is held (REVIEW-V1-E4-06), the owner's own token or API key gets only the flagged fields, even with all=true, plus held: true and fields_hidden; the holding app, with a delegated token naming it in act, gets every field. held_by and released_at are on the task.

Responses

  • 200The task is the caller's. task and fields[]: id, name, line_index, type, original_value, value, confidence, source_page, source_quote, flagged, flag_reasons[], status (pending, accepted, edited, not_present).
  • 404task_not_found No such task, or it belongs to another user. The same answer in both cases.
  • 401not_authenticated No valid access token.

Sample request

GET /api/review/v1/tasks/0193b0f2-3c4d-7e5f-8a6b-7c8d9e0f1a2b HTTP/1.1
Host: 01scale.com
Authorization: Bearer <access token>

Sample response

{
  "task": {
    "id": "0193b0f2-3c4d-7e5f-8a6b-7c8d9e0f1a2b",
    "reference": "docflow:0193b0c4-91aa-7b33-8c44-5d6e7f8a9b0c",
    "status": "open",
    "resolved": 1,
    "total": 3,
    "flagged": 2,
    "can_complete": false,
    "checks_overridden": false,
    "held_by": "service:docflow",
    "released_at": null,
    "created_at": "2026-11-17T09:14:43Z",
    "completed_at": null
  },
  "fields": [
    {
      "id": "0193b0f2-3c4d-7e5f-8a6b-7c8d9e0f1a30",
      "name": "total",
      "line_index": null,
      "type": "decimal",
      "original_value": "1240.00",
      "value": "1240.00",
      "confidence": 0.3,
      "source_page": 2,
      "source_quote": "TOTAL DUE  $1,240.00",
      "flagged": true,
      "flag_reasons": [
        "Total \u2260 subtotal + tax (1,150.00 + 80.00 = 1,230.00)"
      ],
      "status": "pending"
    },
    {
      "id": "0193b0f2-3c4d-7e5f-8a6b-7c8d9e0f1a31",
      "name": "vendor_tax_id",
      "line_index": null,
      "type": "text",
      "original_value": null,
      "value": null,
      "confidence": 0.62,
      "source_page": null,
      "source_quote": null,
      "flagged": true,
      "flag_reasons": [
        "Low confidence (0.62)"
      ],
      "status": "not_present"
    }
  ]
}
PATCH/tasks/{taskId}/fields/{fieldId}Accept, edit or mark a field as not on the document

Records a person's decision on one field. Any field can be changed again until the task is completed. Signed in

Scope: review:write

Inputs

taskId, fieldIdpathuuidrequired
The field.
A field of an open task of the caller's.
actionbodystringrequired
What the person decided.
accept, edit or not_present.
valuebodystringWith edit only
The corrected value.
Checked by the field's type: date a real date as YYYY-MM-DD; decimal digits with at most 4 decimals; currency an ISO 4217 code; text 1 to 500 characters.

What it does

  • accept keeps the value; edit replaces it; not_present empties it.
  • Writes the old and new value, the action, who and when to the field's history, and records review.field_updated.
  • When the new value differs from the original, saves an eval candidate (REVIEW-V1-E4-04).
  • Also allowed after the task is completed, including after the app has charged for it (Nikhil's decision on #45): the change is recorded the same way, the task stays completed, and the latest values are the final document.
  • While the task is held (REVIEW-V1-E4-06), the owner may decide only flagged fields; an unflagged field answers 404 field_not_found, as if it were not there.

Responses

  • 200The decision was recorded. field, and the task's new resolved and can_complete.
  • 404task_not_found No such task, or it belongs to another user. The same answer in both cases.
  • 422invalid_date value is not a real date.
  • 422invalid_decimal value is not a decimal number.
  • 422invalid_currency value is not an ISO 4217 currency code.
  • 422validation_failed action is unknown, or value is missing or sent when not allowed.
  • 401not_authenticated No valid access token.

Sample request

PATCH /api/review/v1/tasks/0193b0f2-3c4d-7e5f-8a6b-7c8d9e0f1a2b/fields/0193b0f2-3c4d-7e5f-8a6b-7c8d9e0f1a30 HTTP/1.1
Host: 01scale.com
Authorization: Bearer <access token>
Content-Type: application/json

{
  "action": "edit",
  "value": "1230.00"
}

Sample response

{
  "field": {
    "id": "0193b0f2-3c4d-7e5f-8a6b-7c8d9e0f1a30",
    "name": "total",
    "line_index": null,
    "type": "decimal",
    "original_value": "1240.00",
    "value": "1230.00",
    "confidence": 0.3,
    "source_page": 2,
    "source_quote": "TOTAL DUE  $1,240.00",
    "flagged": true,
    "flag_reasons": [
      "Total \u2260 subtotal + tax (1,150.00 + 80.00 = 1,230.00)"
    ],
    "status": "edited"
  },
  "task": {
    "resolved": 2,
    "can_complete": true
  }
}
POST/tasks/{taskId}/releaseRelease held fields

The holding app lets the owner see and correct every field, once its own condition is met (for DocFlow, the order is paid). Review never knows why. Service

Scope: review:write

Inputs

taskIdpathuuidrequired
The task.
A held task.

What it does

  • Only the holder can release: a delegated token for the task's owner whose act claim equals held_by.
  • Sets released_at and records review.task_released. Safe to call again: a released task answers 200 unchanged.

Responses

  • 200The task is released (now or before). task.
  • 404task_not_found No such task, or it belongs to another user. The same answer in both cases.
  • 403not_holder The caller is not the app holding this task.
  • 409not_held The task was never held.
  • 401not_authenticated No valid access token.

Sample request

POST /api/review/v1/tasks/0193b0f2-3c4d-7e5f-8a6b-7c8d9e0f1a2b/release HTTP/1.1
Host: 01scale.com
Authorization: Bearer <delegated token, act: service:docflow>

Sample response

{
  "task": {
    "id": "0193b0f2-3c4d-7e5f-8a6b-7c8d9e0f1a2b",
    "reference": "docflow:0193b0c4-91aa-7b33-8c44-5d6e7f8a9b0c",
    "status": "open",
    "resolved": 1,
    "total": 3,
    "flagged": 2,
    "can_complete": false,
    "checks_overridden": false,
    "held_by": "service:docflow",
    "released_at": "2026-11-17T09:20:05Z",
    "created_at": "2026-11-17T09:14:43Z",
    "completed_at": null
  }
}
POST/tasks/{taskId}/completeComplete the review

Marks the review finished and returns the values. Allowed once every flagged field is decided. Values can still be corrected afterwards, and every change is recorded. Re-checking the corrected values against the document's rules is the app's step before this, using the LLM Extraction service. Signed in

Scope: review:write

Inputs

taskIdpathuuidrequired
The task.
An open task of the caller's.
checks_overriddenbodybooleanoptional
True when the person confirmed 'Values are correct as on the document' although a rule check still fails.
Default false.

What it does

  • Sets the task completed, with who and when, and whether checks were overridden.
  • Records review.task_completed and announces review.task.completed with {task_id, reference}.
  • Completing an already completed task returns it again, unchanged.

Responses

  • 200The task is completed. task and final_values: each field's name, line index and final value.
  • 404task_not_found No such task, or it belongs to another user. The same answer in both cases.
  • 409fields_unresolved Flagged fields are still pending; unresolved_fields[] lists them.
  • 401not_authenticated No valid access token.

Sample request

POST /api/review/v1/tasks/0193b0f2-3c4d-7e5f-8a6b-7c8d9e0f1a2b/complete HTTP/1.1
Host: 01scale.com
Authorization: Bearer <access token>
Content-Type: application/json

{
  "checks_overridden": false
}

Sample response

{
  "task": {
    "id": "0193b0f2-3c4d-7e5f-8a6b-7c8d9e0f1a2b",
    "reference": "docflow:0193b0c4-91aa-7b33-8c44-5d6e7f8a9b0c",
    "status": "completed",
    "resolved": 2,
    "total": 3,
    "flagged": 2,
    "can_complete": true,
    "checks_overridden": false,
    "held_by": "service:docflow",
    "released_at": null,
    "created_at": "2026-11-17T09:14:43Z",
    "completed_at": "2026-11-17T09:16:02Z"
  },
  "final_values": [
    {
      "name": "vendor_name",
      "line_index": null,
      "value": "Acme Supplies Ltd"
    },
    {
      "name": "total",
      "line_index": null,
      "value": "1230.00"
    },
    {
      "name": "vendor_tax_id",
      "line_index": null,
      "value": null
    }
  ]
}
GET/admin/eval-candidatesCorrections that could become eval cases

Every value a person corrected, with what the model said, for the owner to approve as a real model mistake. It is shown only inside the app, to the admin; it is never exported (Nikhil's decision on #41). Admin

Scope: is_admin

Inputs

statusquerystringoptional
Which ones.
candidate, approved or rejected. Default candidate.
cursor, limitquerystring, integeroptional
Paging.
As for every list; limit 1 to 100.

What it does

  • Read only. Shows the field, the two values and the task's reference; no other document content.

Responses

  • 200The caller is an admin. data[] and next_cursor.
  • 404not_found The caller is not an admin.
  • 401not_authenticated No valid access token.

Sample request

GET /api/review/v1/admin/eval-candidates?status=candidate HTTP/1.1
Host: 01scale.com
Authorization: Bearer <access token>

Sample response

{
  "data": [
    {
      "id": "0193b101-aa00-7b01-8c02-0d03e04f05a6",
      "reference": "docflow:0193b0c4-91aa-7b33-8c44-5d6e7f8a9b0c",
      "field_name": "total",
      "line_index": null,
      "model_value": "1240.00",
      "human_value": "1230.00",
      "status": "candidate",
      "created_at": "2026-11-17T09:15:30Z"
    }
  ],
  "next_cursor": null
}
PATCH/admin/eval-candidates/{candidateId}Approve or reject a candidate

The manual approval the story requires before any correction becomes ground truth. Admin

Scope: is_admin

Inputs

candidateIdpathuuidrequired
The candidate.
A candidate with status candidate.
statusbodystringrequired
The decision.
approved or rejected.

What it does

  • Records the decision, who and when. A decision can be changed later.

Responses

  • 200Recorded. candidate.
  • 404not_found No such candidate, or the caller is not an admin.
  • 401not_authenticated No valid access token.

Sample request

PATCH /api/review/v1/admin/eval-candidates/0193b101-aa00-7b01-8c02-0d03e04f05a6 HTTP/1.1
Host: 01scale.com
Authorization: Bearer <access token>
Content-Type: application/json

{
  "status": "approved"
}

Sample response

{
  "candidate": {
    "id": "0193b101-aa00-7b01-8c02-0d03e04f05a6",
    "status": "approved"
  }
}
GET/admin/accuracyHow often people correct each field

Replaces the export of corrections (Nikhil's decision on #41: a user's data never leaves their account). Numbers only: no values, no references, no user IDs. Admin

Scope: is_admin

Inputs

sincequerydateoptional
Start of the period.
Default: 30 days ago.
sourcequerystringoptional
All corrections, or only those the admin approved as real model mistakes.
all (default) or approved.

What it does

  • Read only. Counts per field name over the period: fields reviewed, flagged, corrected, marked not present, and approved mistakes; with the correction rate and the share of corrections that had been flagged (how well flagging catches mistakes).
  • Every count is shown as it is, however small (Nikhil's decision on #81: hiding small counts would make the report hard to test with few users). Rules that hide small groups come in MVP2 (REVIEW-V2-E10-04).

Responses

  • 200The caller is an admin. since, totals and fields[], each with its counts and rates.
  • 404not_found The caller is not an admin.
  • 422validation_failed since is not a date.
  • 401not_authenticated No valid access token.

Sample request

GET /api/review/v1/admin/accuracy?since=2026-11-01 HTTP/1.1
Host: 01scale.com
Authorization: Bearer <access token>

Sample response

{
  "since": "2026-11-01",
  "totals": {
    "tasks": 42,
    "fields_reviewed": 798,
    "corrected": 37,
    "correction_rate": 0.046,
    "corrections_flagged": 0.92
  },
  "fields": [
    {
      "name": "total",
      "reviewed": 42,
      "flagged": 9,
      "corrected": 6,
      "not_present": 0,
      "approved_mistakes": 5,
      "correction_rate": 0.143
    },
    {
      "name": "vendor_tax_id",
      "reviewed": 42,
      "flagged": 11,
      "corrected": 3,
      "not_present": 8,
      "approved_mistakes": 2,
      "correction_rate": 0.071
    }
  ]
}
POST/eventsReceive platform events

Where other services' signed events arrive. In version 1 Review acts on one: a user's account was deleted. Service

Scope: None: HMAC signature

Inputs

X-01scale-Signatureheaderstringrequired
Proves the event came from the platform.
HMAC-SHA256 of the raw body, compared in constant time.
event_id, type, databodyuuid, string, objectrequired
The event.
Processed once per event_id; acts on identity.user.deleted with {user_id}.

What it does

  • Deletes that user's tasks, fields, history and eval candidates, approved ones included (Nikhil's decision on #41). Nothing of theirs is kept.

Responses

  • 200Accepted, including a repeat or an ignored type. No body.
  • 401invalid_signature The signature is missing or wrong.

Sample request

POST /api/review/v1/events HTTP/1.1
X-01scale-Signature: sha256=8c1f...
Content-Type: application/json

{
  "event_id": "0193b2aa-6f01-7c2d-9e3f-4a5b6c7d8e9f",
  "type": "identity.user.deleted",
  "occurred_at": "2026-11-17T10:00:00Z",
  "data": {
    "user_id": "0193a5b2-7c1e-7a3f-9b2d-4e6f8a1c2d3e"
  }
}

Sample response

HTTP/1.1 200 OK

Errors

Every error has the same shape and a stable code to branch on.

{
  "type": "https://01scale.com/errors/fields_unresolved",
  "title": "Fields still to check",
  "status": 409,
  "detail": "2 flagged fields are still waiting for a decision.",
  "code": "fields_unresolved",
  "request_id": "req_0193a61f9c2e"
}

Handled without an endpoint

Re-checking corrected values (REVIEW-V1-E4-03)
The rule checks belong to the LLM Extraction service. The app calls LLM Extraction POST /validations with the corrected values before completing the task here, and passes checks_overridden if the person confirms values that still fail. Review itself knows no document rules.
Keyboard and touch (REVIEW-V1-E4-02 AC3)
A design rule of the components: Enter accepts, E edits, ↓ moves to the next field; on phones every action is a large button.
Events Review announces
review.task.completed with {task_id, reference}, signed and delivered with retries from the outbox.
DocFlow's endpoint
POST /api/docflow/v1/documents/{documentId}/complete-review belongs to the DocFlow app, which calls Extraction's checks and then this service. It is designed with the DocFlow app shell (DOCFLOW-V1-E0-09).
AI agents
Each endpoint is a tool on Review's MCP server, POST /api/review/mcp. An agent can propose corrections; completing a task on a user's behalf requires a user session, not an API key.
Health and contract
Like every service, Review serves GET /health and GET /openapi.json from the service template (SERVICEKIT-V1-E0-05).

Constraints at the API level

  • A task's fields arrive complete with their type, evidence and flags; Review fetches nothing from other services.
  • An edit is checked by the field's type: a real date, a decimal with at most 4 places, an ISO 4217 code, or 1 to 500 characters of text.
  • A completed task's values can still be corrected; every change is recorded.
  • A task completes only when no flagged field is pending.
  • Another user's task answers 404 task_not_found; admin endpoints answer 404 not_found to anyone else.
  • Admin reports show counts and rates only, to the admin alone; no correction is ever exported.
  • POST /tasks accepts Idempotency-Key; complete is idempotent by design.