> For the complete documentation index, see [llms.txt](https://api-docs.hengelending.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://api-docs.hengelending.com/mcp/tool-reference/documents.md). Agents can also search and read this documentation through its [MCP server](https://api-docs.hengelending.com/~gitbook/mcp).

# Documents

Loan documents: the vault, review, search over their text, history, trailing documents and e-sign packages.

{% hint style="info" %}
Generated from the MCP server's code. Do not edit this page in GitBook: changes are overwritten on the next sync.
{% endhint %}

## accept\_loan\_document

Accept the document a borrower uploaded to a task or condition, the same review the Henge Partner API and the Documents page perform. Identify the loan by its MLM ExternalId (preferred) or its internal Henge GUID, and the task by taskId. Accepting marks the task Accepted and the document Screened (its losStatus), UPLOADS THE DOCUMENT TO THE LOAN ORIGINATION SYSTEM in the background, where it is marked Screened too, then queues the loan for a sync and notifies the task's subscribers. Refused when the task has no document, and while a non-PDF upload is still being converted to PDF (retry shortly). A later upload to an accepted task opens a new copy of the task rather than replacing the accepted document. To refuse the document instead, use reject\_loan\_document.

**Who can call it:** Admin, Processor, CompanyAdmin, Assistant, ConciergeKey

**Reads or writes:** writes; can delete, cost money or reach someone outside, so a client should ask first

| Input               | Type          | Description                                                                                                                                                                                                                                                                                        |
| ------------------- | ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `taskId`            | string (uuid) | REQUIRED. The id (GUID) of the task the document was uploaded to: the document's loanApplicationTaskId on get\_loan\_application\_documents, or the task id on get\_loan\_application\_borrower\_tasks / get\_loan\_application\_conditions.                                                       |
| `externalId`        | string        | PREFERRED when available. The MLM ExternalId of the loan (string, up to 108 chars). Use this whenever the loan already exists in MLM — it is the stable identifier humans see in MLM UIs and is what webhooks surface. If both ids are supplied, externalId wins and loanApplicationId is ignored. |
| `loanApplicationId` | string (uuid) | Fallback identifier: the Henge internal loan application ID (GUID). Use this only when no externalId is known — typically because the loan has not yet been pushed to MLM.                                                                                                                         |

## add\_loan\_document\_internal\_note

Add an Internal Note to a loan document. THIS WRITES TO THE LOS, the Loan Origination System of record: the note is appended to the document's Internal Notes there (the eDoc's internal comments), stamped with your name and today's date, and the existing notes are kept. Internal Notes are read by underwriters and processors, never by the borrower; write them that way (for example what is wrong with the document or where it was sent). Identify the loan by its MLM ExternalId (preferred) or internal GUID and the document by documentId from get\_loan\_application\_documents. Only a document filed in the LOS (it has an externalId) and not isObsolete can take a note; anything else is refused. DO NOT CALL THIS TWICE FOR THE SAME NOTE: each call appends, so a retry adds the note a second time - if a call appears to fail, read the document back with get\_loan\_application\_documents and check internalNotes first. Returns the document's full Internal Notes after the append. Restricted to Admin and Processor. An entry is written to the loan's activity log.

**Who can call it:** Admin, Processor

**Reads or writes:** writes

| Input               | Type          | Description                                                                                                                                                                                                                                                                                         |
| ------------------- | ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `documentId`        | string (uuid) | REQUIRED. The document's Henge id, as returned by get\_loan\_application\_documents. The document must have an externalId there (filed in the LOS) and not be isObsolete.                                                                                                                           |
| `note`              | string        | REQUIRED. The note to add, as plain text, for example "Statement is missing page 3". It is appended to the document's existing Internal Notes in the LOS with your name and today's date; nothing already there is changed. Internal: underwriters and processors read it, the borrower never does. |
| `externalId`        | string        | PREFERRED when available. The MLM ExternalId of the loan (string, up to 108 chars). Use this whenever the loan already exists in MLM — it is the stable identifier humans see in MLM UIs and is what webhooks surface. If both ids are supplied, externalId wins and loanApplicationId is ignored.  |
| `loanApplicationId` | string (uuid) | Fallback identifier: the Henge internal loan application ID (GUID). Use this only when no externalId is known — typically because the loan has not yet been pushed to MLM.                                                                                                                          |

## create\_loan\_esign\_draft

Create a DRAFT e-sign package in the company's PandaDoc account from the loan's vault documents (PDFs), with signers chosen from the loan's borrowers/co-borrowers and, optionally, its contacts. Nothing is sent to a signer and no credit is spent yet: the result carries the package id and editorUrl, where the user places a signature field for every signer in PandaDoc; only then can send\_loan\_esign\_package send it. Confirm with the user which documents and which signers before calling. A signer without an email address is refused by name, and so is a company whose PandaDoc keys are not set up. Identify the loan by its MLM ExternalId (preferred) or its internal Henge GUID.

**Who can call it:** Admin, Processor, Agent, DualLicensedAgent, ConciergeKey

**Reads or writes:** writes

| Input               | Type                   | Description                                                                                                                                                                                                                                                                                        |
| ------------------- | ---------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `name`              | string                 | Optional. The document's name in PandaDoc. Defaults to 'Loan documents - {loan number}'.                                                                                                                                                                                                           |
| `vaultDocumentIds`  | array of string (uuid) | The ids (GUIDs) of the loan's vault documents to include, from get\_loan\_documents. PDFs only; they are merged into one document. Uploading a new file is not possible from here: file it to the loan's vault first.                                                                              |
| `borrowerIds`       | array of string (uuid) | The borrower ids (GUIDs) of the loan's borrowers or co-borrowers who must sign. Each needs an email address on the loan; one without is refused by name.                                                                                                                                           |
| `contactIds`        | array of string (uuid) | Optional. The ExternalId (GUID) of each loan contact who must sign, from get\_loan\_application\_contacts. Each needs an email address.                                                                                                                                                            |
| `externalId`        | string                 | PREFERRED when available. The MLM ExternalId of the loan (string, up to 108 chars). Use this whenever the loan already exists in MLM — it is the stable identifier humans see in MLM UIs and is what webhooks surface. If both ids are supplied, externalId wins and loanApplicationId is ignored. |
| `loanApplicationId` | string (uuid)          | Fallback identifier: the Henge internal loan application ID (GUID). Use this only when no externalId is known — typically because the loan has not yet been pushed to MLM.                                                                                                                         |

## decide\_inbox\_item

Decide one document in a loan's inbox (see get\_loan\_inbox). Identify the loan by its MLM ExternalId (preferred) or its internal Henge GUID, the document by documentId, and the decision: ConfirmType (the document is this type, loanDocumentTypeId from get\_loan\_document\_types, omit it to confirm the proposed type; an optional title), MoveToRequest (put it on taskId, omit it to use the proposed request), MarkInternal (hide it from borrowers, not filed), SendBack (reject it back to the uploader with a required reason; the document must be on a request) or Dismiss (not a loan document: kept, not filed; an optional reason). The decision is recorded with who and when, writes a labelled example for the classifier and a loan activity entry, and files through the same routes as move\_loan\_document, update\_loan\_document and reject\_loan\_document. A document that was already decided is a conflict; one not in the inbox is not found. This cannot be undone through this tool. Admin and Processor only.

**Who can call it:** Admin, Processor

**Reads or writes:** writes; can delete, cost money or reach someone outside, so a client should ask first

**Availability:** only where the `document-inbox` release flag is on for the caller.

