> ## Documentation Index
> Fetch the complete documentation index at: https://docs.monumint.com/llms.txt
> Use this file to discover all available pages before exploring further.

# document.extracted

Triggered when the document processing pipeline finishes, whether or not extraction actually ran.

## Event Type

`document.extracted`

## Description

This event fires once per document outcome: `completed` when the pipeline finished (extraction may have been skipped because validation flagged the document), and `failed` when extraction itself errored. The payload always includes a `classification` object describing which checklist item(s) the document matched, with per-item validation results on each matched item.

## Payload Structure

**event** `string` *required*

The event type, always `document.extracted`

**workspaceId** `string` *required*

ID of the workspace this event belongs to

**leadId** `string` *required*

ID of the lead this document belongs to

**externalLeadId** `string` *required*

External ID of the lead this document belongs to, if one was provided at
creation

**documentId** `string` *required*

ID of the document that was processed

**externalId** `string`

External identifier for the document, if one was provided at creation

**status** `string` *required*

`completed` when the pipeline finished or `failed` when extraction errored

**parentActionId** `string`

ID of the parent action that triggered the pipeline

**summary** `string`

One- to two-sentence document summary from OCR, when available (same as stored
on the document)

**type** `string`

Inferred document type from OCR (same as the `type` column on `documents`,
e.g. `Bank Statement`, `Tax Return`). `null` when not set.

**classification** `object` *required*

How the document was classified before extraction (or an empty match list
with a no-match reason)

**classification**

**noMatchedItemReason** `string`

When the document was not matched to a checklist item, a short
human-readable reason; otherwise `null`

**matchedChecklistItems** `array` *required*

Checklist item rows the model linked this document to

**matchedChecklistItems\[]**

**checklistGroupCode** `string`

Code identifier for the checklist item's group

**checklistItemCode** `string`

The checklist item code from configuration

**fieldType** `string`

Field type for the checklist item

**label** `string` *required*

Checklist item label

**leadChecklistItemId** `string` *required*

ID of the lead checklist item row

**validation** `object`

Validation result for this checklist item. `null` when no validation
ran (no rules, not a period-checked field type).

**validation**

**reasons** `string[]` *required*

For invalid items, one message per failed rule; empty when
`status` is `valid`

**status** `string` *required*

`valid` when the item passed every rule, `invalid` when any rule
failed

**extractionResult** `object` *required*

Returns any checklist items extracted from documents.

**extractionResult**

**items** `array`

Array of extracted data items

**items**

**checklistGroupCode** `string`

Code identifier for the checklist item's group

**checklistItemCode** `string`

The checklist item code from configuration, when the extracted value
maps to a configured checklist item; `null` otherwise

**label** `string`

Label/field name for the extracted value

**leadChecklistItemId** `string`

ID of the lead checklist item this value was extracted for (if
applicable)

**value** `string`

Extracted value

**extractedCount** `number`

Number of items with a non-empty extracted value

## Examples

### Successful extraction

```json theme={null}
{
  "event": "document.extracted",
  "workspaceId": "6048d78a-584a-4f1e-9e39-e011ca4cc48c",
  "leadId": "910bb19a-2e9d-400f-8d15-9c461bb0f4aa",
  "externalLeadId": "SF-00142",
  "documentId": "ac52376a-fe68-4024-8b16-6acdcb9b3530",
  "externalId": "DOC-2025-001",
  "status": "completed",
  "parentActionId": "9d7fe2f3-ec1a-481c-b814-a0d1c8017e1f",
  "summary": "Business bank statement for Q1 2025 with ending balance and transactions.",
  "type": "Bank Statement",
  "classification": {
    "noMatchedItemReason": null,
    "matchedChecklistItems": [
      {
        "checklistItemCode": "company-legal-name",
        "fieldType": "TEXT",
        "label": "Company Name",
        "leadChecklistItemId": "adc887d0-7238-4ce0-998d-523a22c282f4",
        "validation": null
      }
    ]
  },
  "extractionResult": {
    "items": [
      {
        "checklistItemCode": "company-legal-name",
        "label": "Company Name",
        "leadChecklistItemId": "adc887d0-7238-4ce0-998d-523a22c282f4",
        "value": "Monumint Technology Inc."
      }
    ],
    "extractedCount": 1
  }
}
```

### Completed with validation failure

When at least one matched checklist item has `validation.status: "invalid"`, extraction is not run, but the pipeline still reports `status: completed`. `extractionResult` is still present with an empty `items` array and `extractedCount: 0`; the per-item `validation` block on each matched item carries the failure reasons (`null` when no rules ran).

```json theme={null}
{
  "event": "document.extracted",
  "workspaceId": "6048d78a-584a-4f1e-9e39-e011ca4cc48c",
  "leadId": "910bb19a-2e9d-400f-8d15-9c461bb0f4aa",
  "externalLeadId": "SF-00142",
  "documentId": "8f0c3d1b-2a00-4f0d-8c1e-0e5f1a2b3c4d",
  "externalId": "DOC-2025-002",
  "status": "completed",
  "parentActionId": "9d7fe2f3-ec1a-481c-b814-a0d1c8017e1f",
  "summary": "Monthly business checking statement.",
  "type": "Bank Statement",
  "classification": {
    "noMatchedItemReason": null,
    "matchedChecklistItems": [
      {
        "checklistItemCode": "bank-statement",
        "fieldType": "BANK_STATEMENT",
        "label": "Recent bank statement",
        "leadChecklistItemId": "5e6f7a8b-9c0d-4e1f-a2b3-c4d5e6f7a8b9",
        "validation": {
          "reasons": [
            "The statement end date is earlier than the requested coverage period."
          ],
          "status": "invalid"
        }
      }
    ]
  },
  "extractionResult": {
    "items": [],
    "extractedCount": 0
  }
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.