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

# Confirm Document

> Verify a registry transaction from its receipt and record the outcome

Confirms a mined `setDocument` or `removeDocument` transaction. The server reads the receipt itself: the transaction must target the document registry, call `setDocument` or `removeDocument`, be signed by a verified wallet of your instance, and emit `DocumentUpdated` or `DocumentRemoved` for this market. What is recorded comes from those events, never from the request.

The confirm marks staged loan documents recorded when an event carries their loan, name, hash and locator, and writes one audit entry per event. Confirming the same transaction again changes nothing and writes no second audit entry. A transaction signed through a smart account that wraps the call is verified through the wrapped call.

## Path Parameters

**marketId** `string` *required*

The market's record ID on your instance.

## Body Parameters

**txHash** `string` *required*

The hash of the mined transaction.

## Response Fields

**data** `object`

**txHash** `string`

The verified transaction.

**signer** `string`

The wallet that signed it.

**blockNumber** `integer`

The block it mined in.

**recordedAt** `string`

The block time.

**events** `array`

Each `{ kind, loanId, name, nameValid, nameBytes32, uri, documentHash, contentHash, visibility, by, logIndex }`. `kind` is `UPDATED` or `REMOVED`; `by` is the writing admin wallet.

**stagesRecorded** `integer`

Staged loan documents this transaction recorded.

**agreementsRecorded** `array`

Present when the transaction recorded the commitment of a bound [loan agreement](https://docs.trusset.org/endpoints/lending/loan-agreements.md): `{ ref, loanId, status }`. A `LOAN` agreement turns `RECORDED`.

```json 201 Confirmed theme={null}
{
  "success": true,
  "data": {
    "txHash": "0x74e710c780867e261e60a45b0ef20096d2a0325bc74c63a15fff6d4808732da2",
    "signer": "0x5a0c2e5768bc6cf83bf0774ef31e2d151b37049f",
    "blockNumber": 12107712,
    "recordedAt": "2026-11-10T23:16:37.000Z",
    "events": [
      {
        "kind": "UPDATED",
        "loanId": "0",
        "name": "licence-position",
        "nameValid": true,
        "nameBytes32": "0x6c6963656e63652d706f736974696f6e00000000000000000000000000000000",
        "uri": null,
        "documentHash": "0x7b07f820b06405c134ed2e3a6ff722c4c7f7822c9ed18e4ba5140f9d0a9a4a1f",
        "contentHash": "7b07f820b06405c134ed2e3a6ff722c4c7f7822c9ed18e4ba5140f9d0a9a4a1f",
        "visibility": "private",
        "by": "0x5a0c2e5768bc6cf83bf0774ef31e2d151b37049f",
        "logIndex": 0
      }
    ],
    "stagesRecorded": 0,
    "marketId": "cmwbb5kji000bjww94goqt9km"
  },
  "error": null
}
```

## Error Codes

| Code | HTTP | Cause |
| - | - | - |
| `VALIDATION_ERROR` | `400` | `txHash` is missing or malformed |
| `TX_REVERTED` | `400` | The transaction reverted. Nothing was recorded |
| `TX_WRONG_TARGET`, `TX_WRONG_FUNCTION` | `400` | The transaction does not call `setDocument` or `removeDocument` on the registry |
| `TX_NOT_VERIFIED` | `400` | The transaction emits no document event for this market |
| `DOCUMENT_WRITE_NOT_INSTANCE_BOUND` | `403` | The signer is not a verified wallet of your instance |
| `TX_NOT_FOUND` | `404` | The transaction is not mined yet. Retry shortly |
| `MARKET_NOT_FOUND` | `404` | No market with this ID on your instance |
| `DOCUMENT_REGISTRY_NOT_CONFIGURED` | `501` | The document registry is not deployed on this network |
| `CHAIN_UNAVAILABLE`, `SERVICE_UNAVAILABLE` | `503` | The chain or this instance's wallets could not be read. The record on chain is unaffected; send the same `txHash` again shortly |


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