| Input                | Type          | Description                                                                                                                                                                                                                                                                                        |
| -------------------- | ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `documentId`         | string (uuid) | REQUIRED. The document's id, as get\_loan\_inbox returns it.                                                                                                                                                                                                                                       |
| `decision`           | string        | REQUIRED. One of ConfirmType, MoveToRequest, MarkInternal, SendBack or Dismiss.                                                                                                                                                                                                                    |
| `loanDocumentTypeId` | string (uuid) | ConfirmType: the document type to file under (from get\_loan\_document\_types). Omit to confirm the proposed type.                                                                                                                                                                                 |
| `title`              | string        | ConfirmType: the title to give the document. Omit to keep the current one.                                                                                                                                                                                                                         |
| `taskId`             | string (uuid) | MoveToRequest: the task or condition to put the document on. Omit to use the proposed request.                                                                                                                                                                                                     |
| `reason`             | string        | SendBack: REQUIRED, what the uploader is told (at most 512 characters). Dismiss: an optional note.                                                                                                                                                                                                 |
| `rejectionReasonId`  | string (uuid) | SendBack: the rejection reason id from get\_loan\_document\_rejection\_reasons. Omit to use the first.                                                                                                                                                                                             |
| `externalId`         | string        | PREFERRED when available. The MLM ExternalId of the loan (string, up to 108 chars). Use this whenever the loan already exists in MLM — it is the stable identifier humans see in MLM UIs and is what webhooks surface. If both ids are supplied, externalId wins and loanApplicationId is ignored. |
| `loanApplicationId`  | string (uuid) | Fallback identifier: the Henge internal loan application ID (GUID). Use this only when no externalId is known — typically because the loan has not yet been pushed to MLM.                                                                                                                         |

## delete\_loan\_document

Delete a document that was uploaded straight to a loan application (the vault), the same delete the Henge Partner API performs. Identify the loan by its MLM ExternalId (preferred) or its internal Henge GUID, and the document by documentId from get\_loan\_application\_documents. Only a document with no loanApplicationTaskId can be deleted; a document on a task, condition or asset account is refused as not found, because deleting it would leave its task asking for something the borrower already sent. The document is removed from Henge, and when it was filed in the Loan Origination System its copy there is deleted too, on a best-effort basis. There is no undo through MCP.

**Who can call it:** Admin, Agent, Processor, CompanyAdmin, Assistant, ConciergeKey

**Reads or writes:** writes; can delete, cost money or reach someone outside, so a client should ask first

| Input               | Type          | Description                                                                                                                                                                                                                                                                                        |
| ------------------- | ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `documentId`        | string (uuid) | REQUIRED. The Henge id (GUID) of the document to delete, from get\_loan\_application\_documents. Only a document uploaded straight to the loan (no loanApplicationTaskId) can be deleted.                                                                                                          |
| `externalId`        | string        | PREFERRED when available. The MLM ExternalId of the loan (string, up to 108 chars). Use this whenever the loan already exists in MLM — it is the stable identifier humans see in MLM UIs and is what webhooks surface. If both ids are supplied, externalId wins and loanApplicationId is ignored. |
| `loanApplicationId` | string (uuid) | Fallback identifier: the Henge internal loan application ID (GUID). Use this only when no externalId is known — typically because the loan has not yet been pushed to MLM.                                                                                                                         |

## get\_document\_check\_findings

List a loan's document check findings: the places where the loan's documents disagree with each other, with the application, the credit report or Plaid. Identify the loan by its MLM ExternalId (preferred) or its internal Henge GUID. Each finding has ruleId (party-identity, borrower-address, subject-address, employer, paystub-ytd, income-vs-application, statement-continuity, balance-vs-account, large-deposit, nsf-overdraft, liability-without-reo, reo-without-liability, undisclosed-reo), a summary, the guideline citation, severity (Low, Medium, High), the documents and pages involved, the values compared with where each came from, and status (Open, Dismissed, Resolved) with who changed it (null when the system did), when and why. The findings are evaluated against the loan as it is now. Optionally filter by status; open findings come first. Findings are advice for the processor: they never block a submission or a status change. Admin and Processor only.

**Who can call it:** Admin, Processor

**Reads or writes:** reads only

**Availability:** only where the `document-checks` release flag is on for the caller.

| Input               | Type          | Description                                                                                                                                                                                                                                                                                        |
| ------------------- | ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `status`            | string        | Only the findings in this status: Open, Dismissed or Resolved. Omit for all.                                                                                                                                                                                                                       |
| `externalId`        | string        | PREFERRED when available. The MLM ExternalId of the loan (string, up to 108 chars). Use this whenever the loan already exists in MLM — it is the stable identifier humans see in MLM UIs and is what webhooks surface. If both ids are supplied, externalId wins and loanApplicationId is ignored. |
| `loanApplicationId` | string (uuid) | Fallback identifier: the Henge internal loan application ID (GUID). Use this only when no externalId is known — typically because the loan has not yet been pushed to MLM.                                                                                                                         |

## get\_document\_history

Return one document's history as a single timeline, newest first: the internal notes the team wrote on it and what happened to it (uploaded, type changed, accepted, rejected, moved, made internal, renamed, replaced, deleted, made obsolete). Identify the loan by its MLM ExternalId (preferred) or its internal Henge GUID, and the document by documentId. Each entry has kind (Note or Event), eventType (events only), text, actor (id and name; null when unknown), timestamp, oldValue and newValue (events only), backfilled (true when the event was reconstructed from existing data rather than recorded as it happened) and isEdited (notes). Internal only: borrowers never see it. Paged: page (default 1) and pageSize (default 50, max 200); totalCount is the number of entries across all pages.

**Who can call it:** Admin, Agent, DualLicensedAgent, Processor, CompanyAdmin, Assistant, ConciergeKey

**Reads or writes:** reads only

| Input               | Type          | Description                                                                                                                                                                                                                                                                                        |
| ------------------- | ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `documentId`        | string (uuid) | REQUIRED. The document's id, as the loan's document lists return it.                                                                                                                                                                                                                               |
| `page`              | integer       | 1-based page. Defaults to 1.                                                                                                                                                                                                                                                                       |
| `pageSize`          | integer       | Entries per page, 1 to 200. Defaults to 50.                                                                                                                                                                                                                                                        |
| `externalId`        | string        | PREFERRED when available. The MLM ExternalId of the loan (string, up to 108 chars). Use this whenever the loan already exists in MLM — it is the stable identifier humans see in MLM UIs and is what webhooks surface. If both ids are supplied, externalId wins and loanApplicationId is ignored. |
| `loanApplicationId` | string (uuid) | Fallback identifier: the Henge internal loan application ID (GUID). Use this only when no externalId is known — typically because the loan has not yet been pushed to MLM.                                                                                                                         |

## get\_loan\_application\_documents

List EVERY document on a loan application in one call, whatever it is attached to: documents uploaded straight to the loan, and those attached to borrower tasks, user tasks, underwriting conditions and asset accounts. Identify the loan by its MLM ExternalId (preferred when the loan is in MLM) or its internal Henge GUID. Each document returns its Henge id, title, original file name, description, PDF conversion status, timestamps, and the LOS document id once it has been filed there. A document with a loanApplicationTaskId is attached to that task, which is how you correlate it with get\_loan\_application\_borrower\_tasks, get\_loan\_application\_user\_tasks and get\_loan\_application\_conditions; one without was uploaded straight to the loan. Either kind can be given a document type. Optionally narrow by folder. Prefer this over the per-task tools when asked what documents a loan has. isObsolete marks a document the LOS has retired or rejected; it remains listed but should not be treated as current. For Admin and Processor callers a document filed in the LOS also carries internalNotes: the Internal Notes the LOS holds on that document (a processor's or underwriter's comment such as what is wrong with it or where it was sent). Treat them as internal only and never quote them to a borrower; internalNotes is null for every other role and when there is no note. Document contents are not returned, only metadata; for staff callers indexStatus (Indexed, Pending, Failed, NotSubmitted) says whether search\_loan\_documents and get\_loan\_document\_text can read the document's text. A borrower (Client) caller can read only loans on which they are a borrower and sees what the borrower portal shows: vault documents and documents on borrower-assigned tasks, never internal documents or user-task documents. A sandbox loan has no documents of its own, so its list is empty: read the documents of its source loan (sourceLoanApplicationId on get\_loan\_application).

**Who can call it:** Admin, Agent, DualLicensedAgent, Processor, CompanyAdmin, Assistant, ConciergeKey, Client

**Reads or writes:** reads only

