Limai Docs
API ReferenceWebhooks

Document Reviewed Event

Webhook event fired when all rows in a document are accepted after human review.

The DOCUMENT_REVIEWED event fires when all rows in a document are marked as accepted, confirming that the document processing workflow is complete and the data is ready for use.

When It Triggers

  • All rows accepted -- When every extracted data row for a document is marked as accepted (no pending rows remain)
  • Human review complete -- Confirms that reviewers have validated and approved the extracted data

This event fires after using the submit-corrections API endpoint or accepting rows through the UI.

Payload Structure

Response200
{
  "eventId": "evt_reviewed_456",
  "eventType": "DOCUMENT_REVIEWED",
  "timestamp": "2024-01-15T10:45:30Z",
  "organizationId": "org_xyz789",
  "deploymentId": "dep_123abc",
  "extractionSchemaId": "schema_456def",
  "fileId": "file_789ghi",
  "jobId": null,
  "data": {
    "status": "reviewed",
    "acceptedRowsCount": 15,
    "totalRowsCount": 15
  }
}

Payload Fields

FieldTypeDescription
eventIdstringUnique event identifier. Use for idempotency.
eventTypestringAlways "DOCUMENT_REVIEWED"
timestampISO 8601When the review was completed (UTC)
organizationIdstringYour organization identifier
deploymentIdstringThe deployment that processed this document
extractionSchemaIdstringThe extraction schema used
fileIdstringThe reviewed file identifier
jobIdnullAlways null for review events
data.status"reviewed"Always "reviewed"
data.acceptedRowsCountnumberNumber of accepted rows (equals totalRowsCount)
data.totalRowsCountnumberTotal number of rows in the document

Handling the Event

function handleDocumentReviewed(event) {
const { eventId, fileId, extractionSchemaId, data } = event

console.log(`Document ${fileId} review completed`)
console.log(`Accepted rows: ${data.acceptedRowsCount}/${data.totalRowsCount}`)

fetchFileData(fileId).then(fileData => {
  exportToDownstreamSystems(fileData)
  notifyStakeholders(fileId, "COMPLETED")
})
}

Retrieving Reviewed Data

The webhook payload contains metadata only. To get the final reviewed data, call the get-file-data endpoint using the fileId from the payload.