> ## 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.

# Record Staged Document

> Build the registry transaction that records a staged loan document

Returns the unsigned `setDocument` transaction that records a staged loan document exactly as it was staged: the loan, the name and the SHA-256, private. The market admin signs it, then confirms it with [Confirm Document](https://docs.trusset.org/endpoints/lending/confirm-legal-document.md), which marks the staged entry `RECORDED`.

Only an instance one of whose verified wallets holds `DEFAULT_ADMIN_ROLE` on the market can record a document another instance staged. The checks and the response are those of [Record Document](https://docs.trusset.org/endpoints/lending/record-legal-document.md), with the staged entry added as `stage`.

## Path Parameters

**marketId** `string` *required*

The market's record ID on your instance.

**stageId** `string` *required*

The `id` of the staged document, from [Get Documents](https://docs.trusset.org/endpoints/lending/get-legal-documents.md).

## Body Parameters

**signerAddress** `string`

The admin wallet that will sign, when your instance has more than one.

## Error Codes

| Code | HTTP | Cause |
| - | - | - |
| `STAGE_NOT_FOUND` | `404` | No staged document with that id for this market that your instance may see |
| `STAGE_NOT_PENDING` | `409` | The document is already recorded or was dismissed. `details.status` says which |
| `NOT_MARKET_ADMIN` | `403` | No verified wallet of your instance holds `DEFAULT_ADMIN_ROLE` on the market |
| `DOCUMENT_CURRENT` | `409` | The registry already holds this document. Confirm nothing; read the documents again |
| `LOAN_DOCUMENT_MUST_BE_PRIVATE` | `422` | The entry was staged public before loan documents became private only. Dismiss it; the borrower stages it again as private |

Every other code of [Record Document](https://docs.trusset.org/endpoints/lending/record-legal-document.md#error-codes) applies.


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