| Input               | Type          | Description                                                                                                                                                                                                                                                                                                                            |
| ------------------- | ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `folderName`        | string        | Optional folder to filter by, e.g. "ASSETS", "INCOME", "APPRAISAL". Case-insensitive, exact match on the whole folder name. A document has a folder only once someone gives it a document type, which most have not, so any folder filter excludes every untyped document. Call get\_loan\_document\_types for the valid folder names. |
| `externalId`        | string        | PREFERRED when available. The MLM ExternalId of the loan (string, up to 108 chars). Use this whenever the loan already exists in MLM — it is the stable identifier humans see in MLM UIs and is what webhooks surface. If both ids are supplied, externalId wins and loanApplicationId is ignored.                                     |
| `loanApplicationId` | string (uuid) | Fallback identifier: the Henge internal loan application ID (GUID). Use this only when no externalId is known — typically because the loan has not yet been pushed to MLM.                                                                                                                                                             |

## get\_loan\_document\_index\_status

Show where every live document on a loan stands in the document search index: Indexed, Pending, Failed (with the error, e.g. a password-protected file) or NotSubmitted, with counts. Identify the loan by its MLM ExternalId (preferred) or its internal Henge GUID. Use it to explain why search\_loan\_documents cannot find something, and before reindex\_loan\_documents. Admin and Processor only.

**Who can call it:** Admin, Processor

**Reads or writes:** reads only

| Input               | Type          | Description                                                                                                                                                                                                                                                                                        |
| ------------------- | ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `externalId`        | string        | PREFERRED when available. The MLM ExternalId of the loan (string, up to 108 chars). Use this whenever the loan already exists in MLM — it is the stable identifier humans see in MLM UIs and is what webhooks surface. If both ids are supplied, externalId wins and loanApplicationId is ignored. |
| `loanApplicationId` | string (uuid) | Fallback identifier: the Henge internal loan application ID (GUID). Use this only when no externalId is known — typically because the loan has not yet been pushed to MLM.                                                                                                                         |

## get\_loan\_document\_intake\_batches

Read the record of every batch of documents sent to a loan with upload\_unsorted\_loan\_documents or the app's bulk upload, newest first. Identify the loan by its MLM ExternalId (preferred) or its internal Henge GUID. Each batch says which channel it came in by (Upload, PartnerApi, Mcp or Email), who sent it (uploadedBy, uploadedByName, uploadedByType) and on whose behalf (onBehalfOf, the loan's loan officer when someone else sent it), and lists its files. Each file carries its events oldest first: Received, Rejected (with the reason; a rejected file has no documentId), NeedsPassword, PasswordOpened, Split (and the pages of the original a part was cut from), SplitUndone, Duplicate, Typed, Renamed, Matched (a suggestion until a person confirms it), Filed, Superseded, and Confirmed or Corrected when a person accepted or changed what the system suggested. Each event names who did it: actorType is System for the system, else the person's type, with actorName when known. Nothing is ever purged: unsorted documents, the original of a split PDF and earlier versions are kept for the life of the loan, and so is this record. Only batches sent while the intake flag was on are recorded. Admin, Processor, CompanyAdmin or ConciergeKey. Read only.

**Who can call it:** Admin, Processor, CompanyAdmin, ConciergeKey

**Reads or writes:** reads only

**Availability:** only where the `tpo-document-intake` release flag is on for the caller.

| Input               | Type          | Description                                                                                                                                                                                                                                                                                        |
| ------------------- | ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `externalId`        | string        | PREFERRED when available. The MLM ExternalId of the loan (string, up to 108 chars). Use this whenever the loan already exists in MLM — it is the stable identifier humans see in MLM UIs and is what webhooks surface. If both ids are supplied, externalId wins and loanApplicationId is ignored. |
| `loanApplicationId` | string (uuid) | Fallback identifier: the Henge internal loan application ID (GUID). Use this only when no externalId is known — typically because the loan has not yet been pushed to MLM.                                                                                                                         |

## get\_loan\_document\_rejection\_reasons

Return the reasons a loan document can be rejected for (id, name, code), in display order. Call this before reject\_loan\_document: the reason 'id' returned here is the only value its rejectionReasonId accepts, so never guess one. The list is company-agnostic and holds no loan data.

**Who can call it:** Admin, Agent, Processor, CompanyAdmin, Assistant, ConciergeKey

**Reads or writes:** reads only

Takes no inputs.

## get\_loan\_document\_text

Read the extracted text of one document on a loan, so you can read a paystub, statement or letter rather than only finding passages in it. Identify the loan by its MLM ExternalId (preferred) or its internal Henge GUID, and the document by documentId (from get\_loan\_application\_documents or a search\_loan\_documents hit). Returns markdown in which each page starts with a \<!-- rf:page N --> marker, plus the document's indexStatus and extraction warnings. Use fromPage/toPage for a range; a long document is cut at whole pages and nextFromPage says where to continue. Tables may appear as HTML. When indexStatus is Pending, Failed or NotSubmitted there may be no text yet; say so rather than guessing at the contents. A borrower (Client) caller can read only the documents their portal lists on a loan they are a borrower on; any other document is not found.

**Who can call it:** Admin, Agent, Processor, CompanyAdmin, ConciergeKey, DualLicensedAgent, Client

**Reads or writes:** reads only

| Input               | Type          | Description                                                                                                                                                                                                                                                                                        |
| ------------------- | ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `documentId`        | string (uuid) | The document to read, by the id from get\_loan\_application\_documents or a search hit's document.loanApplicationDocumentId. Required.                                                                                                                                                             |
| `fromPage`          | integer       | Optional. First page to return, 1-based. Use the nextFromPage of a previous call to continue a long document.                                                                                                                                                                                      |
| `toPage`            | integer       | Optional. Last page to return, inclusive.                                                                                                                                                                                                                                                          |
| `externalId`        | string        | PREFERRED when available. The MLM ExternalId of the loan (string, up to 108 chars). Use this whenever the loan already exists in MLM — it is the stable identifier humans see in MLM UIs and is what webhooks surface. If both ids are supplied, externalId wins and loanApplicationId is ignored. |
| `loanApplicationId` | string (uuid) | Fallback identifier: the Henge internal loan application ID (GUID). Use this only when no externalId is known — typically because the loan has not yet been pushed to MLM.                                                                                                                         |

## get\_loan\_document\_types

Return every document type a loan document can be filed under, grouped by folder (APPRAISAL, ASSETS, INCOME, BORROWER, CREDIT, TITLE, UNCLASSIFIED, and others). Folders, and the types inside each folder, come back in display order. Call this before passing loanDocumentTypeId to update\_loan\_document: the type 'id' returned here is the only value that field accepts, so never guess a type name or invent an id. The vocabulary is seeded from the Loan Origination System and changes only when the LOS revises its own list.

**Who can call it:** Admin, Processor, DualLicensedAgent, ConciergeKey, Agent

**Reads or writes:** reads only

Takes no inputs.

## get\_loan\_esign\_packages

List a loan's e-sign packages (documents sent for signature through the company's PandaDoc account), newest first, or read one with packageId. Each has its status (Draft, Sent, Viewed, Completed, Declined or Voided), its documents, its signers with whether each has signed, the PandaDoc events applied so far, the vault document the signed PDF was filed as once it completes (signedDocumentId), and for a Draft the editorUrl where the sender places signature fields in PandaDoc. This lists packages sent through PandaDoc only: for the disclosure packages sent from the LOS, and who has signed each, read loanTimeline.signaturePackages from get\_loan\_application. Identify the loan by its MLM ExternalId (preferred) or its internal Henge GUID. Read-only.

**Who can call it:** Admin, Processor, Agent, DualLicensedAgent, ConciergeKey

**Reads or writes:** reads only

| Input               | Type          | Description                                                                                                                                                                                                                                                                                        |
| ------------------- | ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `packageId`         | string (uuid) | Optional. One package's id (GUID) from a previous call. Omit to list every e-sign package on the loan, newest first.                                                                                                                                                                               |
| `externalId`        | string        | PREFERRED when available. The MLM ExternalId of the loan (string, up to 108 chars). Use this whenever the loan already exists in MLM — it is the stable identifier humans see in MLM UIs and is what webhooks surface. If both ids are supplied, externalId wins and loanApplicationId is ignored. |
| `loanApplicationId` | string (uuid) | Fallback identifier: the Henge internal loan application ID (GUID). Use this only when no externalId is known — typically because the loan has not yet been pushed to MLM.                                                                                                                         |

## get\_loan\_inbox

