# docx.extract.document

docx.extract.document: Read a Word file's clauses and fields (parties, dates, amounts, governing law) with the exact words and location each one came from.

Read a Word file's clauses and fields (parties, dates, amounts, governing law) with the exact words and location each one came from.

Use `describe("docx.extract.document")` when your code needs the complete live JSON Schemas.

## At a glance

| Property | Value |
| --- | --- |
| Package | `@runstamp/registry` |
| Domain / verb | `docx` / `extract` |
| Customer jobs | extract, read |
| Deterministic | No |
| Side effects | none |

## Availability

| Local | SDK | CLI | MCP | Managed API |
| --- | --- | --- | --- | --- |
| unavailable | unavailable | unavailable | unavailable | public ga |

Managed API route: `POST /api/v2/operations/docx/extract/document`. Managed execution requires a free-trial workspace or an active Platform or Enterprise workspace, and an environment-bound API key.

## Input and result

| Schema | Required fields | Optional fields |
| --- | --- | --- |
| Input | none | none |
| Options | none | `extract`, `proposal`, `deterministic`, `deterministicSeed`, `timeoutMs`, `locale`, `lossPolicy`, `limits` |
| Result value | `artifact`, `clauses`, `fields`, `stats`, `proposal` | none |

Every success also carries `losses`, `diagnostics`, and a hash-bound `receipt`.

<Accordion title="Defaults, limits, and format constraints">

### Defaults

| Path | Default |
| --- | --- |
| `$.deterministic` | `default=true` |
| `$.lossPolicy` | `default="collect"` |

### Formats and profiles

No separate format selector is declared. Accepted artifacts are bounded by the exact input schema.

### Other limits

| Path | Constraint |
| --- | --- |
| `$.timeoutMs` | `minimum=1` |

</Accordion>

## Invoke

<CodeGroup>

```ts TypeScript docs-verify=skip docs-verify-reason="Generated example uses the published, hash-verified operation input."
const input = await fetch("https://runstamp.com/demo-evidence/operation-evidence/docx/docx.extract.document/input.json").then((response) => response.json());
const result = await runstamp.run("docx.extract.document", input);
if (!result.ok) throw new Error(`${result.error.code}: ${result.error.remediation}`);
console.log(result.value, result.losses, result.diagnostics, result.receipt);
```

```bash CLI
curl -fsS https://runstamp.com/demo-evidence/operation-evidence/docx/docx.extract.document/input.json -o input.json
npx -p @runstamp/sdk runstamp ops invoke docx.extract.document --input input.json
```

```json MCP
{
  "tool": "runstamp_invoke_operation",
  "arguments": {
    "operation": "docx.extract.document",
    "input": "<JSON from https://runstamp.com/demo-evidence/operation-evidence/docx/docx.extract.document/input.json>",
    "execution_mode": "local"
  }
}
```

</CodeGroup>

## Errors and losses

<Accordion title="Declared errors (6)">

- `common/SCHEMA_REJECTED`
- `common/CONTRACT_VIOLATION`
- `common/OPERATION_CANCELLED`
- `common/OPERATION_TIMEOUT`
- `common/RESOURCE_LIMIT_EXCEEDED`
- `common/INPUT_CORRUPT`

</Accordion>

<Accordion title="Declared losses (0)">

- None.

</Accordion>

SDK `AbortSignal`, CLI exit 130, and MCP cancellation return the typed `common/OPERATION_CANCELLED` failure envelope.

## Verified example and exact contract

- Fixture: `icp-workflow` (U.S. courts Pro Se 7 complaint for employment discrimination, a public court form).
- [Example input](/demo-evidence/operation-evidence/docx/docx.extract.document/input.json) — SHA-256 `f1dc999878e7f22aa94313c94554c41d1ac7a616775870d28d6116a2375220de`.
- [Example result](/demo-evidence/operation-evidence/docx/docx.extract.document/result.json) — SHA-256 `98e2d5338dc09ef7714bfa1c3bb81d11799e7f34ad8b8b20931fdc2afcabb718`.
- Verified result SHA-256: `98e2d5338dc09ef7714bfa1c3bb81d11799e7f34ad8b8b20931fdc2afcabb718`.
- Qualification lane: `10-pptx-docx`.

<Accordion title="Contract fingerprints">

- Descriptor: `ff2b4fac55f0f55810b16ab1863eaae7be7642491168efd89c4e50b4c9ceef2a`.
- Input schema: `379b8bad759a0f33b2de1641bc72bde815a003d926a591f3e1ca34e7f4d6b227`.
- Options schema: `ce2f8a0348aedb2eb3ce6cc34b401ef76a51d1a19ee059e803cc827230ee9eba`.
- Result value schema: `2668f3d621741152d9b76cf4a794611a557a968778854ed5c9dea0caf6e41dcb`.

</Accordion>

The [machine-readable operation reference](/operation-reference.json) publishes the complete schemas, qualification results, and evidence bindings for every operation.