List the documents on a loan that are waiting for a decision, newest first. Identify the loan by its MLM ExternalId (preferred) or its internal Henge GUID. Each item has the documentId and its pages, the submission (channel, sender, on whose behalf, when it was received), the pipeline's proposal (document type and confidence, the judge's title, request, verdict and reason), page issues, the open document check findings and pending condition proposals for the document, taskId (the request it sits on, if any) and whyInInbox. An item leaves the inbox only when someone decides it with decide\_inbox\_item, or the document is deleted, split or superseded. Optionally filter by channel or minimum wait, and page with page and pageSize. Admin and Processor only.

**Who can call it:** Admin, Processor

**Reads or writes:** reads only

**Availability:** only where the `document-inbox` release flag is on for the caller.

| Input               | Type          | Description                                                                                                                                                                                                                                                                                        |
| ------------------- | ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `channel`           | string        | Only items that came in by this channel: Upload, PartnerApi, Mcp, Email, Vault or TaskUpload. Omit for all.                                                                                                                                                                                        |
| `olderThanHours`    | integer       | Only items that have waited at least this many hours. Omit for all.                                                                                                                                                                                                                                |
| `page`              | integer       | 1-based page. Defaults to 1.                                                                                                                                                                                                                                                                       |
| `pageSize`          | integer       | Items per page, 1 to 200. Defaults to 50.                                                                                                                                                                                                                                                          |
| `externalId`        | string        | PREFERRED when available. The MLM ExternalId of the loan (string, up to 108 chars). Use this whenever the loan already exists in MLM — it is the stable identifier humans see in MLM UIs and is what webhooks surface. If both ids are supplied, externalId wins and loanApplicationId is ignored. |
| `loanApplicationId` | string (uuid) | Fallback identifier: the Henge internal loan application ID (GUID). Use this only when no externalId is known — typically because the loan has not yet been pushed to MLM.                                                                                                                         |

## get\_loan\_required\_documents

Return a loan's checklist of required documents and what is still missing. Identify the loan by its MLM ExternalId (preferred) or its internal Henge GUID. The list is built from the stored rules and the loan's program, purpose, income types, asset accounts, gifts and property type, so a W-2 borrower on a conventional purchase needs pay stubs, W-2s, statements for every account, an ID and the contract. Each item has a status: Missing (nothing filed satisfies it), Partial (some of its periods are covered, for example May's statement is filed and June's is not) or Complete. Statements, pay stubs, W-2s and returns are time series: one item lists expectedPeriods (months yyyy-MM, years yyyy, or a date range for pay stubs), coveredPeriods and missingPeriods, and a newer period never replaces an older one. documents links the filed documents the document analysis read as satisfying the item, each with the periods it covers. Only documents the analysis has finished reading are linked, so a file just uploaded may show as missing for a few minutes; a duplicate, a document waiting for its password and one found unreadable are not linked. rulesConfigured is false when no rules are stored, which means the empty list says nothing about what the loan needs. Counts are returned as missing, partial and complete. Staff only (Admin, Agent, Processor, CompanyAdmin, Assistant or ConciergeKey).

**Who can call it:** Admin, Agent, Processor, CompanyAdmin, Assistant, ConciergeKey

**Reads or writes:** reads only

**Availability:** only where the `tpo-document-intake` release flag is on for the caller.

| Input               | Type          | Description                                                                                                                                                                                                                                                                                        |
| ------------------- | ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `externalId`        | string        | PREFERRED when available. The MLM ExternalId of the loan (string, up to 108 chars). Use this whenever the loan already exists in MLM — it is the stable identifier humans see in MLM UIs and is what webhooks surface. If both ids are supplied, externalId wins and loanApplicationId is ignored. |
| `loanApplicationId` | string (uuid) | Fallback identifier: the Henge internal loan application ID (GUID). Use this only when no externalId is known — typically because the loan has not yet been pushed to MLM.                                                                                                                         |

## get\_loan\_signature\_packages

The live answer to "who has opened and signed each disclosure package": the loan's disclosure packages (sent from the LOS for e-signature), each read from the e-sign vendor when asked. Each entry has packageId, name, transactionId (the id of the LE or CD the package was generated with, the transactionId of its entry in loanTimeline.disclosureTracker; null when unknown), sentTimestamp, status (Cancelled when the vendor cancelled the package, otherwise Signed, Reviewed or AwaitingSignature), vendorStatus (the vendor's own status name, such as "In Progress" or "Printed"), signedTimestamp once every signer has signed, and live: true when the vendor answered for this package, false when it could not be reached and the entry is only what the loan's disclosure tasks say (a signer then has no invited, consented, viewed or declined time, and status is Signed or AwaitingSignature from the tasks). Each signer has name, role (Borrower or LoanOfficer), invitedTimestamp, consentedTimestamp, viewedTimestamp (the last time they opened the package), signedTimestamp and declinedTimestamp, all in UTC and null until it happens, plus email (the address the vendor sent that signer's invitation to) and taskId (that signer's disclosure task). Packages awaiting a signature come first, then the most recently sent. No signing link is returned. A borrower (Client) caller can read only loans on which they are a borrower, gets no signer email, and gets taskId only on the signers whose task is assigned to them. Reading a package the vendor shows signed accepts that signer's task if it is not accepted yet. Identify the loan by its MLM ExternalId (preferred) or its internal Henge GUID. Read-only.

**Who can call it:** Admin, Processor, CompanyProcessor, DualLicensedAgent, ConciergeKey, Agent, Client

**Reads or writes:** reads only

| Input               | Type          | Description                                                                                                                                                                                                                                                                                        |
| ------------------- | ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `externalId`        | string        | PREFERRED when available. The MLM ExternalId of the loan (string, up to 108 chars). Use this whenever the loan already exists in MLM — it is the stable identifier humans see in MLM UIs and is what webhooks surface. If both ids are supplied, externalId wins and loanApplicationId is ignored. |
| `loanApplicationId` | string (uuid) | Fallback identifier: the Henge internal loan application ID (GUID). Use this only when no externalId is known — typically because the loan has not yet been pushed to MLM.                                                                                                                         |

## get\_loan\_trailing\_documents

Return the MLM Trailing Documents tab for a loan: the post-closing documents that must be delivered to the investor. Identify the loan by its MLM ExternalId (preferred) or its internal Henge GUID. Returns the loanApplicationId and a trailingDocuments array with all twelve rows, populated or not: the eight fixed rows (Loan Package, Mortgage / Deed of Trust, Note, Final HUD-1 Settlement Stmt, Title Insurance Policy, Mortgage Ins Certificate, Final Hazard Ins Policy, Final Flood Ins Policy) and four custom rows whose name the user types (isNameEditable = true; name is null until someone sets it). Each row carries id (the stored row id, all zeros until something has been recorded for it), displayOrder, code (the key to pass to set\_loan\_trailing\_document), name, isNameEditable, comment, required, orderedDate, documentDate, receivedDate, shippedDate, method, tracking and reviewedDate. Dates and other empty cells come back null. A loan that has never been pushed to MLM returns empty rows.

**Who can call it:** Admin, Agent, DualLicensedAgent, Processor, CompanyAdmin, Assistant, ConciergeKey

**Reads or writes:** reads only

| Input               | Type          | Description                                                                                                                                                                                                                                                                                        |
| ------------------- | ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `externalId`        | string        | PREFERRED when available. The MLM ExternalId of the loan (string, up to 108 chars). Use this whenever the loan already exists in MLM — it is the stable identifier humans see in MLM UIs and is what webhooks surface. If both ids are supplied, externalId wins and loanApplicationId is ignored. |
| `loanApplicationId` | string (uuid) | Fallback identifier: the Henge internal loan application ID (GUID). Use this only when no externalId is known — typically because the loan has not yet been pushed to MLM.                                                                                                                         |

## move\_loan\_document

Move a document to a condition on the same loan, or attach a document uploaded straight to the loan (no loanApplicationTaskId) to one. Identify the loan by its MLM ExternalId (preferred) or its internal Henge GUID, the document by documentId from get\_loan\_application\_documents, and the condition by conditionId from get\_loan\_conditions (taskId, a task's id, still works in its place). The document lands the way an upload to that task would: a Requested or Rejected task takes it and becomes Uploaded; a task that already has its document is copied and the copy takes it. The task it leaves goes back to Requested, or is removed when it was a copy made for that document. A type the old task set follows the new task's default; a type someone picked stays. A default title is rebuilt with the new task's name; a title someone typed stays. A document already filed in the Loan Origination System is updated there first (its description and type), and is never uploaded a second time; one not yet filed goes up when its new task's document would, and a document on a condition is held until it is accepted. Refused as not found when the document or the task is not on this loan, and as a conflict when the document's task has been accepted or the target is a condition that already has a document. Writes an activity log entry. Returns the moved document in the same shape as get\_loan\_application\_documents.

**Who can call it:** Admin, Agent, Processor, CompanyAdmin, Assistant, ConciergeKey

**Reads or writes:** writes; can delete, cost money or reach someone outside, so a client should ask first

| Input               | Type          | Description                                                                                                                                                                                                                                                                                        |
| ------------------- | ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `documentId`        | string (uuid) | REQUIRED. The Henge id (GUID) of the document to move, from get\_loan\_application\_documents. It may be on a task already or have no loanApplicationTaskId (uploaded straight to the loan).                                                                                                       |
| `taskId`            | string (uuid) | The Henge id (GUID) of the task on the same loan to move the document to, from get\_loan\_conditions. Still works; prefer conditionId. Give taskId or conditionId, not both.                                                                                                                       |
| `conditionId`       | string (uuid) | The id (GUID) of the condition on the same loan to move the document to, from get\_loan\_conditions or create\_loan\_condition; it is the same before and after the loan is submitted. The document lands on the condition the way a move to its task does. Give taskId or conditionId, not both.  |
| `externalId`        | string        | PREFERRED when available. The MLM ExternalId of the loan (string, up to 108 chars). Use this whenever the loan already exists in MLM — it is the stable identifier humans see in MLM UIs and is what webhooks surface. If both ids are supplied, externalId wins and loanApplicationId is ignored. |
| `loanApplicationId` | string (uuid) | Fallback identifier: the Henge internal loan application ID (GUID). Use this only when no externalId is known — typically because the loan has not yet been pushed to MLM.                                                                                                                         |

## reindex\_loan\_documents

Submit one document, or every live document on a loan, to the document search index again. Identify the loan by its MLM ExternalId (preferred) or its internal Henge GUID; omit documentId for the whole loan. Without force, documents already indexed are left alone and failed or missing ones are submitted, which is free for a text-layer PDF and billed per scanned page. force=true RE-EXTRACTS EVERYTHING NAMED AND IS BILLED PER PAGE: ask the user before using it. Indexing runs in the background; check get\_loan\_document\_index\_status afterwards. The loan's documents themselves are not changed. Admin and Processor only.

**Who can call it:** Admin, Processor

**Reads or writes:** writes

| Input               | Type          | Description                                                                                                                                                                                                                                                                                        |
| ------------------- | ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `documentId`        | string (uuid) | Optional. The one document to reindex. Omit to reindex every live document on the loan.                                                                                                                                                                                                            |
| `force`             | boolean       | Optional, default false. true re-extracts even documents that are already indexed, which IS BILLED per page by the OCR service: use it only to repair a bad extraction, and ask the user first. Without it, indexed documents are left alone and failed ones are retried.                          |
| `externalId`        | string        | PREFERRED when available. The MLM ExternalId of the loan (string, up to 108 chars). Use this whenever the loan already exists in MLM — it is the stable identifier humans see in MLM UIs and is what webhooks surface. If both ids are supplied, externalId wins and loanApplicationId is ignored. |
| `loanApplicationId` | string (uuid) | Fallback identifier: the Henge internal loan application ID (GUID). Use this only when no externalId is known — typically because the loan has not yet been pushed to MLM.                                                                                                                         |

## reject\_loan\_document

Reject the document a borrower uploaded to a task or condition, with a reason and a note, the same review the Henge Partner API and the Documents page perform. Identify the loan by its MLM ExternalId (preferred) or its internal Henge GUID, and the task by taskId; take rejectionReasonId from get\_loan\_document\_rejection\_reasons. Rejecting marks the task Rejected and the document Rejected (its losStatus), saves the reason and note on the task, UPLOADS THE REJECTED DOCUMENT TO THE LOAN ORIGINATION SYSTEM in the background, as the Partner API does, queues the loan for a sync and notifies the task's subscribers. The task stays open for the borrower: their next upload lands on the same task. To approve the document instead, use accept\_loan\_document.

**Who can call it:** Admin, Processor, CompanyAdmin, Assistant, ConciergeKey

**Reads or writes:** writes; can delete, cost money or reach someone outside, so a client should ask first

| Input                 | Type          | Description                                                                                                                                                                                                                                                                                        |
| --------------------- | ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `rejectionReasonId`   | string (uuid) | REQUIRED. The id (GUID) of the rejection reason, from get\_loan\_document\_rejection\_reasons. Never guess one.                                                                                                                                                                                    |
| `rejectionReasonNote` | string        | Free-text note saved on the task with the reason, saying what is wrong with the document and what to send instead.                                                                                                                                                                                 |
| `taskId`              | string (uuid) | REQUIRED. The id (GUID) of the task the document was uploaded to: the document's loanApplicationTaskId on get\_loan\_application\_documents, or the task id on get\_loan\_application\_borrower\_tasks / get\_loan\_application\_conditions.                                                       |
| `externalId`          | string        | PREFERRED when available. The MLM ExternalId of the loan (string, up to 108 chars). Use this whenever the loan already exists in MLM — it is the stable identifier humans see in MLM UIs and is what webhooks surface. If both ids are supplied, externalId wins and loanApplicationId is ignored. |
| `loanApplicationId`   | string (uuid) | Fallback identifier: the Henge internal loan application ID (GUID). Use this only when no externalId is known — typically because the loan has not yet been pushed to MLM.                                                                                                                         |

## remove\_loan\_document\_from\_index

Take one document's text out of the document search index, leaving the document itself untouched on the loan. Identify the loan by its MLM ExternalId (preferred) or its internal Henge GUID, and the document by documentId. The document then stops matching searches and reports NotSubmitted; the scheduled reconciler leaves it out, and reindex\_loan\_documents for that document brings it back. Admin and Processor only.

**Who can call it:** Admin, Processor

**Reads or writes:** writes; can delete, cost money or reach someone outside, so a client should ask first

| Input               | Type          | Description                                                                                                                                                                                                                                                                                        |
| ------------------- | ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `documentId`        | string (uuid) | The document whose text to take out of the index. Required. The document itself is not touched.                                                                                                                                                                                                    |
| `note`              | string        | Optional. Why it is being removed, recorded on the index record.                                                                                                                                                                                                                                   |
| `externalId`        | string        | PREFERRED when available. The MLM ExternalId of the loan (string, up to 108 chars). Use this whenever the loan already exists in MLM — it is the stable identifier humans see in MLM UIs and is what webhooks surface. If both ids are supplied, externalId wins and loanApplicationId is ignored. |
| `loanApplicationId` | string (uuid) | Fallback identifier: the Henge internal loan application ID (GUID). Use this only when no externalId is known — typically because the loan has not yet been pushed to MLM.                                                                                                                         |

## replace\_loan\_document\_internal\_notes

REPLACE a loan document's ENTIRE Internal Notes in the LOS, the Loan Origination System of record (the eDoc's internal comments). DESTRUCTIVE: the LOS holds one text field per document, not a list of entries, so the text you send becomes the whole field and every entry you leave out is DELETED, including notes written by underwriters and other processors. Nothing is stamped or appended; the text is written exactly as given. Use this only to correct or remove an entry; to add a note use add\_loan\_document\_internal\_note. Read the document first with get\_loan\_application\_documents and pass its internalNotes as expectedNotes; if the LOS holds anything else (someone changed the notes, or the copy you read was behind) the call is refused with a Conflict, nothing is written, and the Conflict message carries the text the LOS holds now: show that to the user and build any new attempt from it, never resend the same call. The notes CANNOT BE CLEARED: the LOS ignores an empty value, so an empty notes is refused - to remove the only entry, it has to be deleted in the LOS itself. The LOS is read back after the write; if it did not take the new text the call fails and nothing changes in Henge. Show the user the exact new text, and what it removes, and get their explicit approval before calling: an entry removed here cannot be restored from Henge, and the only copy is previousInternalNotes in this tool's response. Identify the loan by its MLM ExternalId (preferred) or internal GUID and the document by documentId. Only a document filed in the LOS (it has an externalId) and not isObsolete qualifies. Returns previousInternalNotes and the internalNotes now held. Restricted to Admin and Processor. An entry is written to the loan's activity log.

**Who can call it:** Admin, Processor

**Reads or writes:** writes; can delete, cost money or reach someone outside, so a client should ask first

| Input               | Type          | Description                                                                                                                                                                                                                                                                                                                       |
| ------------------- | ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `documentId`        | string (uuid) | REQUIRED. The document's Henge id, as returned by get\_loan\_application\_documents. The document must have an externalId there (filed in the LOS) and not be isObsolete.                                                                                                                                                         |
| `expectedNotes`     | string        | REQUIRED. The document's current internalNotes, copied exactly as get\_loan\_application\_documents returned them ("" when they are empty). The replace goes ahead only if the LOS still holds this text; otherwise the call is refused with a Conflict whose message carries the text the LOS holds now, and nothing is written. |
| `notes`             | string        | REQUIRED, and not empty. The COMPLETE new Internal Notes, written exactly as given: no author stamp and no separator are added, and every entry you leave out is deleted. To remove one entry, send the current text without that entry. A document's notes cannot be cleared: the LOS ignores an empty value, so "" is refused.  |
| `externalId`        | string        | PREFERRED when available. The MLM ExternalId of the loan (string, up to 108 chars). Use this whenever the loan already exists in MLM — it is the stable identifier humans see in MLM UIs and is what webhooks surface. If both ids are supplied, externalId wins and loanApplicationId is ignored.                                |
| `loanApplicationId` | string (uuid) | Fallback identifier: the Henge internal loan application ID (GUID). Use this only when no externalId is known — typically because the loan has not yet been pushed to MLM.                                                                                                                                                        |

## search\_loan\_documents

Search INSIDE a loan's documents — the OCR'd text of every paystub, W-2, bank statement, tax return, credit report and condition document on the file — and return matching passages. Identify the loan by its MLM ExternalId (preferred) or its internal Henge GUID; results are always limited to that loan. Each hit carries a plain-text snippet, the raw passage (content), the page range it came from, and the document's current title, folder, type and task, so you can cite it ("W-2 2025, page 1"). Use groupByDocument=true to ask which documents mention something. Use get\_loan\_document\_text to read a whole document or page range rather than only matching passages. ALWAYS read coverage and notes before concluding anything from few or no hits: a document still pending, failed (password-protected or unreadable) or not yet submitted cannot match, so an empty result does not mean the file does not say it. Documents only, not the 1003 data — use get\_loan\_application or get\_loan\_file\_summary for that. A borrower (Client) caller can search only loans on which they are a borrower, and only the documents their portal lists: vault documents and documents on borrower-assigned tasks, never internal documents or user-task documents.

**Who can call it:** Admin, Agent, Processor, CompanyAdmin, ConciergeKey, DualLicensedAgent, Client

**Reads or writes:** reads only

| Input                 | Type          | Description                                                                                                                                                                                                                                                                                        |
| --------------------- | ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `query`               | string        | What to look for inside the loan's documents, in plain words: "year-to-date gross pay", "ending balance on the checking account", "gift letter donor". Retrieval is hybrid keyword plus semantic. Required.                                                                                        |
| `documentId`          | string (uuid) | Optional. Narrow to one document, by the id from get\_loan\_application\_documents or from a previous hit's document.loanApplicationDocumentId.                                                                                                                                                    |
| `groupByDocument`     | boolean       | Optional. true returns one entry per document (its title, folder and task, an approximate match count and its best passages) instead of a flat list of passages. Use it to answer "which documents mention X".                                                                                     |
| `passagesPerDocument` | integer       | Optional. Passages per document when grouping. Defaults to 3, at most 10.                                                                                                                                                                                                                          |
| `top`                 | integer       | Optional. Passages to return, or documents when grouping. Defaults to 10, at most 50.                                                                                                                                                                                                              |
| `externalId`          | string        | PREFERRED when available. The MLM ExternalId of the loan (string, up to 108 chars). Use this whenever the loan already exists in MLM — it is the stable identifier humans see in MLM UIs and is what webhooks surface. If both ids are supplied, externalId wins and loanApplicationId is ignored. |
| `loanApplicationId`   | string (uuid) | Fallback identifier: the Henge internal loan application ID (GUID). Use this only when no externalId is known — typically because the loan has not yet been pushed to MLM.                                                                                                                         |

## send\_loan\_esign\_package

Send a draft e-sign package to its signers through PandaDoc. THIS SPENDS A CREDIT in the company's PandaDoc workspace and emails every signer at once; it cannot be undone from here. ASK THE USER FOR AN EXPLICIT GO-AHEAD before calling it, naming the package and its signers. The package must be a Draft whose signature fields the user has already placed in PandaDoc (via editorUrl): a package that is not a draft, or in which any signer has no signature field in PandaDoc, is refused. On success the package moves to Sent; its status then follows PandaDoc, and the signed PDF is filed to the loan's vault when everyone has signed (check get\_loan\_esign\_packages). Identify the loan by its MLM ExternalId (preferred) or its internal Henge GUID.

**Who can call it:** Admin, Processor, Agent, DualLicensedAgent, ConciergeKey

**Reads or writes:** writes; can delete, cost money or reach someone outside, so a client should ask first

| Input               | Type          | Description                                                                                                                                                                                                                                                                                        |
| ------------------- | ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `packageId`         | string (uuid) | The e-sign package to send (GUID), from create\_loan\_esign\_draft or get\_loan\_esign\_packages.                                                                                                                                                                                                  |
| `subject`           | string        | Optional. The email subject the signers see. Defaults to the package name.                                                                                                                                                                                                                         |
| `message`           | string        | Optional. A message the signers see in the email.                                                                                                                                                                                                                                                  |
| `externalId`        | string        | PREFERRED when available. The MLM ExternalId of the loan (string, up to 108 chars). Use this whenever the loan already exists in MLM — it is the stable identifier humans see in MLM UIs and is what webhooks surface. If both ids are supplied, externalId wins and loanApplicationId is ignored. |
| `loanApplicationId` | string (uuid) | Fallback identifier: the Henge internal loan application ID (GUID). Use this only when no externalId is known — typically because the loan has not yet been pushed to MLM.                                                                                                                         |

## set\_loan\_document\_status

Set a loan document's status. A document has ONE status, shared with the LOS (the Loan Origination System of record) and shown as losStatus in get\_loan\_application\_documents: Active (none yet; the app shows it as Pending), Screened (reviewed and accepted; the app shows Accepted), Rejected, Protected (locked in the LOS against edits and deletion) or Obsolete (retired; the app shows Deleted). A Rejected document stays listed with isObsolete true and should not be treated as current; Obsolete SOFT-DELETES the document, which then leaves every list (the same as the app's Deleted), and it can no longer be set back to Active here; Active undoes any other status. THIS WRITES TO THE LOS: for a document already filed there (it has an externalId) the LOS is updated first, and if it refuses, nothing changes. A document not filed yet keeps the status in Henge and takes it along when it is filed; an Obsolete or Rejected one is never filed. SCREENED OR REJECTED ON A DOCUMENT WHOSE TASK IS WAITING FOR REVIEW IS THAT REVIEW: Screened accepts the task exactly as accept\_loan\_document does (the task becomes Accepted and the document is uploaded to the LOS), and Rejected rejects it exactly as reject\_loan\_document does (the task is sent back and its subscribers are told), which REQUIRES rejectionReasonId from get\_loan\_document\_rejection\_reasons and takes an optional rejectionReasonNote. On any other document the reason fields are ignored. Works on any document on the loan - uploaded straight to the loan or attached to a task, condition or asset account. Safe to repeat: setting a status the document already has changes nothing. Identify the loan by its MLM ExternalId (preferred) or internal GUID and the document by documentId from get\_loan\_application\_documents. Returns the document in the same shape as get\_loan\_application\_documents. Protected, and any change to a document that is Protected, are restricted to Admin and Processor; the other statuses are open to Admin, Processor, CompanyAdmin, Assistant and ConciergeKey. An entry is written to the loan's activity log.

**Who can call it:** Admin, Processor, CompanyAdmin, Assistant, ConciergeKey

**Reads or writes:** writes; can delete, cost money or reach someone outside, so a client should ask first

| Input                 | Type          | Description                                                                                                                                                                                                                                                                                                                  |
| --------------------- | ------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `documentId`          | string (uuid) | REQUIRED. The document's Henge id, as returned by get\_loan\_application\_documents.                                                                                                                                                                                                                                         |
| `status`              | string        | REQUIRED. Active (no status; undoes any other), Screened (reviewed and accepted), Rejected, Protected (locks the document in the LOS against edits and deletion; Admin and Processor only) or Obsolete (retires it; it stays listed with isObsolete true). One of `Active`, `Protected`, `Obsolete`, `Rejected`, `Screened`. |
| `rejectionReasonId`   | string (uuid) | Required only when status is Rejected and the document's task is waiting for review: the reason's id from get\_loan\_document\_rejection\_reasons. Ignored otherwise.                                                                                                                                                        |
| `rejectionReasonNote` | string        | Optional note to go with rejectionReasonId, shown with the rejected task.                                                                                                                                                                                                                                                    |
| `externalId`          | string        | PREFERRED when available. The MLM ExternalId of the loan (string, up to 108 chars). Use this whenever the loan already exists in MLM — it is the stable identifier humans see in MLM UIs and is what webhooks surface. If both ids are supplied, externalId wins and loanApplicationId is ignored.                           |
| `loanApplicationId`   | string (uuid) | Fallback identifier: the Henge internal loan application ID (GUID). Use this only when no externalId is known — typically because the loan has not yet been pushed to MLM.                                                                                                                                                   |

## set\_loan\_trailing\_document

Update one row of a loan's MLM Trailing Documents tab. THIS WRITES TO THE LOAN ORIGINATION SYSTEM: the values appear on the loan's Trailing Documents tab immediately, so only send what the user actually asked to record. Name the row with code and pass back its id from get\_loan\_trailing\_documents (omit the id only while it is all zeros, which creates the stored record), then pass only the fields to change: required, orderedDate, documentDate, receivedDate, shippedDate, method, tracking, reviewedDate, comment, and, for CustomTrailingDocument1..4 only, name. A field you omit is left exactly as it is in MLM; a field you send as null is cleared. Dates are ISO (YYYY-MM-DD); method is one of USPS, UPS, FedEx or Electronic; tracking is free text up to 50 characters. Returns the row as MLM holds it after the write. Rejected when the loan has not been pushed to MLM yet, when code is not a known row, when name is sent for a fixed row, when method is not one of the four values, when text exceeds its length, or when no field is supplied.

**Who can call it:** Admin, Processor, CompanyAdmin, ConciergeKey

**Reads or writes:** writes; can delete, cost money or reach someone outside, so a client should ask first

| Input               | Type          | Description                                                                                                                                                                                                                                                                                                                                                                                                 |
| ------------------- | ------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `id`                | string (uuid) | The row's stored id as returned by get\_loan\_trailing\_documents. Pass it back when the row already has a non-zero id so the same record is updated; omit it (or pass all zeros) for a row whose id is still all zeros, which creates the record. Always call get\_loan\_trailing\_documents first.                                                                                                        |
| `code`              | string        | REQUIRED. Which row of the Trailing Documents tab to update. One of: LoanPackage, MortgageDeedOfTrust, Note, FinalHud1SettlementStatement, TitleInsurancePolicy, MortgageInsuranceCertificate, FinalHazardInsurancePolicy, FinalFloodInsurancePolicy, or one of the four user-named rows CustomTrailingDocument1..4 (case-insensitive). Use get\_loan\_trailing\_documents to see the current values first. |
| `name`              | any           | The row's label, up to 50 characters. Accepted ONLY for CustomTrailingDocument1..4 (the rows whose name the user types in MLM); rejected for the eight fixed rows. null clears it; omit to leave unchanged.                                                                                                                                                                                                 |
| `required`          | any           | The row's Required checkbox. true or false to set it; null clears it (MLM stores unchecked). Omit to leave unchanged.                                                                                                                                                                                                                                                                                       |
| `documentDate`      | any           | Document Date column, as an ISO date (YYYY-MM-DD). null clears the cell; omit to leave unchanged.                                                                                                                                                                                                                                                                                                           |
| `orderedDate`       | any           | Ordered column, as an ISO date (YYYY-MM-DD). null clears the cell; omit to leave unchanged. This is the same MLM field the Orders Out screen shows for the row.                                                                                                                                                                                                                                             |
| `receivedDate`      | any           | Received column, as an ISO date (YYYY-MM-DD). null clears the cell; omit to leave unchanged. This is the same MLM field the Orders Out screen shows for the row.                                                                                                                                                                                                                                            |
| `shippedDate`       | any           | Shipped column, as an ISO date (YYYY-MM-DD). null clears the cell; omit to leave unchanged.                                                                                                                                                                                                                                                                                                                 |
| `method`            | any           | How the document was shipped. One of USPS, UPS, FedEx or Electronic (case-insensitive; stored with the dropdown's own spelling). Any other value is rejected. null clears the cell; omit to leave unchanged.                                                                                                                                                                                                |
| `tracking`          | any           | Tracking number, free text up to 50 characters. null clears the cell; omit to leave unchanged.                                                                                                                                                                                                                                                                                                              |
| `comment`           | any           | The row's Comments line, free text up to 250 characters. null clears it; omit to leave unchanged.                                                                                                                                                                                                                                                                                                           |
| `reviewedDate`      | any           | Reviewed column, as an ISO date (YYYY-MM-DD). null clears the cell; omit to leave unchanged.                                                                                                                                                                                                                                                                                                                |
| `externalId`        | string        | PREFERRED when available. The MLM ExternalId of the loan (string, up to 108 chars). Use this whenever the loan already exists in MLM — it is the stable identifier humans see in MLM UIs and is what webhooks surface. If both ids are supplied, externalId wins and loanApplicationId is ignored.                                                                                                          |
| `loanApplicationId` | string (uuid) | Fallback identifier: the Henge internal loan application ID (GUID). Use this only when no externalId is known — typically because the loan has not yet been pushed to MLM.                                                                                                                                                                                                                                  |

## update\_loan\_document

Update any document on a loan, whether it was uploaded straight to the loan or is attached to a task, a condition or an asset account: rename it (title), hide it from or show it to borrowers (isInternal), or set its document type. Send only the fields to change; an omitted field is left as it is, and at least one is required. The file name and the description are set at upload and cannot be changed here. The internal flag stays in Henge. title and loanDocumentTypeId REACH THE LOAN ORIGINATION SYSTEM: the title is what the LOS shows as the document's description, so a title change updates the copy filed there; a type set on a document already filed there retypes it in place, with no second upload. A document NOT YET FILED (no externalId) that is given a type here is UPLOADED to the LOS under that type, exactly as an upload with that type would have filed it, and comes back with its externalId, after which add\_loan\_document\_internal\_note and set\_loan\_document\_status accept it; so to file an untyped document, give it a type. Exceptions where the type is saved in Henge only and the document gets no externalId yet: the loan is not in the LOS yet (it is filed when the loan is submitted), the document's PDF conversion has not finished (it is filed when it does), or it is attached to a condition and not yet reviewed (it is filed on review). The LOS is updated in this call, before the change is saved; if the LOS refuses it, nothing is saved, not even the type, and the error says why. Get the documentId from get\_loan\_application\_documents and a loanDocumentTypeId from get\_loan\_document\_types. Returns the updated document in the same shape as get\_loan\_application\_documents.

**Who can call it:** Admin, Agent, Processor, CompanyAdmin, Assistant, ConciergeKey

**Reads or writes:** writes; can delete, cost money or reach someone outside, so a client should ask first

| Input                | Type          | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| -------------------- | ------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `documentId`         | string (uuid) | REQUIRED. The Henge id (GUID) of the document to update. Obtain it from get\_loan\_application\_documents on the same loan.                                                                                                                                                                                                                                                                                                                                                                                |
| `title`              | any           | New title: the heading the Documents page shows, e.g. 'Chase XX4768 July', and what the Loan Origination System shows as the document's description, so a change reaches the LOS. Up to 1024 characters. null resets it to the default, the task name and the file name without its extension (the file name alone for a document with no task); omit to leave unchanged.                                                                                                                                  |
| `isInternal`         | any           | true hides the document from borrowers, false shows it to them. null is rejected; omit to leave unchanged.                                                                                                                                                                                                                                                                                                                                                                                                 |
| `loanDocumentTypeId` | any           | The id (GUID) of the document type to file the document under, from get\_loan\_document\_types; do not guess or pass a type name. With title, one of the two fields that REACH THE LOAN ORIGINATION SYSTEM: a document already filed there is retyped in place; one not yet filed is uploaded to the LOS under this type (on a loan already in the LOS) and gets its externalId. null is rejected, a type is never cleared (use the type inside the UNCLASSIFIED folder instead); omit to leave unchanged. |
| `pairIndex`          | integer       | On a loan with several borrower pairs: the pair the document belongs to, 0 for the primary pair. A borrower reads the documents of their own pair and those that apply to every pair. Must be a live pair of the loan, else the call is refused. Henge only: nothing reaches the LOS. Send either pairIndex or appliesToAllPairs true, not both; omit both to leave the owner as it is.                                                                                                                    |
| `appliesToAllPairs`  | boolean       | true makes the document a whole-loan one that every pair sees. false on its own clears the owner, so it is worked out again from the condition it sits on, the borrower task's assignee, the borrower who uploaded it, then its document type. Henge only. Omit to leave the owner as it is.                                                                                                                                                                                                               |
| `externalId`         | string        | PREFERRED when available. The MLM ExternalId of the loan (string, up to 108 chars). Use this whenever the loan already exists in MLM — it is the stable identifier humans see in MLM UIs and is what webhooks surface. If both ids are supplied, externalId wins and loanApplicationId is ignored.                                                                                                                                                                                                         |
| `loanApplicationId`  | string (uuid) | Fallback identifier: the Henge internal loan application ID (GUID). Use this only when no externalId is known — typically because the loan has not yet been pushed to MLM.                                                                                                                                                                                                                                                                                                                                 |

## upload\_loan\_document

Upload a file to a loan application, passing the file INLINE as base64 in contentBase64, at most 5 MB once decoded. For a larger file use get\_api\_access\_token and the Private API's multipart upload instead. Identify the loan by its MLM ExternalId (preferred) or its internal Henge GUID. With conditionId (from get\_loan\_conditions), the file is attached to that condition: the condition's open request (Requested or Rejected) takes the file, and a request is created only when it has none, from the kind of document description says it is (it defaults to the file name), and the rest is as for taskId below. With taskId, the file is attached to that borrower task or condition task, the same as the Henge Partner API's task upload: the task becomes Uploaded and awaits review with accept\_loan\_document or reject\_loan\_document, the file is converted to PDF in the background, and it reaches the Loan Origination System only when accepted; uploading to a task that is no longer Requested or Rejected opens a new copy of the task for the file. Without taskId, the file is uploaded straight to the loan (the vault), the same as the Partner API's vault create, which needs the Admin, Processor, CompanyAdmin or ConciergeKey role; title, description, isInternal and loanDocumentTypeId apply only to a vault upload, and a vault document reaches the Loan Origination System only when loanDocumentTypeId is set. Returns the new document's id.

**Who can call it:** Admin, Agent, Processor, CompanyAdmin, Assistant, ConciergeKey

**Reads or writes:** writes

| Input                | Type          | Description                                                                                                                                                                                                                                                                                                                                                                                           |
| -------------------- | ------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `taskId`             | string (uuid) | The id (GUID) of the borrower task or condition task to upload the document to, from get\_loan\_conditions. Still works; prefer conditionId. Omit both to upload straight to the loan (the vault). Cannot be combined with conditionId.                                                                                                                                                               |
| `conditionId`        | string (uuid) | The id (GUID) of the condition to upload the document to, from get\_loan\_conditions or create\_loan\_condition; it is the same before and after the loan is submitted. The request under the condition that takes the file is found or created for you, from the kind of document description says it is, and the document then awaits review as a task upload does. Cannot be combined with taskId. |
| `fileName`           | string        | REQUIRED. The file name including its extension, e.g. 'paystub-july.pdf'. The extension decides how the file is converted to PDF.                                                                                                                                                                                                                                                                     |
| `contentBase64`      | string        | REQUIRED. The file's bytes, base64-encoded (standard alphabet, no data: URL prefix). At most 5 MB once decoded.                                                                                                                                                                                                                                                                                       |
| `title`              | string        | Vault upload only. The document's title, which the LOS shows as its description.                                                                                                                                                                                                                                                                                                                      |
| `description`        | string        | Vault upload: a description kept with the document in Henge. With conditionId: which document this is (for example "2024 W-2", up to 256 characters), which picks the kind of request it lands on; defaults to the file name.                                                                                                                                                                         |
| `isInternal`         | boolean       | Vault upload only. true hides the document from the borrower. Defaults to false.                                                                                                                                                                                                                                                                                                                      |
| `loanDocumentTypeId` | string (uuid) | Vault upload only. The document type id (GUID) from get\_loan\_document\_types. Setting it is what sends the document to the Loan Origination System; omit it to keep the document in Henge only.                                                                                                                                                                                                     |
| `externalId`         | string        | PREFERRED when available. The MLM ExternalId of the loan (string, up to 108 chars). Use this whenever the loan already exists in MLM — it is the stable identifier humans see in MLM UIs and is what webhooks surface. If both ids are supplied, externalId wins and loanApplicationId is ignored.                                                                                                    |
| `loanApplicationId`  | string (uuid) | Fallback identifier: the Henge internal loan application ID (GUID). Use this only when no externalId is known — typically because the loan has not yet been pushed to MLM.                                                                                                                                                                                                                            |

## upload\_unsorted\_loan\_documents

Send many files to a loan application at once, without choosing a task for each, and let Henge sort them. Each file is passed INLINE as base64 in contentBase64, at most 5 MB once decoded; at most 10 files and 20 MB in all per call (for more, call again). Identify the loan by its MLM ExternalId (preferred) or its internal Henge GUID. Each file becomes a loan document marked unsorted: it has no task and no type, it goes through the document analysis like any other upload, and it is NOT sent to the Loan Origination System until it is put on a task (move\_loan\_document) or given a type (update\_loan\_document). Each file is judged on its own: an unsupported, empty or too large file is Rejected with its reason and the rest still land. A password-protected PDF is stored but held as NeedsPassword until its password is entered in the app; an exact repeat of a document already on the loan is kept and marked as a duplicate. Needs the same role as upload\_loan\_document without taskId (Admin, Processor, CompanyAdmin or ConciergeKey). Returns one result per file, in the order sent.

**Who can call it:** Admin, Processor, CompanyAdmin, ConciergeKey

**Reads or writes:** writes

**Availability:** only where the `tpo-document-intake` release flag is on for the caller.

| Input                   | Type            | Description                                                                                                                                                                                                                                                                                        |
| ----------------------- | --------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `files`                 | array of object | REQUIRED. The files to send to the loan, at most 10 per call and 20 MB in all once decoded. Each is judged on its own: one that fails is rejected with its reason and the rest still land.                                                                                                         |
| `files[].fileName`      | string          | REQUIRED. The file name including its extension, e.g. 'paystub-july.pdf'. The extension decides how the file is converted to PDF.                                                                                                                                                                  |
| `files[].contentBase64` | string          | REQUIRED. The file's bytes, base64-encoded (standard alphabet, no data: URL prefix). At most 5 MB once decoded.                                                                                                                                                                                    |
| `externalId`            | string          | PREFERRED when available. The MLM ExternalId of the loan (string, up to 108 chars). Use this whenever the loan already exists in MLM — it is the stable identifier humans see in MLM UIs and is what webhooks surface. If both ids are supplied, externalId wins and loanApplicationId is ignored. |
| `loanApplicationId`     | string (uuid)   | Fallback identifier: the Henge internal loan application ID (GUID). Use this only when no externalId is known — typically because the loan has not yet been pushed to MLM.                                                                                                                         |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://api-docs.hengelending.com/mcp/tool-reference/documents.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
