> 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/api/api-reference/documents.md). Agents can also search and read this documentation through its [MCP server](https://api-docs.hengelending.com/~gitbook/mcp).

# Documents

A loan's documents: the vault, a document's text and search over the documents' text, unsorted uploads, the condition a document is filed under and its status in the LOS.

**E-sign packages:** E-sign packages on a loan: create a draft from the loan's documents, send it to the signers, and follow each package's status and each signer's progress. Sending goes out through the e-sign provider, so it has its own scope, granted on request.

`GET /types/loan-document-types` lists the document types the other routes accept.

**Scopes:** `create:loan-applications`, `delete:loan-applications`, `read:loan-applications`, `read:types`, `send:esign-packages`, `update:loan-applications`

## Lists a loan application's e-sign packages.

> \*\*Required scope:\*\* \`read:loan-applications\`

```json
{"openapi":"3.0.4","info":{"title":"Henge Partner API","version":"1.22.0"},"tags":[{"name":"Documents","description":"A loan's documents: the vault, a document's text and search over the documents' text, unsorted uploads, the condition a document is filed under and its status in the LOS.\n\n**E-sign packages:** E-sign packages on a loan: create a draft from the loan's documents, send it to the signers, and follow each package's status and each signer's progress. Sending goes out through the e-sign provider, so it has its own scope, granted on request.\n\n`GET /types/loan-document-types` lists the document types the other routes accept.\n\n**Scopes:** `create:loan-applications`, `delete:loan-applications`, `read:loan-applications`, `read:types`, `send:esign-packages`, `update:loan-applications`"}],"servers":[{"url":"https://uat-api.hengelending.com/partner","description":"UAT (sandbox): build and test here"},{"url":"https://api.hengelending.com/partner","description":"Production"}],"security":[{"Bearer":[]}],"components":{"securitySchemes":{"Bearer":{"type":"http","description":"Access token from POST /oauth/token, sent as `Authorization: Bearer <token>`.","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"ESignPackage":{"required":["createdAt","createdBy","id","loanApplicationId","status"],"type":"object","properties":{"id":{"type":"string","description":"Id (GUID) of the package.","format":"uuid"},"loanApplicationId":{"type":"string","description":"Id (GUID) of the loan the package belongs to.","format":"uuid"},"name":{"type":"string","description":"The package's name; defaults to the loan number.","nullable":true},"status":{"$ref":"#/components/schemas/ESignPackageStatus"},"pandaDocDocumentId":{"type":"string","description":"The e-sign provider's own id for the package's document.","nullable":true},"editorUrl":{"type":"string","description":"A link to the e-sign provider's editor, where the sender places signature fields. Returned for a draft.","nullable":true},"documents":{"type":"array","items":{"$ref":"#/components/schemas/ESignPackageDocument"},"description":"The documents in the package.","nullable":true},"signers":{"type":"array","items":{"$ref":"#/components/schemas/ESignPackageSigner"},"description":"The people who must sign, with each one's status.","nullable":true},"events":{"type":"array","items":{"$ref":"#/components/schemas/ESignPackageEvent"},"description":"The status events applied to the package so far, oldest first.","nullable":true},"createdAt":{"type":"string","description":"When the package was created, in UTC (ISO 8601).","format":"date-time"},"createdBy":{"type":"string","description":"Id of the user the package was created for.","format":"uuid"},"sentAt":{"type":"string","description":"When the package was sent to the signers, in UTC (ISO 8601); null while it is a draft.","format":"date-time","nullable":true},"completedAt":{"type":"string","description":"When the last signer signed, in UTC (ISO 8601); null until the package completes.","format":"date-time","nullable":true},"signedDocumentId":{"type":"string","description":"The vault document the signed PDF was filed as, once the package completes.","format":"uuid","nullable":true}},"additionalProperties":false,"description":"A package of documents sent for e-signature on a loan: who must sign, where signing stands and what happened. It holds no credentials."},"ESignPackageStatus":{"enum":["Draft","Sent","Viewed","Completed","Declined","Voided"],"type":"string","description":"Where an e-sign package stands: Draft (created and being prepared; nothing has gone to a signer), Sent (sent to the signers), Viewed (a signer has opened it), Completed (every signer has signed), Declined (a signer declined) or Voided (withdrawn by the sender)."},"ESignPackageDocument":{"type":"object","properties":{"vaultDocumentId":{"type":"string","description":"Id of the loan document included in the package; null for a PDF uploaded with the request.","format":"uuid","nullable":true},"fileName":{"type":"string","description":"The document's file name.","nullable":true}},"additionalProperties":false,"description":"One document in a package: a vault document the sender picked or a PDF they uploaded."},"ESignPackageSigner":{"type":"object","properties":{"role":{"$ref":"#/components/schemas/ESignSignerRole"},"borrowerId":{"type":"string","description":"Id of the borrower or co-borrower on the loan, when the signer is one.","format":"uuid","nullable":true},"contactId":{"type":"string","description":"Id of the loan contact, when the signer is a contact.","format":"uuid","nullable":true},"name":{"type":"string","description":"The signer's name.","nullable":true},"email":{"type":"string","description":"The email address the signing request is sent to.","nullable":true},"status":{"$ref":"#/components/schemas/ESignSignerStatus"},"signedAt":{"type":"string","description":"When the signer signed, in UTC (ISO 8601); null until they do.","format":"date-time","nullable":true}},"additionalProperties":false},"ESignSignerRole":{"enum":["Borrower","CoBorrower","Contact"],"type":"string","description":"A signer's relationship to the loan: Borrower, CoBorrower, or Contact (a person from the loan's contact list)."},"ESignSignerStatus":{"enum":["Pending","Signed"],"type":"string","description":"Whether a signer has signed: Pending or Signed."},"ESignPackageEvent":{"type":"object","properties":{"id":{"type":"string","description":"The provider's id for the event; a repeat of the same id is ignored.","nullable":true},"type":{"type":"string","description":"The provider's status or event name, for example document.sent or recipient_completed.","nullable":true},"occurredAt":{"type":"string","description":"When the event happened, in UTC (ISO 8601).","format":"date-time"},"signerEmail":{"type":"string","description":"The email of the signer the event is about; null for an event about the whole package.","nullable":true}},"additionalProperties":false,"description":"One status event received from the e-sign provider and applied to the package. The id makes a redelivery a no-op."},"ProblemDetails":{"required":["status","title","detail","instance","code","traceId"],"type":"object","properties":{"type":{"type":"string","description":"A URI that identifies the kind of problem, or null when none is given.","nullable":true},"title":{"type":"string","description":"A short, human-readable summary of the problem; it does not change between occurrences of the same problem."},"status":{"type":"integer","description":"The HTTP status code of the response.","format":"int32"},"detail":{"type":"string","description":"A human-readable explanation of this occurrence of the problem."},"instance":{"type":"string","description":"A URI that identifies this occurrence of the problem, typically the request path."},"code":{"type":"string","description":"A stable error code, such as `NotFound`, `ValidationFailed`, `Conflict` or `BusinessRuleViolation`. Present on every error; the Errors guide lists every value."},"traceId":{"type":"string","description":"The request's trace id. Quote it when you contact support about a failed call."},"requiredScope":{"type":"string","description":"The scope the token lacks, by its standard name. Present when `code` is `MissingScope` (403); ask your Henge contact to grant it to your credential."}},"additionalProperties":{},"description":"An error, in the RFC 9457 problem details shape. Branch on `code`, never on `title` or `detail`, which are for people and may change."}}},"paths":{"/loan-applications/{id}/esign-packages":{"get":{"tags":["Documents"],"summary":"Lists a loan application's e-sign packages.","description":"**Required scope:** `read:loan-applications`","operationId":"LoanApplicationESignPackages_GetPackages","parameters":[{"name":"id","in":"path","description":"The loan application's id (a GUID). Send the empty GUID `00000000-0000-0000-0000-000000000000` when you address the loan by `externalId` instead. A loan in another company answers 404, the same as one that does not exist.","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"externalId","in":"query","description":"The loan's id in the loan origination system (`loanInfo.loanId` on a loan read; not the loan number), to address the loan by instead of the path `id`: put the empty GUID in the path; when sent it is matched exactly and wins over the path `id`, and a value that matches no loan in your company answers 404.","schema":{"type":"string"}}],"responses":{"200":{"description":"Packages retrieved successfully","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ESignPackage"}}}}},"401":{"description":"Missing, invalid or expired access token.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The client application is not authorized to access this resource","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Loan application not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}}}}
```

## Gets an e-sign package's status.

> \*\*Required scope:\*\* \`read:loan-applications\`

```json
{"openapi":"3.0.4","info":{"title":"Henge Partner API","version":"1.22.0"},"tags":[{"name":"Documents","description":"A loan's documents: the vault, a document's text and search over the documents' text, unsorted uploads, the condition a document is filed under and its status in the LOS.\n\n**E-sign packages:** E-sign packages on a loan: create a draft from the loan's documents, send it to the signers, and follow each package's status and each signer's progress. Sending goes out through the e-sign provider, so it has its own scope, granted on request.\n\n`GET /types/loan-document-types` lists the document types the other routes accept.\n\n**Scopes:** `create:loan-applications`, `delete:loan-applications`, `read:loan-applications`, `read:types`, `send:esign-packages`, `update:loan-applications`"}],"servers":[{"url":"https://uat-api.hengelending.com/partner","description":"UAT (sandbox): build and test here"},{"url":"https://api.hengelending.com/partner","description":"Production"}],"security":[{"Bearer":[]}],"components":{"securitySchemes":{"Bearer":{"type":"http","description":"Access token from POST /oauth/token, sent as `Authorization: Bearer <token>`.","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"ESignPackage":{"required":["createdAt","createdBy","id","loanApplicationId","status"],"type":"object","properties":{"id":{"type":"string","description":"Id (GUID) of the package.","format":"uuid"},"loanApplicationId":{"type":"string","description":"Id (GUID) of the loan the package belongs to.","format":"uuid"},"name":{"type":"string","description":"The package's name; defaults to the loan number.","nullable":true},"status":{"$ref":"#/components/schemas/ESignPackageStatus"},"pandaDocDocumentId":{"type":"string","description":"The e-sign provider's own id for the package's document.","nullable":true},"editorUrl":{"type":"string","description":"A link to the e-sign provider's editor, where the sender places signature fields. Returned for a draft.","nullable":true},"documents":{"type":"array","items":{"$ref":"#/components/schemas/ESignPackageDocument"},"description":"The documents in the package.","nullable":true},"signers":{"type":"array","items":{"$ref":"#/components/schemas/ESignPackageSigner"},"description":"The people who must sign, with each one's status.","nullable":true},"events":{"type":"array","items":{"$ref":"#/components/schemas/ESignPackageEvent"},"description":"The status events applied to the package so far, oldest first.","nullable":true},"createdAt":{"type":"string","description":"When the package was created, in UTC (ISO 8601).","format":"date-time"},"createdBy":{"type":"string","description":"Id of the user the package was created for.","format":"uuid"},"sentAt":{"type":"string","description":"When the package was sent to the signers, in UTC (ISO 8601); null while it is a draft.","format":"date-time","nullable":true},"completedAt":{"type":"string","description":"When the last signer signed, in UTC (ISO 8601); null until the package completes.","format":"date-time","nullable":true},"signedDocumentId":{"type":"string","description":"The vault document the signed PDF was filed as, once the package completes.","format":"uuid","nullable":true}},"additionalProperties":false,"description":"A package of documents sent for e-signature on a loan: who must sign, where signing stands and what happened. It holds no credentials."},"ESignPackageStatus":{"enum":["Draft","Sent","Viewed","Completed","Declined","Voided"],"type":"string","description":"Where an e-sign package stands: Draft (created and being prepared; nothing has gone to a signer), Sent (sent to the signers), Viewed (a signer has opened it), Completed (every signer has signed), Declined (a signer declined) or Voided (withdrawn by the sender)."},"ESignPackageDocument":{"type":"object","properties":{"vaultDocumentId":{"type":"string","description":"Id of the loan document included in the package; null for a PDF uploaded with the request.","format":"uuid","nullable":true},"fileName":{"type":"string","description":"The document's file name.","nullable":true}},"additionalProperties":false,"description":"One document in a package: a vault document the sender picked or a PDF they uploaded."},"ESignPackageSigner":{"type":"object","properties":{"role":{"$ref":"#/components/schemas/ESignSignerRole"},"borrowerId":{"type":"string","description":"Id of the borrower or co-borrower on the loan, when the signer is one.","format":"uuid","nullable":true},"contactId":{"type":"string","description":"Id of the loan contact, when the signer is a contact.","format":"uuid","nullable":true},"name":{"type":"string","description":"The signer's name.","nullable":true},"email":{"type":"string","description":"The email address the signing request is sent to.","nullable":true},"status":{"$ref":"#/components/schemas/ESignSignerStatus"},"signedAt":{"type":"string","description":"When the signer signed, in UTC (ISO 8601); null until they do.","format":"date-time","nullable":true}},"additionalProperties":false},"ESignSignerRole":{"enum":["Borrower","CoBorrower","Contact"],"type":"string","description":"A signer's relationship to the loan: Borrower, CoBorrower, or Contact (a person from the loan's contact list)."},"ESignSignerStatus":{"enum":["Pending","Signed"],"type":"string","description":"Whether a signer has signed: Pending or Signed."},"ESignPackageEvent":{"type":"object","properties":{"id":{"type":"string","description":"The provider's id for the event; a repeat of the same id is ignored.","nullable":true},"type":{"type":"string","description":"The provider's status or event name, for example document.sent or recipient_completed.","nullable":true},"occurredAt":{"type":"string","description":"When the event happened, in UTC (ISO 8601).","format":"date-time"},"signerEmail":{"type":"string","description":"The email of the signer the event is about; null for an event about the whole package.","nullable":true}},"additionalProperties":false,"description":"One status event received from the e-sign provider and applied to the package. The id makes a redelivery a no-op."},"ProblemDetails":{"required":["status","title","detail","instance","code","traceId"],"type":"object","properties":{"type":{"type":"string","description":"A URI that identifies the kind of problem, or null when none is given.","nullable":true},"title":{"type":"string","description":"A short, human-readable summary of the problem; it does not change between occurrences of the same problem."},"status":{"type":"integer","description":"The HTTP status code of the response.","format":"int32"},"detail":{"type":"string","description":"A human-readable explanation of this occurrence of the problem."},"instance":{"type":"string","description":"A URI that identifies this occurrence of the problem, typically the request path."},"code":{"type":"string","description":"A stable error code, such as `NotFound`, `ValidationFailed`, `Conflict` or `BusinessRuleViolation`. Present on every error; the Errors guide lists every value."},"traceId":{"type":"string","description":"The request's trace id. Quote it when you contact support about a failed call."},"requiredScope":{"type":"string","description":"The scope the token lacks, by its standard name. Present when `code` is `MissingScope` (403); ask your Henge contact to grant it to your credential."}},"additionalProperties":{},"description":"An error, in the RFC 9457 problem details shape. Branch on `code`, never on `title` or `detail`, which are for people and may change."}}},"paths":{"/loan-applications/{id}/esign-packages/{packageId}":{"get":{"tags":["Documents"],"summary":"Gets an e-sign package's status.","description":"**Required scope:** `read:loan-applications`","operationId":"LoanApplicationESignPackages_GetPackage","parameters":[{"name":"id","in":"path","description":"The loan application's id (a GUID). Send the empty GUID `00000000-0000-0000-0000-000000000000` when you address the loan by `externalId` instead. A loan in another company answers 404, the same as one that does not exist.","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"packageId","in":"path","description":"The e-sign package's `id`, as `GET /loan-applications/{id}/esign-packages` lists it or the draft call returned it.","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"externalId","in":"query","description":"The loan's id in the loan origination system (`loanInfo.loanId` on a loan read; not the loan number), to address the loan by instead of the path `id`: put the empty GUID in the path; when sent it is matched exactly and wins over the path `id`, and a value that matches no loan in your company answers 404.","schema":{"type":"string"}}],"responses":{"200":{"description":"Package retrieved successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ESignPackage"}}}},"401":{"description":"Missing, invalid or expired access token.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The client application is not authorized to access this resource","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Loan application or package not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}}}}
```

## Sends an e-sign draft to its signers.

> \*\*Required scope:\*\* \`send:esign-packages\`\
> \
> Billed scope: a send spends a credit in the company's PandaDoc workspace.

```json
{"openapi":"3.0.4","info":{"title":"Henge Partner API","version":"1.22.0"},"tags":[{"name":"Documents","description":"A loan's documents: the vault, a document's text and search over the documents' text, unsorted uploads, the condition a document is filed under and its status in the LOS.\n\n**E-sign packages:** E-sign packages on a loan: create a draft from the loan's documents, send it to the signers, and follow each package's status and each signer's progress. Sending goes out through the e-sign provider, so it has its own scope, granted on request.\n\n`GET /types/loan-document-types` lists the document types the other routes accept.\n\n**Scopes:** `create:loan-applications`, `delete:loan-applications`, `read:loan-applications`, `read:types`, `send:esign-packages`, `update:loan-applications`"}],"servers":[{"url":"https://uat-api.hengelending.com/partner","description":"UAT (sandbox): build and test here"},{"url":"https://api.hengelending.com/partner","description":"Production"}],"security":[{"Bearer":[]}],"components":{"securitySchemes":{"Bearer":{"type":"http","description":"Access token from POST /oauth/token, sent as `Authorization: Bearer <token>`.","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"SendESignPackageRequest":{"type":"object","properties":{"loanApplicationId":{"type":"string","description":"Id (GUID) of the loan the package belongs to.","format":"uuid"},"packageId":{"type":"string","description":"Id (GUID) of the draft package to send.","format":"uuid"},"subject":{"type":"string","description":"The email subject the signers see; defaults to the package name.","nullable":true},"message":{"type":"string","description":"The message the signers see in the signing email; optional.","nullable":true}},"additionalProperties":false,"description":"loanApplicationId and packageId are ignored: the route supplies them."},"ESignPackage":{"required":["createdAt","createdBy","id","loanApplicationId","status"],"type":"object","properties":{"id":{"type":"string","description":"Id (GUID) of the package.","format":"uuid"},"loanApplicationId":{"type":"string","description":"Id (GUID) of the loan the package belongs to.","format":"uuid"},"name":{"type":"string","description":"The package's name; defaults to the loan number.","nullable":true},"status":{"$ref":"#/components/schemas/ESignPackageStatus"},"pandaDocDocumentId":{"type":"string","description":"The e-sign provider's own id for the package's document.","nullable":true},"editorUrl":{"type":"string","description":"A link to the e-sign provider's editor, where the sender places signature fields. Returned for a draft.","nullable":true},"documents":{"type":"array","items":{"$ref":"#/components/schemas/ESignPackageDocument"},"description":"The documents in the package.","nullable":true},"signers":{"type":"array","items":{"$ref":"#/components/schemas/ESignPackageSigner"},"description":"The people who must sign, with each one's status.","nullable":true},"events":{"type":"array","items":{"$ref":"#/components/schemas/ESignPackageEvent"},"description":"The status events applied to the package so far, oldest first.","nullable":true},"createdAt":{"type":"string","description":"When the package was created, in UTC (ISO 8601).","format":"date-time"},"createdBy":{"type":"string","description":"Id of the user the package was created for.","format":"uuid"},"sentAt":{"type":"string","description":"When the package was sent to the signers, in UTC (ISO 8601); null while it is a draft.","format":"date-time","nullable":true},"completedAt":{"type":"string","description":"When the last signer signed, in UTC (ISO 8601); null until the package completes.","format":"date-time","nullable":true},"signedDocumentId":{"type":"string","description":"The vault document the signed PDF was filed as, once the package completes.","format":"uuid","nullable":true}},"additionalProperties":false,"description":"A package of documents sent for e-signature on a loan: who must sign, where signing stands and what happened. It holds no credentials."},"ESignPackageStatus":{"enum":["Draft","Sent","Viewed","Completed","Declined","Voided"],"type":"string","description":"Where an e-sign package stands: Draft (created and being prepared; nothing has gone to a signer), Sent (sent to the signers), Viewed (a signer has opened it), Completed (every signer has signed), Declined (a signer declined) or Voided (withdrawn by the sender)."},"ESignPackageDocument":{"type":"object","properties":{"vaultDocumentId":{"type":"string","description":"Id of the loan document included in the package; null for a PDF uploaded with the request.","format":"uuid","nullable":true},"fileName":{"type":"string","description":"The document's file name.","nullable":true}},"additionalProperties":false,"description":"One document in a package: a vault document the sender picked or a PDF they uploaded."},"ESignPackageSigner":{"type":"object","properties":{"role":{"$ref":"#/components/schemas/ESignSignerRole"},"borrowerId":{"type":"string","description":"Id of the borrower or co-borrower on the loan, when the signer is one.","format":"uuid","nullable":true},"contactId":{"type":"string","description":"Id of the loan contact, when the signer is a contact.","format":"uuid","nullable":true},"name":{"type":"string","description":"The signer's name.","nullable":true},"email":{"type":"string","description":"The email address the signing request is sent to.","nullable":true},"status":{"$ref":"#/components/schemas/ESignSignerStatus"},"signedAt":{"type":"string","description":"When the signer signed, in UTC (ISO 8601); null until they do.","format":"date-time","nullable":true}},"additionalProperties":false},"ESignSignerRole":{"enum":["Borrower","CoBorrower","Contact"],"type":"string","description":"A signer's relationship to the loan: Borrower, CoBorrower, or Contact (a person from the loan's contact list)."},"ESignSignerStatus":{"enum":["Pending","Signed"],"type":"string","description":"Whether a signer has signed: Pending or Signed."},"ESignPackageEvent":{"type":"object","properties":{"id":{"type":"string","description":"The provider's id for the event; a repeat of the same id is ignored.","nullable":true},"type":{"type":"string","description":"The provider's status or event name, for example document.sent or recipient_completed.","nullable":true},"occurredAt":{"type":"string","description":"When the event happened, in UTC (ISO 8601).","format":"date-time"},"signerEmail":{"type":"string","description":"The email of the signer the event is about; null for an event about the whole package.","nullable":true}},"additionalProperties":false,"description":"One status event received from the e-sign provider and applied to the package. The id makes a redelivery a no-op."},"ProblemDetails":{"required":["status","title","detail","instance","code","traceId"],"type":"object","properties":{"type":{"type":"string","description":"A URI that identifies the kind of problem, or null when none is given.","nullable":true},"title":{"type":"string","description":"A short, human-readable summary of the problem; it does not change between occurrences of the same problem."},"status":{"type":"integer","description":"The HTTP status code of the response.","format":"int32"},"detail":{"type":"string","description":"A human-readable explanation of this occurrence of the problem."},"instance":{"type":"string","description":"A URI that identifies this occurrence of the problem, typically the request path."},"code":{"type":"string","description":"A stable error code, such as `NotFound`, `ValidationFailed`, `Conflict` or `BusinessRuleViolation`. Present on every error; the Errors guide lists every value."},"traceId":{"type":"string","description":"The request's trace id. Quote it when you contact support about a failed call."},"requiredScope":{"type":"string","description":"The scope the token lacks, by its standard name. Present when `code` is `MissingScope` (403); ask your Henge contact to grant it to your credential."}},"additionalProperties":{},"description":"An error, in the RFC 9457 problem details shape. Branch on `code`, never on `title` or `detail`, which are for people and may change."}}},"paths":{"/loan-applications/{id}/esign-packages/{packageId}/send":{"post":{"tags":["Documents"],"summary":"Sends an e-sign draft to its signers.","description":"**Required scope:** `send:esign-packages`\n\nBilled scope: a send spends a credit in the company's PandaDoc workspace.","operationId":"LoanApplicationESignPackages_Send","parameters":[{"name":"id","in":"path","description":"The loan application's id (a GUID). Send the empty GUID `00000000-0000-0000-0000-000000000000` when you address the loan by `externalId` instead. A loan in another company answers 404, the same as one that does not exist.","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"packageId","in":"path","description":"The e-sign package's `id`, as `GET /loan-applications/{id}/esign-packages` lists it or the draft call returned it. Only a draft can be sent.","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"externalId","in":"query","description":"The loan's id in the loan origination system (`loanInfo.loanId` on a loan read; not the loan number), to address the loan by instead of the path `id`: put the empty GUID in the path; when sent it is matched exactly and wins over the path `id`, and a value that matches no loan in your company answers 404.","schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendESignPackageRequest"}}}},"responses":{"200":{"description":"Package sent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ESignPackage"}}}},"401":{"description":"Missing, invalid or expired access token.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The client application is not authorized to perform this action","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Loan application or package not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Not a draft, a signer has no signature field, or PandaDoc is not enabled or set up","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}}}}
```

## Creates an e-sign draft in PandaDoc.

> \*\*Required scope:\*\* \`send:esign-packages\`\
> \
> Billed scope. A signer without an email is refused by name, and a company without PandaDoc keys is refused before anything reaches PandaDoc.

```json
{"openapi":"3.0.4","info":{"title":"Henge Partner API","version":"1.22.0"},"tags":[{"name":"Documents","description":"A loan's documents: the vault, a document's text and search over the documents' text, unsorted uploads, the condition a document is filed under and its status in the LOS.\n\n**E-sign packages:** E-sign packages on a loan: create a draft from the loan's documents, send it to the signers, and follow each package's status and each signer's progress. Sending goes out through the e-sign provider, so it has its own scope, granted on request.\n\n`GET /types/loan-document-types` lists the document types the other routes accept.\n\n**Scopes:** `create:loan-applications`, `delete:loan-applications`, `read:loan-applications`, `read:types`, `send:esign-packages`, `update:loan-applications`"}],"servers":[{"url":"https://uat-api.hengelending.com/partner","description":"UAT (sandbox): build and test here"},{"url":"https://api.hengelending.com/partner","description":"Production"}],"security":[{"Bearer":[]}],"components":{"securitySchemes":{"Bearer":{"type":"http","description":"Access token from POST /oauth/token, sent as `Authorization: Bearer <token>`.","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"CreateESignPackageDraftRequest":{"required":["vaultDocumentIds"],"type":"object","properties":{"loanApplicationId":{"type":"string","description":"Id (GUID) of the loan the package is for.","format":"uuid"},"name":{"type":"string","description":"The package's name; defaults to the loan number.","nullable":true},"vaultDocumentIds":{"type":"array","items":{"type":"string","format":"uuid"},"description":"Ids of the loan's documents to include. May be combined with PDFs uploaded with the request."},"borrowerIds":{"type":"array","items":{"type":"string","format":"uuid"},"description":"Ids of the borrowers and co-borrowers on the loan who must sign.","nullable":true},"contactIds":{"type":"array","items":{"type":"string","format":"uuid"},"description":"Ids of the loan contacts who must sign.","nullable":true}},"additionalProperties":false,"description":"Send at least one signer in borrowerIds or contactIds. loanApplicationId is ignored: the route supplies it."},"ESignPackage":{"required":["createdAt","createdBy","id","loanApplicationId","status"],"type":"object","properties":{"id":{"type":"string","description":"Id (GUID) of the package.","format":"uuid"},"loanApplicationId":{"type":"string","description":"Id (GUID) of the loan the package belongs to.","format":"uuid"},"name":{"type":"string","description":"The package's name; defaults to the loan number.","nullable":true},"status":{"$ref":"#/components/schemas/ESignPackageStatus"},"pandaDocDocumentId":{"type":"string","description":"The e-sign provider's own id for the package's document.","nullable":true},"editorUrl":{"type":"string","description":"A link to the e-sign provider's editor, where the sender places signature fields. Returned for a draft.","nullable":true},"documents":{"type":"array","items":{"$ref":"#/components/schemas/ESignPackageDocument"},"description":"The documents in the package.","nullable":true},"signers":{"type":"array","items":{"$ref":"#/components/schemas/ESignPackageSigner"},"description":"The people who must sign, with each one's status.","nullable":true},"events":{"type":"array","items":{"$ref":"#/components/schemas/ESignPackageEvent"},"description":"The status events applied to the package so far, oldest first.","nullable":true},"createdAt":{"type":"string","description":"When the package was created, in UTC (ISO 8601).","format":"date-time"},"createdBy":{"type":"string","description":"Id of the user the package was created for.","format":"uuid"},"sentAt":{"type":"string","description":"When the package was sent to the signers, in UTC (ISO 8601); null while it is a draft.","format":"date-time","nullable":true},"completedAt":{"type":"string","description":"When the last signer signed, in UTC (ISO 8601); null until the package completes.","format":"date-time","nullable":true},"signedDocumentId":{"type":"string","description":"The vault document the signed PDF was filed as, once the package completes.","format":"uuid","nullable":true}},"additionalProperties":false,"description":"A package of documents sent for e-signature on a loan: who must sign, where signing stands and what happened. It holds no credentials."},"ESignPackageStatus":{"enum":["Draft","Sent","Viewed","Completed","Declined","Voided"],"type":"string","description":"Where an e-sign package stands: Draft (created and being prepared; nothing has gone to a signer), Sent (sent to the signers), Viewed (a signer has opened it), Completed (every signer has signed), Declined (a signer declined) or Voided (withdrawn by the sender)."},"ESignPackageDocument":{"type":"object","properties":{"vaultDocumentId":{"type":"string","description":"Id of the loan document included in the package; null for a PDF uploaded with the request.","format":"uuid","nullable":true},"fileName":{"type":"string","description":"The document's file name.","nullable":true}},"additionalProperties":false,"description":"One document in a package: a vault document the sender picked or a PDF they uploaded."},"ESignPackageSigner":{"type":"object","properties":{"role":{"$ref":"#/components/schemas/ESignSignerRole"},"borrowerId":{"type":"string","description":"Id of the borrower or co-borrower on the loan, when the signer is one.","format":"uuid","nullable":true},"contactId":{"type":"string","description":"Id of the loan contact, when the signer is a contact.","format":"uuid","nullable":true},"name":{"type":"string","description":"The signer's name.","nullable":true},"email":{"type":"string","description":"The email address the signing request is sent to.","nullable":true},"status":{"$ref":"#/components/schemas/ESignSignerStatus"},"signedAt":{"type":"string","description":"When the signer signed, in UTC (ISO 8601); null until they do.","format":"date-time","nullable":true}},"additionalProperties":false},"ESignSignerRole":{"enum":["Borrower","CoBorrower","Contact"],"type":"string","description":"A signer's relationship to the loan: Borrower, CoBorrower, or Contact (a person from the loan's contact list)."},"ESignSignerStatus":{"enum":["Pending","Signed"],"type":"string","description":"Whether a signer has signed: Pending or Signed."},"ESignPackageEvent":{"type":"object","properties":{"id":{"type":"string","description":"The provider's id for the event; a repeat of the same id is ignored.","nullable":true},"type":{"type":"string","description":"The provider's status or event name, for example document.sent or recipient_completed.","nullable":true},"occurredAt":{"type":"string","description":"When the event happened, in UTC (ISO 8601).","format":"date-time"},"signerEmail":{"type":"string","description":"The email of the signer the event is about; null for an event about the whole package.","nullable":true}},"additionalProperties":false,"description":"One status event received from the e-sign provider and applied to the package. The id makes a redelivery a no-op."},"ValidationProblemDetails":{"required":["status","title","detail","instance","code","traceId"],"type":"object","properties":{"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}},"description":"The validation problems: each key is the name of the field that failed and its value lists the messages for that field. Present when `code` is `ValidationFailed`.","nullable":true},"type":{"type":"string","description":"A URI that identifies the kind of problem, or null when none is given.","nullable":true},"title":{"type":"string","description":"A short, human-readable summary of the problem; it does not change between occurrences of the same problem."},"status":{"type":"integer","description":"The HTTP status code of the response.","format":"int32"},"detail":{"type":"string","description":"A human-readable explanation of this occurrence of the problem."},"instance":{"type":"string","description":"A URI that identifies this occurrence of the problem, typically the request path."},"code":{"type":"string","description":"A stable error code, such as `NotFound`, `ValidationFailed`, `Conflict` or `BusinessRuleViolation`. Present on every error; the Errors guide lists every value."},"traceId":{"type":"string","description":"The request's trace id. Quote it when you contact support about a failed call."}},"additionalProperties":{},"description":"The error body of a 400: the problem details shape, plus `errors`, which lists the problems by field when the request failed validation (`code` `ValidationFailed`). Branch on `code`."},"ProblemDetails":{"required":["status","title","detail","instance","code","traceId"],"type":"object","properties":{"type":{"type":"string","description":"A URI that identifies the kind of problem, or null when none is given.","nullable":true},"title":{"type":"string","description":"A short, human-readable summary of the problem; it does not change between occurrences of the same problem."},"status":{"type":"integer","description":"The HTTP status code of the response.","format":"int32"},"detail":{"type":"string","description":"A human-readable explanation of this occurrence of the problem."},"instance":{"type":"string","description":"A URI that identifies this occurrence of the problem, typically the request path."},"code":{"type":"string","description":"A stable error code, such as `NotFound`, `ValidationFailed`, `Conflict` or `BusinessRuleViolation`. Present on every error; the Errors guide lists every value."},"traceId":{"type":"string","description":"The request's trace id. Quote it when you contact support about a failed call."},"requiredScope":{"type":"string","description":"The scope the token lacks, by its standard name. Present when `code` is `MissingScope` (403); ask your Henge contact to grant it to your credential."}},"additionalProperties":{},"description":"An error, in the RFC 9457 problem details shape. Branch on `code`, never on `title` or `detail`, which are for people and may change."}}},"paths":{"/loan-applications/{id}/esign-packages/draft":{"post":{"tags":["Documents"],"summary":"Creates an e-sign draft in PandaDoc.","description":"**Required scope:** `send:esign-packages`\n\nBilled scope. A signer without an email is refused by name, and a company without PandaDoc keys is refused before anything reaches PandaDoc.","operationId":"LoanApplicationESignPackages_CreateDraft","parameters":[{"name":"id","in":"path","description":"The loan application's id (a GUID). Send the empty GUID `00000000-0000-0000-0000-000000000000` when you address the loan by `externalId` instead. A loan in another company answers 404, the same as one that does not exist.","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"externalId","in":"query","description":"The loan's id in the loan origination system (`loanInfo.loanId` on a loan read; not the loan number), to address the loan by instead of the path `id`: put the empty GUID in the path; when sent it is matched exactly and wins over the path `id`, and a value that matches no loan in your company answers 404.","schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateESignPackageDraftRequest"}}}},"responses":{"200":{"description":"Draft created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ESignPackage"}}}},"400":{"description":"Missing documents or signers, or a signer without an email","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ValidationProblemDetails"}}}},"401":{"description":"Missing, invalid or expired access token.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The client application is not authorized to perform this action","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Loan application not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"PandaDoc is not enabled or set up for the company, or refused the document","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}}}}
```

## Moves a document to a condition on the specified loan application.

> \*\*Required scope:\*\* \`update:loan-applications\`\
> \
> Replaces PUT {id}/documents/{documentId}/task, and lands the document the way that route does: a request that> \
> is Requested or Rejected takes it, a document already in the Loan Origination System is updated there first,> \
> and one on a condition is held until it is accepted.

```json
{"openapi":"3.0.4","info":{"title":"Henge Partner API","version":"1.22.0"},"tags":[{"name":"Documents","description":"A loan's documents: the vault, a document's text and search over the documents' text, unsorted uploads, the condition a document is filed under and its status in the LOS.\n\n**E-sign packages:** E-sign packages on a loan: create a draft from the loan's documents, send it to the signers, and follow each package's status and each signer's progress. Sending goes out through the e-sign provider, so it has its own scope, granted on request.\n\n`GET /types/loan-document-types` lists the document types the other routes accept.\n\n**Scopes:** `create:loan-applications`, `delete:loan-applications`, `read:loan-applications`, `read:types`, `send:esign-packages`, `update:loan-applications`"}],"servers":[{"url":"https://uat-api.hengelending.com/partner","description":"UAT (sandbox): build and test here"},{"url":"https://api.hengelending.com/partner","description":"Production"}],"security":[{"Bearer":[]}],"components":{"securitySchemes":{"Bearer":{"type":"http","description":"Access token from POST /oauth/token, sent as `Authorization: Bearer <token>`.","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"MoveLoanDocumentToConditionRequest":{"required":["conditionId"],"type":"object","properties":{"conditionId":{"type":"string","description":"The condition on the same loan the document is moved to.","format":"uuid"}},"additionalProperties":false,"description":"The body of `PUT {id}/documents/{documentId}/condition`."},"VaultDocumentResponse":{"type":"object","properties":{"id":{"type":"string","description":"Id (GUID) of the document.","format":"uuid"},"fileName":{"type":"string","description":"The document's file name.","nullable":true},"title":{"type":"string","description":"The title shown for the document; may be empty.","nullable":true},"description":{"type":"string","description":"A free-text description of the document; may be empty.","nullable":true},"isVault":{"type":"boolean","description":"True when the document was uploaded straight to the loan, false when it hangs off a task, a\r\ncondition or an asset account. Only a vault document can be deleted."},"loanApplicationTaskId":{"type":"string","description":"The task that owns the document, when one does. Null for a document uploaded straight to the\r\nloan.","format":"uuid","nullable":true},"documentType":{"$ref":"#/components/schemas/LoanDocumentTypeResponse"},"isObsolete":{"type":"boolean","description":"True when the document is no longer active. It remains listed for reference but should not\r\nbe treated as current."},"isProtected":{"type":"boolean","description":"True when the document is protected in the loan origination system, locked there against\r\nedits and deletion. Set with PUT .../documents/{documentId}/los-status."},"losStatus":{"$ref":"#/components/schemas/LoanDocumentLosStatus"},"indexStatus":{"type":"string","description":"Whether the document's text can be searched through documents/search: Indexed, Pending,\r\nFailed or NotSubmitted. Null when it could not be determined.","nullable":true},"isUnsorted":{"type":"boolean","description":"True while the document was sent to the loan in a bulk upload with no task and no type and has not\r\nbeen sorted. It is not sent to the loan origination system until it is put on a task or given a type."},"intakeStatus":{"type":"string","description":"NeedsPassword or Duplicate when a bulk-uploaded document is held for that reason; absent otherwise.","nullable":true},"duplicateOfDocumentId":{"type":"string","description":"The document this one repeats, when intakeStatus is Duplicate.","format":"uuid","nullable":true},"createdTimestamp":{"type":"string","description":"When the document was created, in UTC (ISO 8601).","format":"date-time"},"updatedTimestamp":{"type":"string","description":"When the document was last changed, in UTC (ISO 8601).","format":"date-time"}},"additionalProperties":false,"description":"A document on a loan application, wherever it came from."},"LoanDocumentTypeResponse":{"type":"object","properties":{"id":{"type":"string","description":"Id (GUID) of the document type; send it to file a document under this type.","format":"uuid"},"name":{"type":"string","description":"The document type's name.","nullable":true},"folderName":{"type":"string","description":"The folder this type belongs to.","nullable":true}},"additionalProperties":false,"description":"A document type a loan document can be filed under."},"LoanDocumentLosStatus":{"enum":["Active","Protected","Obsolete","Rejected","Screened"],"type":"string","description":"A loan document's status, one value per document, set here or in the LOS and kept in step both ways. The names are the LOS's own; the app shows Active as Pending, Screened as Accepted and Obsolete as Deleted."},"ValidationProblemDetails":{"required":["status","title","detail","instance","code","traceId"],"type":"object","properties":{"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}},"description":"The validation problems: each key is the name of the field that failed and its value lists the messages for that field. Present when `code` is `ValidationFailed`.","nullable":true},"type":{"type":"string","description":"A URI that identifies the kind of problem, or null when none is given.","nullable":true},"title":{"type":"string","description":"A short, human-readable summary of the problem; it does not change between occurrences of the same problem."},"status":{"type":"integer","description":"The HTTP status code of the response.","format":"int32"},"detail":{"type":"string","description":"A human-readable explanation of this occurrence of the problem."},"instance":{"type":"string","description":"A URI that identifies this occurrence of the problem, typically the request path."},"code":{"type":"string","description":"A stable error code, such as `NotFound`, `ValidationFailed`, `Conflict` or `BusinessRuleViolation`. Present on every error; the Errors guide lists every value."},"traceId":{"type":"string","description":"The request's trace id. Quote it when you contact support about a failed call."}},"additionalProperties":{},"description":"The error body of a 400: the problem details shape, plus `errors`, which lists the problems by field when the request failed validation (`code` `ValidationFailed`). Branch on `code`."},"ProblemDetails":{"required":["status","title","detail","instance","code","traceId"],"type":"object","properties":{"type":{"type":"string","description":"A URI that identifies the kind of problem, or null when none is given.","nullable":true},"title":{"type":"string","description":"A short, human-readable summary of the problem; it does not change between occurrences of the same problem."},"status":{"type":"integer","description":"The HTTP status code of the response.","format":"int32"},"detail":{"type":"string","description":"A human-readable explanation of this occurrence of the problem."},"instance":{"type":"string","description":"A URI that identifies this occurrence of the problem, typically the request path."},"code":{"type":"string","description":"A stable error code, such as `NotFound`, `ValidationFailed`, `Conflict` or `BusinessRuleViolation`. Present on every error; the Errors guide lists every value."},"traceId":{"type":"string","description":"The request's trace id. Quote it when you contact support about a failed call."},"requiredScope":{"type":"string","description":"The scope the token lacks, by its standard name. Present when `code` is `MissingScope` (403); ask your Henge contact to grant it to your credential."}},"additionalProperties":{},"description":"An error, in the RFC 9457 problem details shape. Branch on `code`, never on `title` or `detail`, which are for people and may change."}}},"paths":{"/loan-applications/{id}/documents/{documentId}/condition":{"put":{"tags":["Documents"],"summary":"Moves a document to a condition on the specified loan application.","description":"**Required scope:** `update:loan-applications`\n\nReplaces PUT {id}/documents/{documentId}/task, and lands the document the way that route does: a request that\r\nis Requested or Rejected takes it, a document already in the Loan Origination System is updated there first,\r\nand one on a condition is held until it is accepted.","operationId":"LoanApplicationConditions_MoveLoanApplicationDocumentToCondition","parameters":[{"name":"id","in":"path","description":"The unique identifier of the loan application.","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"documentId","in":"path","description":"The unique identifier of the document.","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"description":"The condition to move the document to.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MoveLoanDocumentToConditionRequest"}}}},"responses":{"200":{"description":"Document moved successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VaultDocumentResponse"}}}},"400":{"description":"Invalid identifier or request payload","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ValidationProblemDetails"}}}},"401":{"description":"Unauthorized","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The client application is not authorized to perform this action","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Loan application, document or condition not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"The document cannot leave its task, or the condition cannot take it","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The Loan Origination System refused the update; nothing was changed","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"An unexpected error occurred","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}}}}
```

## Sets a loan document's status.

> \*\*Required scope:\*\* \`update:loan-applications\`\
> \
> A document has one status, shared with the loan origination system: Active (none yet), Screened> \
> (reviewed and accepted), Rejected, Protected (locked there against edits and deletion) or Obsolete> \
> (retired). Rejected and Obsolete documents stay listed here with isObsolete true. Works on any> \
> document on the loan, whether it was uploaded to the loan or to a task. For a document already filed> \
> in the loan origination system that system is updated first, and if it refuses, nothing changes; a> \
> document not filed yet keeps the status here and takes it along when it is filed. Screened or> \
> Rejected on a document whose task is waiting for review accepts or rejects that task, exactly as the> \
> task accept and reject operations do, and Rejected then needs rejectionReasonId. The application must> \
> act as a user in its company who is an Admin, Processor, CompanyAdmin, Assistant or ConciergeKey;> \
> Protected, and any change to a Protected document, need an Admin or a Processor.

```json
{"openapi":"3.0.4","info":{"title":"Henge Partner API","version":"1.22.0"},"tags":[{"name":"Documents","description":"A loan's documents: the vault, a document's text and search over the documents' text, unsorted uploads, the condition a document is filed under and its status in the LOS.\n\n**E-sign packages:** E-sign packages on a loan: create a draft from the loan's documents, send it to the signers, and follow each package's status and each signer's progress. Sending goes out through the e-sign provider, so it has its own scope, granted on request.\n\n`GET /types/loan-document-types` lists the document types the other routes accept.\n\n**Scopes:** `create:loan-applications`, `delete:loan-applications`, `read:loan-applications`, `read:types`, `send:esign-packages`, `update:loan-applications`"}],"servers":[{"url":"https://uat-api.hengelending.com/partner","description":"UAT (sandbox): build and test here"},{"url":"https://api.hengelending.com/partner","description":"Production"}],"security":[{"Bearer":[]}],"components":{"securitySchemes":{"Bearer":{"type":"http","description":"Access token from POST /oauth/token, sent as `Authorization: Bearer <token>`.","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"SetLoanDocumentLosStatusBody":{"required":["status"],"type":"object","properties":{"status":{"$ref":"#/components/schemas/LoanDocumentLosStatus"},"rejectionReasonId":{"type":"string","description":"Required with Rejected on a document whose task is waiting for review: the rejection reason's\r\nid. Ignored otherwise.","format":"uuid","nullable":true},"rejectionReasonNote":{"type":"string","description":"An optional note to go with the rejection reason.","nullable":true}},"additionalProperties":false,"description":"The body of the status endpoints on both APIs. Rejecting a document whose task is waiting for review also needs `rejectionReasonId`."},"LoanDocumentLosStatus":{"enum":["Active","Protected","Obsolete","Rejected","Screened"],"type":"string","description":"A loan document's status, one value per document, set here or in the LOS and kept in step both ways. The names are the LOS's own; the app shows Active as Pending, Screened as Accepted and Obsolete as Deleted."},"VaultDocumentResponse":{"type":"object","properties":{"id":{"type":"string","description":"Id (GUID) of the document.","format":"uuid"},"fileName":{"type":"string","description":"The document's file name.","nullable":true},"title":{"type":"string","description":"The title shown for the document; may be empty.","nullable":true},"description":{"type":"string","description":"A free-text description of the document; may be empty.","nullable":true},"isVault":{"type":"boolean","description":"True when the document was uploaded straight to the loan, false when it hangs off a task, a\r\ncondition or an asset account. Only a vault document can be deleted."},"loanApplicationTaskId":{"type":"string","description":"The task that owns the document, when one does. Null for a document uploaded straight to the\r\nloan.","format":"uuid","nullable":true},"documentType":{"$ref":"#/components/schemas/LoanDocumentTypeResponse"},"isObsolete":{"type":"boolean","description":"True when the document is no longer active. It remains listed for reference but should not\r\nbe treated as current."},"isProtected":{"type":"boolean","description":"True when the document is protected in the loan origination system, locked there against\r\nedits and deletion. Set with PUT .../documents/{documentId}/los-status."},"losStatus":{"$ref":"#/components/schemas/LoanDocumentLosStatus"},"indexStatus":{"type":"string","description":"Whether the document's text can be searched through documents/search: Indexed, Pending,\r\nFailed or NotSubmitted. Null when it could not be determined.","nullable":true},"isUnsorted":{"type":"boolean","description":"True while the document was sent to the loan in a bulk upload with no task and no type and has not\r\nbeen sorted. It is not sent to the loan origination system until it is put on a task or given a type."},"intakeStatus":{"type":"string","description":"NeedsPassword or Duplicate when a bulk-uploaded document is held for that reason; absent otherwise.","nullable":true},"duplicateOfDocumentId":{"type":"string","description":"The document this one repeats, when intakeStatus is Duplicate.","format":"uuid","nullable":true},"createdTimestamp":{"type":"string","description":"When the document was created, in UTC (ISO 8601).","format":"date-time"},"updatedTimestamp":{"type":"string","description":"When the document was last changed, in UTC (ISO 8601).","format":"date-time"}},"additionalProperties":false,"description":"A document on a loan application, wherever it came from."},"LoanDocumentTypeResponse":{"type":"object","properties":{"id":{"type":"string","description":"Id (GUID) of the document type; send it to file a document under this type.","format":"uuid"},"name":{"type":"string","description":"The document type's name.","nullable":true},"folderName":{"type":"string","description":"The folder this type belongs to.","nullable":true}},"additionalProperties":false,"description":"A document type a loan document can be filed under."},"ValidationProblemDetails":{"required":["status","title","detail","instance","code","traceId"],"type":"object","properties":{"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}},"description":"The validation problems: each key is the name of the field that failed and its value lists the messages for that field. Present when `code` is `ValidationFailed`.","nullable":true},"type":{"type":"string","description":"A URI that identifies the kind of problem, or null when none is given.","nullable":true},"title":{"type":"string","description":"A short, human-readable summary of the problem; it does not change between occurrences of the same problem."},"status":{"type":"integer","description":"The HTTP status code of the response.","format":"int32"},"detail":{"type":"string","description":"A human-readable explanation of this occurrence of the problem."},"instance":{"type":"string","description":"A URI that identifies this occurrence of the problem, typically the request path."},"code":{"type":"string","description":"A stable error code, such as `NotFound`, `ValidationFailed`, `Conflict` or `BusinessRuleViolation`. Present on every error; the Errors guide lists every value."},"traceId":{"type":"string","description":"The request's trace id. Quote it when you contact support about a failed call."}},"additionalProperties":{},"description":"The error body of a 400: the problem details shape, plus `errors`, which lists the problems by field when the request failed validation (`code` `ValidationFailed`). Branch on `code`."},"ProblemDetails":{"required":["status","title","detail","instance","code","traceId"],"type":"object","properties":{"type":{"type":"string","description":"A URI that identifies the kind of problem, or null when none is given.","nullable":true},"title":{"type":"string","description":"A short, human-readable summary of the problem; it does not change between occurrences of the same problem."},"status":{"type":"integer","description":"The HTTP status code of the response.","format":"int32"},"detail":{"type":"string","description":"A human-readable explanation of this occurrence of the problem."},"instance":{"type":"string","description":"A URI that identifies this occurrence of the problem, typically the request path."},"code":{"type":"string","description":"A stable error code, such as `NotFound`, `ValidationFailed`, `Conflict` or `BusinessRuleViolation`. Present on every error; the Errors guide lists every value."},"traceId":{"type":"string","description":"The request's trace id. Quote it when you contact support about a failed call."},"requiredScope":{"type":"string","description":"The scope the token lacks, by its standard name. Present when `code` is `MissingScope` (403); ask your Henge contact to grant it to your credential."}},"additionalProperties":{},"description":"An error, in the RFC 9457 problem details shape. Branch on `code`, never on `title` or `detail`, which are for people and may change."}}},"paths":{"/loan-applications/{id}/documents/{documentId}/los-status":{"put":{"tags":["Documents"],"summary":"Sets a loan document's status.","description":"**Required scope:** `update:loan-applications`\n\nA document has one status, shared with the loan origination system: Active (none yet), Screened\r\n(reviewed and accepted), Rejected, Protected (locked there against edits and deletion) or Obsolete\r\n(retired). Rejected and Obsolete documents stay listed here with isObsolete true. Works on any\r\ndocument on the loan, whether it was uploaded to the loan or to a task. For a document already filed\r\nin the loan origination system that system is updated first, and if it refuses, nothing changes; a\r\ndocument not filed yet keeps the status here and takes it along when it is filed. Screened or\r\nRejected on a document whose task is waiting for review accepts or rejects that task, exactly as the\r\ntask accept and reject operations do, and Rejected then needs rejectionReasonId. The application must\r\nact as a user in its company who is an Admin, Processor, CompanyAdmin, Assistant or ConciergeKey;\r\nProtected, and any change to a Protected document, need an Admin or a Processor.","operationId":"LoanApplicationDocumentStatus_SetLoanDocumentLosStatus","parameters":[{"name":"id","in":"path","description":"Loan application id.","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"documentId","in":"path","description":"The document's id, as vault-documents returns it.","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"description":"The status to set, with the rejection reason when it rejects a task under review.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetLoanDocumentLosStatusBody"}}}},"responses":{"200":{"description":"Status set","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VaultDocumentResponse"}}}},"400":{"description":"No or unknown status, or a rejection of a task under review with no rejection reason","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ValidationProblemDetails"}}}},"401":{"description":"Unauthorized","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The application's acting user does not hold a role that may set this status","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Loan application or document not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The loan origination system refused the change, or the loan's documents are being updated; try again","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"An unexpected error occurred","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}}}}
```

## Opens a password-protected document held at intake.

> \*\*Required scope:\*\* \`update:loan-applications\`\
> \
> The decrypted copy replaces the stored file and the password is dropped, never stored or logged. A> \
> wrong password is a 400 and changes nothing.

```json
{"openapi":"3.0.4","info":{"title":"Henge Partner API","version":"1.22.0"},"tags":[{"name":"Documents","description":"A loan's documents: the vault, a document's text and search over the documents' text, unsorted uploads, the condition a document is filed under and its status in the LOS.\n\n**E-sign packages:** E-sign packages on a loan: create a draft from the loan's documents, send it to the signers, and follow each package's status and each signer's progress. Sending goes out through the e-sign provider, so it has its own scope, granted on request.\n\n`GET /types/loan-document-types` lists the document types the other routes accept.\n\n**Scopes:** `create:loan-applications`, `delete:loan-applications`, `read:loan-applications`, `read:types`, `send:esign-packages`, `update:loan-applications`"}],"servers":[{"url":"https://uat-api.hengelending.com/partner","description":"UAT (sandbox): build and test here"},{"url":"https://api.hengelending.com/partner","description":"Production"}],"security":[{"Bearer":[]}],"components":{"securitySchemes":{"Bearer":{"type":"http","description":"Access token from POST /oauth/token, sent as `Authorization: Bearer <token>`.","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"SubmitDocumentPasswordBody":{"required":["password"],"type":"object","properties":{"password":{"type":"string","description":"The password of the protected PDF. It is used once to unlock the file and is never stored."}},"additionalProperties":false,"description":"The password of a protected PDF that is held until it is given."},"VaultDocumentResponse":{"type":"object","properties":{"id":{"type":"string","description":"Id (GUID) of the document.","format":"uuid"},"fileName":{"type":"string","description":"The document's file name.","nullable":true},"title":{"type":"string","description":"The title shown for the document; may be empty.","nullable":true},"description":{"type":"string","description":"A free-text description of the document; may be empty.","nullable":true},"isVault":{"type":"boolean","description":"True when the document was uploaded straight to the loan, false when it hangs off a task, a\r\ncondition or an asset account. Only a vault document can be deleted."},"loanApplicationTaskId":{"type":"string","description":"The task that owns the document, when one does. Null for a document uploaded straight to the\r\nloan.","format":"uuid","nullable":true},"documentType":{"$ref":"#/components/schemas/LoanDocumentTypeResponse"},"isObsolete":{"type":"boolean","description":"True when the document is no longer active. It remains listed for reference but should not\r\nbe treated as current."},"isProtected":{"type":"boolean","description":"True when the document is protected in the loan origination system, locked there against\r\nedits and deletion. Set with PUT .../documents/{documentId}/los-status."},"losStatus":{"$ref":"#/components/schemas/LoanDocumentLosStatus"},"indexStatus":{"type":"string","description":"Whether the document's text can be searched through documents/search: Indexed, Pending,\r\nFailed or NotSubmitted. Null when it could not be determined.","nullable":true},"isUnsorted":{"type":"boolean","description":"True while the document was sent to the loan in a bulk upload with no task and no type and has not\r\nbeen sorted. It is not sent to the loan origination system until it is put on a task or given a type."},"intakeStatus":{"type":"string","description":"NeedsPassword or Duplicate when a bulk-uploaded document is held for that reason; absent otherwise.","nullable":true},"duplicateOfDocumentId":{"type":"string","description":"The document this one repeats, when intakeStatus is Duplicate.","format":"uuid","nullable":true},"createdTimestamp":{"type":"string","description":"When the document was created, in UTC (ISO 8601).","format":"date-time"},"updatedTimestamp":{"type":"string","description":"When the document was last changed, in UTC (ISO 8601).","format":"date-time"}},"additionalProperties":false,"description":"A document on a loan application, wherever it came from."},"LoanDocumentTypeResponse":{"type":"object","properties":{"id":{"type":"string","description":"Id (GUID) of the document type; send it to file a document under this type.","format":"uuid"},"name":{"type":"string","description":"The document type's name.","nullable":true},"folderName":{"type":"string","description":"The folder this type belongs to.","nullable":true}},"additionalProperties":false,"description":"A document type a loan document can be filed under."},"LoanDocumentLosStatus":{"enum":["Active","Protected","Obsolete","Rejected","Screened"],"type":"string","description":"A loan document's status, one value per document, set here or in the LOS and kept in step both ways. The names are the LOS's own; the app shows Active as Pending, Screened as Accepted and Obsolete as Deleted."},"ValidationProblemDetails":{"required":["status","title","detail","instance","code","traceId"],"type":"object","properties":{"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}},"description":"The validation problems: each key is the name of the field that failed and its value lists the messages for that field. Present when `code` is `ValidationFailed`.","nullable":true},"type":{"type":"string","description":"A URI that identifies the kind of problem, or null when none is given.","nullable":true},"title":{"type":"string","description":"A short, human-readable summary of the problem; it does not change between occurrences of the same problem."},"status":{"type":"integer","description":"The HTTP status code of the response.","format":"int32"},"detail":{"type":"string","description":"A human-readable explanation of this occurrence of the problem."},"instance":{"type":"string","description":"A URI that identifies this occurrence of the problem, typically the request path."},"code":{"type":"string","description":"A stable error code, such as `NotFound`, `ValidationFailed`, `Conflict` or `BusinessRuleViolation`. Present on every error; the Errors guide lists every value."},"traceId":{"type":"string","description":"The request's trace id. Quote it when you contact support about a failed call."}},"additionalProperties":{},"description":"The error body of a 400: the problem details shape, plus `errors`, which lists the problems by field when the request failed validation (`code` `ValidationFailed`). Branch on `code`."},"ProblemDetails":{"required":["status","title","detail","instance","code","traceId"],"type":"object","properties":{"type":{"type":"string","description":"A URI that identifies the kind of problem, or null when none is given.","nullable":true},"title":{"type":"string","description":"A short, human-readable summary of the problem; it does not change between occurrences of the same problem."},"status":{"type":"integer","description":"The HTTP status code of the response.","format":"int32"},"detail":{"type":"string","description":"A human-readable explanation of this occurrence of the problem."},"instance":{"type":"string","description":"A URI that identifies this occurrence of the problem, typically the request path."},"code":{"type":"string","description":"A stable error code, such as `NotFound`, `ValidationFailed`, `Conflict` or `BusinessRuleViolation`. Present on every error; the Errors guide lists every value."},"traceId":{"type":"string","description":"The request's trace id. Quote it when you contact support about a failed call."},"requiredScope":{"type":"string","description":"The scope the token lacks, by its standard name. Present when `code` is `MissingScope` (403); ask your Henge contact to grant it to your credential."}},"additionalProperties":{},"description":"An error, in the RFC 9457 problem details shape. Branch on `code`, never on `title` or `detail`, which are for people and may change."}}},"paths":{"/loan-applications/{id}/documents/{documentId}/password":{"post":{"tags":["Documents"],"summary":"Opens a password-protected document held at intake.","description":"**Required scope:** `update:loan-applications`\n\nThe decrypted copy replaces the stored file and the password is dropped, never stored or logged. A\r\nwrong password is a 400 and changes nothing.","operationId":"LoanApplicationDocumentIntake_SubmitDocumentPassword","parameters":[{"name":"id","in":"path","description":"Loan application id.","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"documentId","in":"path","description":"The document waiting for its password.","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"description":"The password.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubmitDocumentPasswordBody"}}}},"responses":{"200":{"description":"The document","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VaultDocumentResponse"}}}},"400":{"description":"No password, or the password is wrong","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ValidationProblemDetails"}}}},"401":{"description":"Missing, invalid or expired access token.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The access token lacks the update:loan-applications scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Loan application or document not found, or document intake is off for the caller","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"An unexpected error occurred","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}}}}
```

## Moves a document to a task on the specified loan application.

> \*\*Required scope:\*\* \`update:loan-applications\`\
> \
> 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 document already in the Loan Origination System is updated there first and never uploaded> \
> again; one on a condition is held until it is accepted. Deprecated: use the matching conditions route; the task routes are withdrawn on the Sunset date in the response headers.

```json
{"openapi":"3.0.4","info":{"title":"Henge Partner API","version":"1.22.0"},"tags":[{"name":"Documents","description":"A loan's documents: the vault, a document's text and search over the documents' text, unsorted uploads, the condition a document is filed under and its status in the LOS.\n\n**E-sign packages:** E-sign packages on a loan: create a draft from the loan's documents, send it to the signers, and follow each package's status and each signer's progress. Sending goes out through the e-sign provider, so it has its own scope, granted on request.\n\n`GET /types/loan-document-types` lists the document types the other routes accept.\n\n**Scopes:** `create:loan-applications`, `delete:loan-applications`, `read:loan-applications`, `read:types`, `send:esign-packages`, `update:loan-applications`"}],"servers":[{"url":"https://uat-api.hengelending.com/partner","description":"UAT (sandbox): build and test here"},{"url":"https://api.hengelending.com/partner","description":"Production"}],"security":[{"Bearer":[]}],"components":{"securitySchemes":{"Bearer":{"type":"http","description":"Access token from POST /oauth/token, sent as `Authorization: Bearer <token>`.","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"MoveLoanDocumentToTaskRequest":{"required":["taskId"],"type":"object","properties":{"taskId":{"type":"string","description":"Id (GUID) of the task on the same loan to move the document to, or to attach it to when it has no task yet.","format":"uuid"}},"additionalProperties":false,"description":"The task on the same loan a document is moved to, or attached to when it has no task yet."},"VaultDocumentResponse":{"type":"object","properties":{"id":{"type":"string","description":"Id (GUID) of the document.","format":"uuid"},"fileName":{"type":"string","description":"The document's file name.","nullable":true},"title":{"type":"string","description":"The title shown for the document; may be empty.","nullable":true},"description":{"type":"string","description":"A free-text description of the document; may be empty.","nullable":true},"isVault":{"type":"boolean","description":"True when the document was uploaded straight to the loan, false when it hangs off a task, a\r\ncondition or an asset account. Only a vault document can be deleted."},"loanApplicationTaskId":{"type":"string","description":"The task that owns the document, when one does. Null for a document uploaded straight to the\r\nloan.","format":"uuid","nullable":true},"documentType":{"$ref":"#/components/schemas/LoanDocumentTypeResponse"},"isObsolete":{"type":"boolean","description":"True when the document is no longer active. It remains listed for reference but should not\r\nbe treated as current."},"isProtected":{"type":"boolean","description":"True when the document is protected in the loan origination system, locked there against\r\nedits and deletion. Set with PUT .../documents/{documentId}/los-status."},"losStatus":{"$ref":"#/components/schemas/LoanDocumentLosStatus"},"indexStatus":{"type":"string","description":"Whether the document's text can be searched through documents/search: Indexed, Pending,\r\nFailed or NotSubmitted. Null when it could not be determined.","nullable":true},"isUnsorted":{"type":"boolean","description":"True while the document was sent to the loan in a bulk upload with no task and no type and has not\r\nbeen sorted. It is not sent to the loan origination system until it is put on a task or given a type."},"intakeStatus":{"type":"string","description":"NeedsPassword or Duplicate when a bulk-uploaded document is held for that reason; absent otherwise.","nullable":true},"duplicateOfDocumentId":{"type":"string","description":"The document this one repeats, when intakeStatus is Duplicate.","format":"uuid","nullable":true},"createdTimestamp":{"type":"string","description":"When the document was created, in UTC (ISO 8601).","format":"date-time"},"updatedTimestamp":{"type":"string","description":"When the document was last changed, in UTC (ISO 8601).","format":"date-time"}},"additionalProperties":false,"description":"A document on a loan application, wherever it came from."},"LoanDocumentTypeResponse":{"type":"object","properties":{"id":{"type":"string","description":"Id (GUID) of the document type; send it to file a document under this type.","format":"uuid"},"name":{"type":"string","description":"The document type's name.","nullable":true},"folderName":{"type":"string","description":"The folder this type belongs to.","nullable":true}},"additionalProperties":false,"description":"A document type a loan document can be filed under."},"LoanDocumentLosStatus":{"enum":["Active","Protected","Obsolete","Rejected","Screened"],"type":"string","description":"A loan document's status, one value per document, set here or in the LOS and kept in step both ways. The names are the LOS's own; the app shows Active as Pending, Screened as Accepted and Obsolete as Deleted."},"ValidationProblemDetails":{"required":["status","title","detail","instance","code","traceId"],"type":"object","properties":{"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}},"description":"The validation problems: each key is the name of the field that failed and its value lists the messages for that field. Present when `code` is `ValidationFailed`.","nullable":true},"type":{"type":"string","description":"A URI that identifies the kind of problem, or null when none is given.","nullable":true},"title":{"type":"string","description":"A short, human-readable summary of the problem; it does not change between occurrences of the same problem."},"status":{"type":"integer","description":"The HTTP status code of the response.","format":"int32"},"detail":{"type":"string","description":"A human-readable explanation of this occurrence of the problem."},"instance":{"type":"string","description":"A URI that identifies this occurrence of the problem, typically the request path."},"code":{"type":"string","description":"A stable error code, such as `NotFound`, `ValidationFailed`, `Conflict` or `BusinessRuleViolation`. Present on every error; the Errors guide lists every value."},"traceId":{"type":"string","description":"The request's trace id. Quote it when you contact support about a failed call."}},"additionalProperties":{},"description":"The error body of a 400: the problem details shape, plus `errors`, which lists the problems by field when the request failed validation (`code` `ValidationFailed`). Branch on `code`."},"ProblemDetails":{"required":["status","title","detail","instance","code","traceId"],"type":"object","properties":{"type":{"type":"string","description":"A URI that identifies the kind of problem, or null when none is given.","nullable":true},"title":{"type":"string","description":"A short, human-readable summary of the problem; it does not change between occurrences of the same problem."},"status":{"type":"integer","description":"The HTTP status code of the response.","format":"int32"},"detail":{"type":"string","description":"A human-readable explanation of this occurrence of the problem."},"instance":{"type":"string","description":"A URI that identifies this occurrence of the problem, typically the request path."},"code":{"type":"string","description":"A stable error code, such as `NotFound`, `ValidationFailed`, `Conflict` or `BusinessRuleViolation`. Present on every error; the Errors guide lists every value."},"traceId":{"type":"string","description":"The request's trace id. Quote it when you contact support about a failed call."},"requiredScope":{"type":"string","description":"The scope the token lacks, by its standard name. Present when `code` is `MissingScope` (403); ask your Henge contact to grant it to your credential."}},"additionalProperties":{},"description":"An error, in the RFC 9457 problem details shape. Branch on `code`, never on `title` or `detail`, which are for people and may change."}}},"paths":{"/loan-applications/{id}/documents/{documentId}/task":{"put":{"tags":["Documents"],"summary":"Moves a document to a task on the specified loan application.","description":"**Required scope:** `update:loan-applications`\n\nThe document lands the way an upload to that task would: a Requested or Rejected task takes it\r\nand becomes Uploaded; a task that already has its document is copied and the copy takes it. The\r\ntask it leaves goes back to Requested, or is removed when it was a copy made for that document.\r\nA document already in the Loan Origination System is updated there first and never uploaded\r\nagain; one on a condition is held until it is accepted. Deprecated: use the matching conditions route; the task routes are withdrawn on the Sunset date in the response headers.","operationId":"LoanApplications_MoveLoanApplicationDocumentToTask","parameters":[{"name":"id","in":"path","description":"The unique identifier of the loan application.","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"documentId","in":"path","description":"The unique identifier of the document.","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"description":"The task to move the document to.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MoveLoanDocumentToTaskRequest"}}}},"responses":{"200":{"description":"Document moved successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VaultDocumentResponse"}}}},"400":{"description":"Invalid identifier or request payload","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ValidationProblemDetails"}}}},"401":{"description":"Unauthorized","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The client application is not authorized to perform this action","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Loan application, document or task not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"The document cannot leave its task, or the task cannot take it","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The Loan Origination System refused the update; nothing was changed","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"An unexpected error occurred","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"deprecated":true}}}}
```

## Retrieves a loan document's extracted text.

> \*\*Required scope:\*\* \`read:loan-applications\`\
> \
> The text the document was indexed from, as markdown, with each page introduced by a> \
> \<!-- rf:page N --> marker. fromPage and toPage select a page range; a long document is> \
> cut at whole pages and nextFromPage says where to continue. indexStatus says whether the> \
> document has been processed yet, and warnings carries any extraction warnings. Documents> \
> flagged internal are not found.

```json
{"openapi":"3.0.4","info":{"title":"Henge Partner API","version":"1.22.0"},"tags":[{"name":"Documents","description":"A loan's documents: the vault, a document's text and search over the documents' text, unsorted uploads, the condition a document is filed under and its status in the LOS.\n\n**E-sign packages:** E-sign packages on a loan: create a draft from the loan's documents, send it to the signers, and follow each package's status and each signer's progress. Sending goes out through the e-sign provider, so it has its own scope, granted on request.\n\n`GET /types/loan-document-types` lists the document types the other routes accept.\n\n**Scopes:** `create:loan-applications`, `delete:loan-applications`, `read:loan-applications`, `read:types`, `send:esign-packages`, `update:loan-applications`"}],"servers":[{"url":"https://uat-api.hengelending.com/partner","description":"UAT (sandbox): build and test here"},{"url":"https://api.hengelending.com/partner","description":"Production"}],"security":[{"Bearer":[]}],"components":{"securitySchemes":{"Bearer":{"type":"http","description":"Access token from POST /oauth/token, sent as `Authorization: Bearer <token>`.","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"LoanDocumentText":{"type":"object","properties":{"loanApplicationDocumentId":{"type":"string","description":"Id (GUID) of the loan document the text belongs to.","format":"uuid"},"ingestedDocumentId":{"type":"string","description":"Id of the indexed record the text was read from; null when the document has not been indexed.","nullable":true},"indexStatus":{"type":"string","description":"Whether the document is searchable: Indexed, Pending, Failed or NotSubmitted.","nullable":true},"method":{"type":"string","description":"How the text was extracted from the file; null when not recorded.","nullable":true},"pageCount":{"type":"integer","description":"Number of pages in the document.","format":"int32"},"fromPage":{"type":"integer","description":"The first and last page returned. Null when the text carries no page boundaries.","format":"int32","nullable":true},"toPage":{"type":"integer","description":"The last page of the text returned (1-based). Null when the text carries no page boundaries.","format":"int32","nullable":true},"nextFromPage":{"type":"integer","description":"Where to continue when the text was cut to the size limit.","format":"int32","nullable":true},"truncated":{"type":"boolean","description":"True when the text was cut to the size limit; continue from nextFromPage."},"hasPageMarkers":{"type":"boolean","description":"True when text marks each page with a comment of the form rf:page N. False for a format with no pages and for a document extracted before pages were recorded."},"text":{"type":"string","description":"The extracted markdown. Null when there is none yet.","nullable":true},"warnings":{"type":"array","items":{"type":"string"},"description":"Extraction warning codes, plus any about this read.","nullable":true},"error":{"type":"string","description":"Why the text could not be returned, when it could not; null otherwise.","nullable":true}},"additionalProperties":false,"description":"A loan document's extracted text."},"ValidationProblemDetails":{"required":["status","title","detail","instance","code","traceId"],"type":"object","properties":{"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}},"description":"The validation problems: each key is the name of the field that failed and its value lists the messages for that field. Present when `code` is `ValidationFailed`.","nullable":true},"type":{"type":"string","description":"A URI that identifies the kind of problem, or null when none is given.","nullable":true},"title":{"type":"string","description":"A short, human-readable summary of the problem; it does not change between occurrences of the same problem."},"status":{"type":"integer","description":"The HTTP status code of the response.","format":"int32"},"detail":{"type":"string","description":"A human-readable explanation of this occurrence of the problem."},"instance":{"type":"string","description":"A URI that identifies this occurrence of the problem, typically the request path."},"code":{"type":"string","description":"A stable error code, such as `NotFound`, `ValidationFailed`, `Conflict` or `BusinessRuleViolation`. Present on every error; the Errors guide lists every value."},"traceId":{"type":"string","description":"The request's trace id. Quote it when you contact support about a failed call."}},"additionalProperties":{},"description":"The error body of a 400: the problem details shape, plus `errors`, which lists the problems by field when the request failed validation (`code` `ValidationFailed`). Branch on `code`."},"ProblemDetails":{"required":["status","title","detail","instance","code","traceId"],"type":"object","properties":{"type":{"type":"string","description":"A URI that identifies the kind of problem, or null when none is given.","nullable":true},"title":{"type":"string","description":"A short, human-readable summary of the problem; it does not change between occurrences of the same problem."},"status":{"type":"integer","description":"The HTTP status code of the response.","format":"int32"},"detail":{"type":"string","description":"A human-readable explanation of this occurrence of the problem."},"instance":{"type":"string","description":"A URI that identifies this occurrence of the problem, typically the request path."},"code":{"type":"string","description":"A stable error code, such as `NotFound`, `ValidationFailed`, `Conflict` or `BusinessRuleViolation`. Present on every error; the Errors guide lists every value."},"traceId":{"type":"string","description":"The request's trace id. Quote it when you contact support about a failed call."},"requiredScope":{"type":"string","description":"The scope the token lacks, by its standard name. Present when `code` is `MissingScope` (403); ask your Henge contact to grant it to your credential."}},"additionalProperties":{},"description":"An error, in the RFC 9457 problem details shape. Branch on `code`, never on `title` or `detail`, which are for people and may change."}}},"paths":{"/loan-applications/{id}/documents/{documentId}/text":{"get":{"tags":["Documents"],"summary":"Retrieves a loan document's extracted text.","description":"**Required scope:** `read:loan-applications`\n\nThe text the document was indexed from, as markdown, with each page introduced by a\r\n<!-- rf:page N --> marker. fromPage and toPage select a page range; a long document is\r\ncut at whole pages and nextFromPage says where to continue. indexStatus says whether the\r\ndocument has been processed yet, and warnings carries any extraction warnings. Documents\r\nflagged internal are not found.","operationId":"LoanApplicationDocumentSearch_GetLoanApplicationDocumentText","parameters":[{"name":"id","in":"path","description":"The loan application's id (a GUID). Send the empty GUID `00000000-0000-0000-0000-000000000000` when you address the loan by `externalId` instead. A loan in another company answers 404, the same as one that does not exist.","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"documentId","in":"path","description":"The document's id, as listed by vault-documents.","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"fromPage","in":"query","description":"First page to return, 1-based.","schema":{"type":"integer","format":"int32"}},{"name":"toPage","in":"query","description":"Last page to return, inclusive.","schema":{"type":"integer","format":"int32"}},{"name":"externalId","in":"query","description":"The loan's id in the loan origination system (`loanInfo.loanId` on a loan read; not the loan number), to address the loan by instead of the path `id`: put the empty GUID in the path; when sent it is matched exactly and wins over the path `id`, and a value that matches no loan in your company answers 404.","schema":{"type":"string"}}],"responses":{"200":{"description":"Document text","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoanDocumentText"}}}},"400":{"description":"Invalid identifier or page range","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ValidationProblemDetails"}}}},"401":{"description":"Unauthorized","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The client application is not authorized to access this resource","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Loan application or document not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"An unexpected error occurred","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}}}}
```

## Searches the text of a loan application's documents.

> \*\*Required scope:\*\* \`read:loan-applications\`\
> \
> Hybrid keyword and vector search over every indexed document on the loan. Each hit carries a> \
> plain-text snippet (no markup) with its matched terms given as offsets, the page range it came> \
> from, the raw passage, and the document's current title, folder, type and task. With> \
> groupByDocument=true the response has one entry per document instead, with an approximate> \
> match count and its best passages. Documents flagged internal are never returned.

```json
{"openapi":"3.0.4","info":{"title":"Henge Partner API","version":"1.22.0"},"tags":[{"name":"Documents","description":"A loan's documents: the vault, a document's text and search over the documents' text, unsorted uploads, the condition a document is filed under and its status in the LOS.\n\n**E-sign packages:** E-sign packages on a loan: create a draft from the loan's documents, send it to the signers, and follow each package's status and each signer's progress. Sending goes out through the e-sign provider, so it has its own scope, granted on request.\n\n`GET /types/loan-document-types` lists the document types the other routes accept.\n\n**Scopes:** `create:loan-applications`, `delete:loan-applications`, `read:loan-applications`, `read:types`, `send:esign-packages`, `update:loan-applications`"}],"servers":[{"url":"https://uat-api.hengelending.com/partner","description":"UAT (sandbox): build and test here"},{"url":"https://api.hengelending.com/partner","description":"Production"}],"security":[{"Bearer":[]}],"components":{"securitySchemes":{"Bearer":{"type":"http","description":"Access token from POST /oauth/token, sent as `Authorization: Bearer <token>`.","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"LoanDocumentSearchResults":{"type":"object","properties":{"hits":{"type":"array","items":{"$ref":"#/components/schemas/LoanDocumentSearchHit"},"description":"Passages, best first. Empty when grouping.","nullable":true},"groups":{"type":"array","items":{"$ref":"#/components/schemas/LoanDocumentSearchGroup"},"description":"Documents, best first. Set only when grouping.","nullable":true},"groupedByDocument":{"type":"boolean","description":"True when the results are grouped one entry per document (in groups) rather than a flat list of passages (in hits)."},"totalCount":{"type":"integer","description":"The index's own match count, before visibility filtering. Null for a borrower, for whom it\r\nwould count the documents they cannot see.","format":"int64","nullable":true},"withheldHitCount":{"type":"integer","description":"Hits the index returned that were withheld: their document is deleted, on another loan,\r\ninternal, or not linked to a loan document at all. Always 0 for a borrower, for whom it\r\nwould count the documents they cannot see.","format":"int32"},"usedVectorSearch":{"type":"boolean","description":"True when the search also matched on meaning (vector search), not just on keywords."},"usedSemanticRanking":{"type":"boolean","description":"True when the results were re-ranked by semantic ranking."}},"additionalProperties":false},"LoanDocumentSearchHit":{"type":"object","properties":{"document":{"$ref":"#/components/schemas/LoanDocumentInfo"},"ingestedDocumentId":{"type":"string","description":"The ingested-document record the chunk belongs to.","nullable":true},"chunkIndex":{"type":"integer","description":"Position of this passage among the document's indexed passages, starting at 0.","format":"int32"},"pageStart":{"type":"integer","description":"The 1-based page the passage starts on. Open the PDF at #page=N with this number to land on it.","format":"int32","nullable":true},"pageEnd":{"type":"integer","description":"The last page the passage comes from (1-based); null when the document has no pages.","format":"int32","nullable":true},"snippet":{"type":"string","description":"Plain text with no markup. snippetHighlights marks the matched terms.","nullable":true},"snippetHighlights":{"type":"array","items":{"$ref":"#/components/schemas/SnippetHighlight"},"description":"Where the matched terms sit inside snippet, as character ranges.","nullable":true},"content":{"type":"string","description":"The chunk's raw extracted text, for AI callers. May carry HTML table markup.","nullable":true},"score":{"type":"number","description":"The search relevance score of the passage; higher is a better match. Only meaningful for comparing passages in one response.","format":"double","nullable":true},"rerankerScore":{"type":"number","description":"A second relevance score from semantic ranking, when it was applied; higher is better. Null when not applied.","format":"double","nullable":true}},"additionalProperties":false,"description":"A passage and the document it came from."},"LoanDocumentInfo":{"type":"object","properties":{"loanApplicationDocumentId":{"type":"string","description":"Id (GUID) of the loan document.","format":"uuid"},"loanApplicationId":{"type":"string","description":"Id (GUID) of the loan the document belongs to.","format":"uuid"},"title":{"type":"string","description":"The title the Documents page shows: the stored title, else task name and file name.","nullable":true},"fileName":{"type":"string","description":"The document's file name.","nullable":true},"folder":{"type":"string","description":"The document type's folder, e.g. INCOME. Null when the document has no type.","nullable":true},"documentType":{"type":"string","description":"Name of the loan document type; null when the document has no type.","nullable":true},"loanDocumentTypeId":{"type":"string","description":"Id of the loan document type; null when the document has no type.","format":"uuid","nullable":true},"taskName":{"type":"string","description":"The owning task's name, for a task, condition or asset document.","nullable":true},"loanApplicationTaskId":{"type":"string","description":"Id of the task or condition that owns the document; null for a document uploaded straight to the loan.","format":"uuid","nullable":true},"isVault":{"type":"boolean","description":"True when the document was uploaded straight to the loan rather than to a task or condition."},"isInternal":{"type":"boolean","description":"True for a staff-only document. Partner applications never receive these."},"isObsolete":{"type":"boolean","description":"True when the document is no longer active. It is still listed for reference."}},"additionalProperties":false,"description":"A loan document as it is now: title, file name, folder, type and task come from the loan record, not from the search index, because they can change after the document was indexed."},"SnippetHighlight":{"type":"object","properties":{"start":{"type":"integer","description":"Character offset in the snippet where the matched term starts, counting from 0.","format":"int32"},"length":{"type":"integer","description":"Length of the matched term in characters.","format":"int32"}},"additionalProperties":false,"description":"A matched term inside a snippet: a character offset and length."},"LoanDocumentSearchGroup":{"type":"object","properties":{"document":{"$ref":"#/components/schemas/LoanDocumentInfo"},"matchCount":{"type":"integer","description":"Matching chunks among the ones fetched. Approximate: grouping reads a bounded number of top\r\nchunks, so a document can have more matches than this.","format":"int32"},"matchCountIsApproximate":{"type":"boolean","description":"True when matchCount is a lower bound: grouping reads a bounded number of top passages, so a document can have more matches than counted."},"passages":{"type":"array","items":{"$ref":"#/components/schemas/LoanDocumentPassage"},"description":"The document's best matching passages, best first.","nullable":true}},"additionalProperties":false,"description":"One document's matches, when grouping."},"LoanDocumentPassage":{"type":"object","properties":{"ingestedDocumentId":{"type":"string","description":"The ingested-document record the chunk belongs to.","nullable":true},"chunkIndex":{"type":"integer","description":"Position of this passage among the document's indexed passages, starting at 0.","format":"int32"},"pageStart":{"type":"integer","description":"The 1-based page the passage starts on. Open the PDF at #page=N with this number to land on it.","format":"int32","nullable":true},"pageEnd":{"type":"integer","description":"The last page the passage comes from (1-based); null when the document has no pages.","format":"int32","nullable":true},"snippet":{"type":"string","description":"Plain text with no markup. snippetHighlights marks the matched terms.","nullable":true},"snippetHighlights":{"type":"array","items":{"$ref":"#/components/schemas/SnippetHighlight"},"description":"Where the matched terms sit inside snippet, as character ranges.","nullable":true},"content":{"type":"string","description":"The chunk's raw extracted text, for AI callers. May carry HTML table markup.","nullable":true},"score":{"type":"number","description":"The search relevance score of the passage; higher is a better match. Only meaningful for comparing passages in one response.","format":"double","nullable":true},"rerankerScore":{"type":"number","description":"A second relevance score from semantic ranking, when it was applied; higher is better. Null when not applied.","format":"double","nullable":true}},"additionalProperties":false,"description":"One matching passage."},"ValidationProblemDetails":{"required":["status","title","detail","instance","code","traceId"],"type":"object","properties":{"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}},"description":"The validation problems: each key is the name of the field that failed and its value lists the messages for that field. Present when `code` is `ValidationFailed`.","nullable":true},"type":{"type":"string","description":"A URI that identifies the kind of problem, or null when none is given.","nullable":true},"title":{"type":"string","description":"A short, human-readable summary of the problem; it does not change between occurrences of the same problem."},"status":{"type":"integer","description":"The HTTP status code of the response.","format":"int32"},"detail":{"type":"string","description":"A human-readable explanation of this occurrence of the problem."},"instance":{"type":"string","description":"A URI that identifies this occurrence of the problem, typically the request path."},"code":{"type":"string","description":"A stable error code, such as `NotFound`, `ValidationFailed`, `Conflict` or `BusinessRuleViolation`. Present on every error; the Errors guide lists every value."},"traceId":{"type":"string","description":"The request's trace id. Quote it when you contact support about a failed call."}},"additionalProperties":{},"description":"The error body of a 400: the problem details shape, plus `errors`, which lists the problems by field when the request failed validation (`code` `ValidationFailed`). Branch on `code`."},"ProblemDetails":{"required":["status","title","detail","instance","code","traceId"],"type":"object","properties":{"type":{"type":"string","description":"A URI that identifies the kind of problem, or null when none is given.","nullable":true},"title":{"type":"string","description":"A short, human-readable summary of the problem; it does not change between occurrences of the same problem."},"status":{"type":"integer","description":"The HTTP status code of the response.","format":"int32"},"detail":{"type":"string","description":"A human-readable explanation of this occurrence of the problem."},"instance":{"type":"string","description":"A URI that identifies this occurrence of the problem, typically the request path."},"code":{"type":"string","description":"A stable error code, such as `NotFound`, `ValidationFailed`, `Conflict` or `BusinessRuleViolation`. Present on every error; the Errors guide lists every value."},"traceId":{"type":"string","description":"The request's trace id. Quote it when you contact support about a failed call."},"requiredScope":{"type":"string","description":"The scope the token lacks, by its standard name. Present when `code` is `MissingScope` (403); ask your Henge contact to grant it to your credential."}},"additionalProperties":{},"description":"An error, in the RFC 9457 problem details shape. Branch on `code`, never on `title` or `detail`, which are for people and may change."}}},"paths":{"/loan-applications/{id}/documents/search":{"get":{"tags":["Documents"],"summary":"Searches the text of a loan application's documents.","description":"**Required scope:** `read:loan-applications`\n\nHybrid keyword and vector search over every indexed document on the loan. Each hit carries a\r\nplain-text snippet (no markup) with its matched terms given as offsets, the page range it came\r\nfrom, the raw passage, and the document's current title, folder, type and task. With\r\ngroupByDocument=true the response has one entry per document instead, with an approximate\r\nmatch count and its best passages. Documents flagged internal are never returned.","operationId":"LoanApplicationDocumentSearch_SearchLoanApplicationDocuments","parameters":[{"name":"id","in":"path","description":"The loan application's id (a GUID). Send the empty GUID `00000000-0000-0000-0000-000000000000` when you address the loan by `externalId` instead. A loan in another company answers 404, the same as one that does not exist.","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"q","in":"query","description":"What to search for.","required":true,"schema":{"type":"string"}},{"name":"top","in":"query","description":"Hits, or documents when grouping, to return. Defaults to 10, at most 50.","schema":{"type":"integer","format":"int32"}},{"name":"groupByDocument","in":"query","description":"One entry per document instead of a flat list of passages.","schema":{"type":"boolean","default":false}},{"name":"passagesPerDocument","in":"query","description":"Passages per document when grouping. Defaults to 3.","schema":{"type":"integer","format":"int32"}},{"name":"documentId","in":"query","description":"Optional narrowing to one of the loan's documents.","schema":{"type":"string","format":"uuid"}},{"name":"externalId","in":"query","description":"The loan's id in the loan origination system (`loanInfo.loanId` on a loan read; not the loan number), to address the loan by instead of the path `id`: put the empty GUID in the path; when sent it is matched exactly and wins over the path `id`, and a value that matches no loan in your company answers 404.","schema":{"type":"string"}}],"responses":{"200":{"description":"Search results","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoanDocumentSearchResults"}}}},"400":{"description":"Missing query or invalid identifier","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ValidationProblemDetails"}}}},"401":{"description":"Unauthorized","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The client application is not authorized to access this resource","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Loan application not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"An unexpected error occurred","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}}}}
```

## Uploads many documents to a loan with no task.

> \*\*Required scope:\*\* \`create:loan-applications\`\
> \
> Each file becomes a loan document with isUnsorted true: no task, no type, and not sent to the loan> \
> origination system until it is put on a task or given a type. It goes through the document analysis> \
> like any other upload. A file that fails (unsupported type, too large, empty) is rejected on its own> \
> with its reason and the rest still land. A password-protected PDF is stored and held with intakeStatus> \
> NeedsPassword until its password is sent to POST .../documents/{documentId}/password. Needs the same> \
> scope as a single vault upload.

```json
{"openapi":"3.0.4","info":{"title":"Henge Partner API","version":"1.22.0"},"tags":[{"name":"Documents","description":"A loan's documents: the vault, a document's text and search over the documents' text, unsorted uploads, the condition a document is filed under and its status in the LOS.\n\n**E-sign packages:** E-sign packages on a loan: create a draft from the loan's documents, send it to the signers, and follow each package's status and each signer's progress. Sending goes out through the e-sign provider, so it has its own scope, granted on request.\n\n`GET /types/loan-document-types` lists the document types the other routes accept.\n\n**Scopes:** `create:loan-applications`, `delete:loan-applications`, `read:loan-applications`, `read:types`, `send:esign-packages`, `update:loan-applications`"}],"servers":[{"url":"https://uat-api.hengelending.com/partner","description":"UAT (sandbox): build and test here"},{"url":"https://api.hengelending.com/partner","description":"Production"}],"security":[{"Bearer":[]}],"components":{"securitySchemes":{"Bearer":{"type":"http","description":"Access token from POST /oauth/token, sent as `Authorization: Bearer <token>`.","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"UploadUnsortedDocumentsResponse":{"type":"object","properties":{"documents":{"type":"array","items":{"$ref":"#/components/schemas/UnsortedDocumentResult"},"description":"One entry per file sent, in the order sent.","nullable":true}},"additionalProperties":false},"UnsortedDocumentResult":{"type":"object","properties":{"fileName":{"type":"string","description":"The name of the uploaded file this result is for.","nullable":true},"status":{"type":"string","description":"What happened to the file: Unsorted (stored as an unsorted loan document), NeedsPassword (stored, but held until the PDF's password is entered) or Rejected (not stored; reason says why).","nullable":true},"documentId":{"type":"string","description":"The new document's id; null for a rejected file.","format":"uuid","nullable":true},"reason":{"type":"string","description":"Why the file was rejected; null otherwise.","nullable":true}},"additionalProperties":false},"ValidationProblemDetails":{"required":["status","title","detail","instance","code","traceId"],"type":"object","properties":{"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}},"description":"The validation problems: each key is the name of the field that failed and its value lists the messages for that field. Present when `code` is `ValidationFailed`.","nullable":true},"type":{"type":"string","description":"A URI that identifies the kind of problem, or null when none is given.","nullable":true},"title":{"type":"string","description":"A short, human-readable summary of the problem; it does not change between occurrences of the same problem."},"status":{"type":"integer","description":"The HTTP status code of the response.","format":"int32"},"detail":{"type":"string","description":"A human-readable explanation of this occurrence of the problem."},"instance":{"type":"string","description":"A URI that identifies this occurrence of the problem, typically the request path."},"code":{"type":"string","description":"A stable error code, such as `NotFound`, `ValidationFailed`, `Conflict` or `BusinessRuleViolation`. Present on every error; the Errors guide lists every value."},"traceId":{"type":"string","description":"The request's trace id. Quote it when you contact support about a failed call."}},"additionalProperties":{},"description":"The error body of a 400: the problem details shape, plus `errors`, which lists the problems by field when the request failed validation (`code` `ValidationFailed`). Branch on `code`."},"ProblemDetails":{"required":["status","title","detail","instance","code","traceId"],"type":"object","properties":{"type":{"type":"string","description":"A URI that identifies the kind of problem, or null when none is given.","nullable":true},"title":{"type":"string","description":"A short, human-readable summary of the problem; it does not change between occurrences of the same problem."},"status":{"type":"integer","description":"The HTTP status code of the response.","format":"int32"},"detail":{"type":"string","description":"A human-readable explanation of this occurrence of the problem."},"instance":{"type":"string","description":"A URI that identifies this occurrence of the problem, typically the request path."},"code":{"type":"string","description":"A stable error code, such as `NotFound`, `ValidationFailed`, `Conflict` or `BusinessRuleViolation`. Present on every error; the Errors guide lists every value."},"traceId":{"type":"string","description":"The request's trace id. Quote it when you contact support about a failed call."},"requiredScope":{"type":"string","description":"The scope the token lacks, by its standard name. Present when `code` is `MissingScope` (403); ask your Henge contact to grant it to your credential."}},"additionalProperties":{},"description":"An error, in the RFC 9457 problem details shape. Branch on `code`, never on `title` or `detail`, which are for people and may change."}}},"paths":{"/loan-applications/{id}/documents/unsorted":{"post":{"tags":["Documents"],"summary":"Uploads many documents to a loan with no task.","description":"**Required scope:** `create:loan-applications`\n\nEach file becomes a loan document with isUnsorted true: no task, no type, and not sent to the loan\r\norigination system until it is put on a task or given a type. It goes through the document analysis\r\nlike any other upload. A file that fails (unsupported type, too large, empty) is rejected on its own\r\nwith its reason and the rest still land. A password-protected PDF is stored and held with intakeStatus\r\nNeedsPassword until its password is sent to POST .../documents/{documentId}/password. Needs the same\r\nscope as a single vault upload.","operationId":"LoanApplicationDocumentIntake_UploadUnsortedDocuments","parameters":[{"name":"id","in":"path","description":"Loan application id.","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"multipart/form-data":{"schema":{"required":["files"],"type":"object","properties":{"files":{"type":"array","items":{"type":"string","format":"binary"},"description":"The files, as repeated multipart parts named files."}}},"encoding":{"files":{"style":"form"}}}}},"responses":{"200":{"description":"One result per file, in the order sent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UploadUnsortedDocumentsResponse"}}}},"400":{"description":"No files, or too many","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ValidationProblemDetails"}}}},"401":{"description":"Missing, invalid or expired access token.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The client application is not authorized to perform this action","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Loan application not found, or document intake is off for the caller","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"An unexpected error occurred","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}}}}
```

## Retrieves all vault documents associated with a specific loan application.

> \*\*Required scope:\*\* \`read:loan-applications\`\
> \
> Returns documents uploaded straight to the loan as well as those attached to borrower tasks,> \
> user tasks, conditions and asset accounts, each with its document type when one has been set.> \
> Read isVault to tell them apart: only a vault document can be deleted.

```json
{"openapi":"3.0.4","info":{"title":"Henge Partner API","version":"1.22.0"},"tags":[{"name":"Documents","description":"A loan's documents: the vault, a document's text and search over the documents' text, unsorted uploads, the condition a document is filed under and its status in the LOS.\n\n**E-sign packages:** E-sign packages on a loan: create a draft from the loan's documents, send it to the signers, and follow each package's status and each signer's progress. Sending goes out through the e-sign provider, so it has its own scope, granted on request.\n\n`GET /types/loan-document-types` lists the document types the other routes accept.\n\n**Scopes:** `create:loan-applications`, `delete:loan-applications`, `read:loan-applications`, `read:types`, `send:esign-packages`, `update:loan-applications`"}],"servers":[{"url":"https://uat-api.hengelending.com/partner","description":"UAT (sandbox): build and test here"},{"url":"https://api.hengelending.com/partner","description":"Production"}],"security":[{"Bearer":[]}],"components":{"securitySchemes":{"Bearer":{"type":"http","description":"Access token from POST /oauth/token, sent as `Authorization: Bearer <token>`.","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"VaultDocumentResponse":{"type":"object","properties":{"id":{"type":"string","description":"Id (GUID) of the document.","format":"uuid"},"fileName":{"type":"string","description":"The document's file name.","nullable":true},"title":{"type":"string","description":"The title shown for the document; may be empty.","nullable":true},"description":{"type":"string","description":"A free-text description of the document; may be empty.","nullable":true},"isVault":{"type":"boolean","description":"True when the document was uploaded straight to the loan, false when it hangs off a task, a\r\ncondition or an asset account. Only a vault document can be deleted."},"loanApplicationTaskId":{"type":"string","description":"The task that owns the document, when one does. Null for a document uploaded straight to the\r\nloan.","format":"uuid","nullable":true},"documentType":{"$ref":"#/components/schemas/LoanDocumentTypeResponse"},"isObsolete":{"type":"boolean","description":"True when the document is no longer active. It remains listed for reference but should not\r\nbe treated as current."},"isProtected":{"type":"boolean","description":"True when the document is protected in the loan origination system, locked there against\r\nedits and deletion. Set with PUT .../documents/{documentId}/los-status."},"losStatus":{"$ref":"#/components/schemas/LoanDocumentLosStatus"},"indexStatus":{"type":"string","description":"Whether the document's text can be searched through documents/search: Indexed, Pending,\r\nFailed or NotSubmitted. Null when it could not be determined.","nullable":true},"isUnsorted":{"type":"boolean","description":"True while the document was sent to the loan in a bulk upload with no task and no type and has not\r\nbeen sorted. It is not sent to the loan origination system until it is put on a task or given a type."},"intakeStatus":{"type":"string","description":"NeedsPassword or Duplicate when a bulk-uploaded document is held for that reason; absent otherwise.","nullable":true},"duplicateOfDocumentId":{"type":"string","description":"The document this one repeats, when intakeStatus is Duplicate.","format":"uuid","nullable":true},"createdTimestamp":{"type":"string","description":"When the document was created, in UTC (ISO 8601).","format":"date-time"},"updatedTimestamp":{"type":"string","description":"When the document was last changed, in UTC (ISO 8601).","format":"date-time"}},"additionalProperties":false,"description":"A document on a loan application, wherever it came from."},"LoanDocumentTypeResponse":{"type":"object","properties":{"id":{"type":"string","description":"Id (GUID) of the document type; send it to file a document under this type.","format":"uuid"},"name":{"type":"string","description":"The document type's name.","nullable":true},"folderName":{"type":"string","description":"The folder this type belongs to.","nullable":true}},"additionalProperties":false,"description":"A document type a loan document can be filed under."},"LoanDocumentLosStatus":{"enum":["Active","Protected","Obsolete","Rejected","Screened"],"type":"string","description":"A loan document's status, one value per document, set here or in the LOS and kept in step both ways. The names are the LOS's own; the app shows Active as Pending, Screened as Accepted and Obsolete as Deleted."},"ValidationProblemDetails":{"required":["status","title","detail","instance","code","traceId"],"type":"object","properties":{"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}},"description":"The validation problems: each key is the name of the field that failed and its value lists the messages for that field. Present when `code` is `ValidationFailed`.","nullable":true},"type":{"type":"string","description":"A URI that identifies the kind of problem, or null when none is given.","nullable":true},"title":{"type":"string","description":"A short, human-readable summary of the problem; it does not change between occurrences of the same problem."},"status":{"type":"integer","description":"The HTTP status code of the response.","format":"int32"},"detail":{"type":"string","description":"A human-readable explanation of this occurrence of the problem."},"instance":{"type":"string","description":"A URI that identifies this occurrence of the problem, typically the request path."},"code":{"type":"string","description":"A stable error code, such as `NotFound`, `ValidationFailed`, `Conflict` or `BusinessRuleViolation`. Present on every error; the Errors guide lists every value."},"traceId":{"type":"string","description":"The request's trace id. Quote it when you contact support about a failed call."}},"additionalProperties":{},"description":"The error body of a 400: the problem details shape, plus `errors`, which lists the problems by field when the request failed validation (`code` `ValidationFailed`). Branch on `code`."},"ProblemDetails":{"required":["status","title","detail","instance","code","traceId"],"type":"object","properties":{"type":{"type":"string","description":"A URI that identifies the kind of problem, or null when none is given.","nullable":true},"title":{"type":"string","description":"A short, human-readable summary of the problem; it does not change between occurrences of the same problem."},"status":{"type":"integer","description":"The HTTP status code of the response.","format":"int32"},"detail":{"type":"string","description":"A human-readable explanation of this occurrence of the problem."},"instance":{"type":"string","description":"A URI that identifies this occurrence of the problem, typically the request path."},"code":{"type":"string","description":"A stable error code, such as `NotFound`, `ValidationFailed`, `Conflict` or `BusinessRuleViolation`. Present on every error; the Errors guide lists every value."},"traceId":{"type":"string","description":"The request's trace id. Quote it when you contact support about a failed call."},"requiredScope":{"type":"string","description":"The scope the token lacks, by its standard name. Present when `code` is `MissingScope` (403); ask your Henge contact to grant it to your credential."}},"additionalProperties":{},"description":"An error, in the RFC 9457 problem details shape. Branch on `code`, never on `title` or `detail`, which are for people and may change."}}},"paths":{"/loan-applications/{id}/vault-documents":{"get":{"tags":["Documents"],"summary":"Retrieves all vault documents associated with a specific loan application.","description":"**Required scope:** `read:loan-applications`\n\nReturns documents uploaded straight to the loan as well as those attached to borrower tasks,\r\nuser tasks, conditions and asset accounts, each with its document type when one has been set.\r\nRead isVault to tell them apart: only a vault document can be deleted.","operationId":"LoanApplications_GetLoanApplicationVaultDocuments","parameters":[{"name":"id","in":"path","description":"The unique identifier of the loan application.","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"folderName","in":"query","description":"Narrows the list to one document type folder, e.g. INCOME.","schema":{"type":"string"}}],"responses":{"200":{"description":"Loan application vault documents retrieved successfully","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/VaultDocumentResponse"}}}}},"400":{"description":"Invalid identifier","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ValidationProblemDetails"}}}},"401":{"description":"Missing, invalid or expired access token.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The client application is not authorized to access this resource","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Loan application not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"An unexpected error occurred","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}}}}
```

## Creates a new vault document for the specified loan application.

> \*\*Required scope:\*\* \`create:loan-applications\`

```json
{"openapi":"3.0.4","info":{"title":"Henge Partner API","version":"1.22.0"},"tags":[{"name":"Documents","description":"A loan's documents: the vault, a document's text and search over the documents' text, unsorted uploads, the condition a document is filed under and its status in the LOS.\n\n**E-sign packages:** E-sign packages on a loan: create a draft from the loan's documents, send it to the signers, and follow each package's status and each signer's progress. Sending goes out through the e-sign provider, so it has its own scope, granted on request.\n\n`GET /types/loan-document-types` lists the document types the other routes accept.\n\n**Scopes:** `create:loan-applications`, `delete:loan-applications`, `read:loan-applications`, `read:types`, `send:esign-packages`, `update:loan-applications`"}],"servers":[{"url":"https://uat-api.hengelending.com/partner","description":"UAT (sandbox): build and test here"},{"url":"https://api.hengelending.com/partner","description":"Production"}],"security":[{"Bearer":[]}],"components":{"securitySchemes":{"Bearer":{"type":"http","description":"Access token from POST /oauth/token, sent as `Authorization: Bearer <token>`.","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"Modified":{"required":["id"],"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the entity that was modified."},"type":{"type":"string","description":"A string indicating the type or category of the modified entity (e.g., “Webhook”, “LoanApplicationTask”).","nullable":true},"createdTimestamp":{"type":"string","description":"The timestamp when the entity was first created.","format":"date-time","nullable":true},"updatedTimestamp":{"type":"string","description":"The timestamp when the entity was last updated.","format":"date-time","nullable":true}},"additionalProperties":false,"description":"Represents an audit record for an entity that has been created or updated."},"ValidationProblemDetails":{"required":["status","title","detail","instance","code","traceId"],"type":"object","properties":{"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}},"description":"The validation problems: each key is the name of the field that failed and its value lists the messages for that field. Present when `code` is `ValidationFailed`.","nullable":true},"type":{"type":"string","description":"A URI that identifies the kind of problem, or null when none is given.","nullable":true},"title":{"type":"string","description":"A short, human-readable summary of the problem; it does not change between occurrences of the same problem."},"status":{"type":"integer","description":"The HTTP status code of the response.","format":"int32"},"detail":{"type":"string","description":"A human-readable explanation of this occurrence of the problem."},"instance":{"type":"string","description":"A URI that identifies this occurrence of the problem, typically the request path."},"code":{"type":"string","description":"A stable error code, such as `NotFound`, `ValidationFailed`, `Conflict` or `BusinessRuleViolation`. Present on every error; the Errors guide lists every value."},"traceId":{"type":"string","description":"The request's trace id. Quote it when you contact support about a failed call."}},"additionalProperties":{},"description":"The error body of a 400: the problem details shape, plus `errors`, which lists the problems by field when the request failed validation (`code` `ValidationFailed`). Branch on `code`."},"ProblemDetails":{"required":["status","title","detail","instance","code","traceId"],"type":"object","properties":{"type":{"type":"string","description":"A URI that identifies the kind of problem, or null when none is given.","nullable":true},"title":{"type":"string","description":"A short, human-readable summary of the problem; it does not change between occurrences of the same problem."},"status":{"type":"integer","description":"The HTTP status code of the response.","format":"int32"},"detail":{"type":"string","description":"A human-readable explanation of this occurrence of the problem."},"instance":{"type":"string","description":"A URI that identifies this occurrence of the problem, typically the request path."},"code":{"type":"string","description":"A stable error code, such as `NotFound`, `ValidationFailed`, `Conflict` or `BusinessRuleViolation`. Present on every error; the Errors guide lists every value."},"traceId":{"type":"string","description":"The request's trace id. Quote it when you contact support about a failed call."},"requiredScope":{"type":"string","description":"The scope the token lacks, by its standard name. Present when `code` is `MissingScope` (403); ask your Henge contact to grant it to your credential."}},"additionalProperties":{},"description":"An error, in the RFC 9457 problem details shape. Branch on `code`, never on `title` or `detail`, which are for people and may change."}}},"paths":{"/loan-applications/{id}/vault-documents":{"post":{"tags":["Documents"],"summary":"Creates a new vault document for the specified loan application.","description":"**Required scope:** `create:loan-applications`","operationId":"LoanApplications_CreateLoanApplicationVaultDocument","parameters":[{"name":"id","in":"path","description":"The unique identifier of the loan application.","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"multipart/form-data":{"schema":{"required":["Document"],"type":"object","properties":{"Document":{"type":"string","format":"binary"},"Title":{"type":"string","description":"The heading shown for the document, and the description it is filed under in the lender's loan\r\norigination system. Defaults to the file name without its extension when omitted."},"Description":{"type":"string"},"LoanDocumentTypeId":{"type":"string","description":"The document type to file this document under. Obtain it from GET /types/loan-document-types.","format":"uuid"}}},"encoding":{"Document":{"style":"form"},"Title":{"style":"form"},"Description":{"style":"form"},"LoanDocumentTypeId":{"style":"form"}}}}},"responses":{"200":{"description":"Loan application task created successfully A create answers 200 today. It will answer 201 with a Location header from a date announced in the changelog at least 60 days ahead.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Modified"}}}},"201":{"description":"Created. Will be answered instead of 200 from a date announced in the changelog at least 60 days ahead; the Location header carries the new resource's URL.","headers":{"Location":{"description":"URL of the created resource: this request's path followed by the new id.","schema":{"type":"string","format":"uri-reference"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Modified"}}}},"400":{"description":"Invalid identifier or request payload","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ValidationProblemDetails"}}}},"401":{"description":"Missing, invalid or expired access token.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The client application is not authorized to perform this action","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Loan application not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"An unexpected error occurred","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}}}}
```

## Retrieves a specific vault document associated with a loan application.

> \*\*Required scope:\*\* \`read:loan-applications\`

```json
{"openapi":"3.0.4","info":{"title":"Henge Partner API","version":"1.22.0"},"tags":[{"name":"Documents","description":"A loan's documents: the vault, a document's text and search over the documents' text, unsorted uploads, the condition a document is filed under and its status in the LOS.\n\n**E-sign packages:** E-sign packages on a loan: create a draft from the loan's documents, send it to the signers, and follow each package's status and each signer's progress. Sending goes out through the e-sign provider, so it has its own scope, granted on request.\n\n`GET /types/loan-document-types` lists the document types the other routes accept.\n\n**Scopes:** `create:loan-applications`, `delete:loan-applications`, `read:loan-applications`, `read:types`, `send:esign-packages`, `update:loan-applications`"}],"servers":[{"url":"https://uat-api.hengelending.com/partner","description":"UAT (sandbox): build and test here"},{"url":"https://api.hengelending.com/partner","description":"Production"}],"security":[{"Bearer":[]}],"components":{"securitySchemes":{"Bearer":{"type":"http","description":"Access token from POST /oauth/token, sent as `Authorization: Bearer <token>`.","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"ValidationProblemDetails":{"required":["status","title","detail","instance","code","traceId"],"type":"object","properties":{"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}},"description":"The validation problems: each key is the name of the field that failed and its value lists the messages for that field. Present when `code` is `ValidationFailed`.","nullable":true},"type":{"type":"string","description":"A URI that identifies the kind of problem, or null when none is given.","nullable":true},"title":{"type":"string","description":"A short, human-readable summary of the problem; it does not change between occurrences of the same problem."},"status":{"type":"integer","description":"The HTTP status code of the response.","format":"int32"},"detail":{"type":"string","description":"A human-readable explanation of this occurrence of the problem."},"instance":{"type":"string","description":"A URI that identifies this occurrence of the problem, typically the request path."},"code":{"type":"string","description":"A stable error code, such as `NotFound`, `ValidationFailed`, `Conflict` or `BusinessRuleViolation`. Present on every error; the Errors guide lists every value."},"traceId":{"type":"string","description":"The request's trace id. Quote it when you contact support about a failed call."}},"additionalProperties":{},"description":"The error body of a 400: the problem details shape, plus `errors`, which lists the problems by field when the request failed validation (`code` `ValidationFailed`). Branch on `code`."},"ProblemDetails":{"required":["status","title","detail","instance","code","traceId"],"type":"object","properties":{"type":{"type":"string","description":"A URI that identifies the kind of problem, or null when none is given.","nullable":true},"title":{"type":"string","description":"A short, human-readable summary of the problem; it does not change between occurrences of the same problem."},"status":{"type":"integer","description":"The HTTP status code of the response.","format":"int32"},"detail":{"type":"string","description":"A human-readable explanation of this occurrence of the problem."},"instance":{"type":"string","description":"A URI that identifies this occurrence of the problem, typically the request path."},"code":{"type":"string","description":"A stable error code, such as `NotFound`, `ValidationFailed`, `Conflict` or `BusinessRuleViolation`. Present on every error; the Errors guide lists every value."},"traceId":{"type":"string","description":"The request's trace id. Quote it when you contact support about a failed call."},"requiredScope":{"type":"string","description":"The scope the token lacks, by its standard name. Present when `code` is `MissingScope` (403); ask your Henge contact to grant it to your credential."}},"additionalProperties":{},"description":"An error, in the RFC 9457 problem details shape. Branch on `code`, never on `title` or `detail`, which are for people and may change."}}},"paths":{"/loan-applications/{id}/vault-documents/{documentId}":{"get":{"tags":["Documents"],"summary":"Retrieves a specific vault document associated with a loan application.","description":"**Required scope:** `read:loan-applications`","operationId":"LoanApplications_GetLoanApplicationVaultDocument","parameters":[{"name":"id","in":"path","description":"The unique identifier of the loan application.","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"documentId","in":"path","description":"The unique identifier of the document associated with the loan application.","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"The vault document's file, usually a PDF. The Content-Type header names its type and Content-Disposition its file name.","content":{"application/pdf":{"schema":{"type":"string","format":"binary"}},"*/*":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"Invalid identifier","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ValidationProblemDetails"}}}},"401":{"description":"Missing, invalid or expired access token.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The client application is not authorized to access this resource","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Loan application, task or document not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The document is held in the loan origination system and has no file here (code `DocumentHeldInLos`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"An unexpected error occurred","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}}}}
```

## Updates an existing vault document for the specified loan application.

> \*\*Required scope:\*\* \`update:loan-applications\`\
> \
> The title is assigned from the body as supplied, so send its current value with any update that> \
> is not meant to change it. The title is shown as the document's description in the lender's> \
> loan origination system; a blank title falls back to the file name. The description is set on> \
> upload and is not changed here.

```json
{"openapi":"3.0.4","info":{"title":"Henge Partner API","version":"1.22.0"},"tags":[{"name":"Documents","description":"A loan's documents: the vault, a document's text and search over the documents' text, unsorted uploads, the condition a document is filed under and its status in the LOS.\n\n**E-sign packages:** E-sign packages on a loan: create a draft from the loan's documents, send it to the signers, and follow each package's status and each signer's progress. Sending goes out through the e-sign provider, so it has its own scope, granted on request.\n\n`GET /types/loan-document-types` lists the document types the other routes accept.\n\n**Scopes:** `create:loan-applications`, `delete:loan-applications`, `read:loan-applications`, `read:types`, `send:esign-packages`, `update:loan-applications`"}],"servers":[{"url":"https://uat-api.hengelending.com/partner","description":"UAT (sandbox): build and test here"},{"url":"https://api.hengelending.com/partner","description":"Production"}],"security":[{"Bearer":[]}],"components":{"securitySchemes":{"Bearer":{"type":"http","description":"Access token from POST /oauth/token, sent as `Authorization: Bearer <token>`.","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"UpdateLoanApplicationVaultDocumentRequest":{"type":"object","properties":{"title":{"type":"string","description":"The heading shown for the document, and the description it is filed under in the lender's loan\r\norigination system. Null or blank falls back to the file name without its extension.","nullable":true},"loanDocumentTypeId":{"type":"string","description":"The document type to file this document under. Obtain it from GET /types/loan-document-types.","format":"uuid","nullable":true}},"additionalProperties":false},"Modified":{"required":["id"],"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the entity that was modified."},"type":{"type":"string","description":"A string indicating the type or category of the modified entity (e.g., “Webhook”, “LoanApplicationTask”).","nullable":true},"createdTimestamp":{"type":"string","description":"The timestamp when the entity was first created.","format":"date-time","nullable":true},"updatedTimestamp":{"type":"string","description":"The timestamp when the entity was last updated.","format":"date-time","nullable":true}},"additionalProperties":false,"description":"Represents an audit record for an entity that has been created or updated."},"ValidationProblemDetails":{"required":["status","title","detail","instance","code","traceId"],"type":"object","properties":{"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}},"description":"The validation problems: each key is the name of the field that failed and its value lists the messages for that field. Present when `code` is `ValidationFailed`.","nullable":true},"type":{"type":"string","description":"A URI that identifies the kind of problem, or null when none is given.","nullable":true},"title":{"type":"string","description":"A short, human-readable summary of the problem; it does not change between occurrences of the same problem."},"status":{"type":"integer","description":"The HTTP status code of the response.","format":"int32"},"detail":{"type":"string","description":"A human-readable explanation of this occurrence of the problem."},"instance":{"type":"string","description":"A URI that identifies this occurrence of the problem, typically the request path."},"code":{"type":"string","description":"A stable error code, such as `NotFound`, `ValidationFailed`, `Conflict` or `BusinessRuleViolation`. Present on every error; the Errors guide lists every value."},"traceId":{"type":"string","description":"The request's trace id. Quote it when you contact support about a failed call."}},"additionalProperties":{},"description":"The error body of a 400: the problem details shape, plus `errors`, which lists the problems by field when the request failed validation (`code` `ValidationFailed`). Branch on `code`."},"ProblemDetails":{"required":["status","title","detail","instance","code","traceId"],"type":"object","properties":{"type":{"type":"string","description":"A URI that identifies the kind of problem, or null when none is given.","nullable":true},"title":{"type":"string","description":"A short, human-readable summary of the problem; it does not change between occurrences of the same problem."},"status":{"type":"integer","description":"The HTTP status code of the response.","format":"int32"},"detail":{"type":"string","description":"A human-readable explanation of this occurrence of the problem."},"instance":{"type":"string","description":"A URI that identifies this occurrence of the problem, typically the request path."},"code":{"type":"string","description":"A stable error code, such as `NotFound`, `ValidationFailed`, `Conflict` or `BusinessRuleViolation`. Present on every error; the Errors guide lists every value."},"traceId":{"type":"string","description":"The request's trace id. Quote it when you contact support about a failed call."},"requiredScope":{"type":"string","description":"The scope the token lacks, by its standard name. Present when `code` is `MissingScope` (403); ask your Henge contact to grant it to your credential."}},"additionalProperties":{},"description":"An error, in the RFC 9457 problem details shape. Branch on `code`, never on `title` or `detail`, which are for people and may change."}}},"paths":{"/loan-applications/{id}/vault-documents/{documentId}":{"put":{"tags":["Documents"],"summary":"Updates an existing vault document for the specified loan application.","description":"**Required scope:** `update:loan-applications`\n\nThe title is assigned from the body as supplied, so send its current value with any update that\r\nis not meant to change it. The title is shown as the document's description in the lender's\r\nloan origination system; a blank title falls back to the file name. The description is set on\r\nupload and is not changed here.","operationId":"LoanApplications_UpdateLoanApplicationVaultDocument","parameters":[{"name":"id","in":"path","description":"The unique identifier of the loan application.","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"documentId","in":"path","description":"The unique identifier of the vault document to be updated.","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"description":"The request payload containing details of the vault document to be created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateLoanApplicationVaultDocumentRequest"}}}},"responses":{"200":{"description":"Loan application task created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Modified"}}}},"400":{"description":"Invalid identifier or request payload","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ValidationProblemDetails"}}}},"401":{"description":"Missing, invalid or expired access token.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The client application is not authorized to perform this action","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Loan application or vault document not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"The document's state refuses the change (code `Conflict`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The loan refuses the change (code `BusinessRuleViolation`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"An unexpected error occurred","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}}}}
```

## Deletes a specific vault document associated with a loan application.

> \*\*Required scope:\*\* \`delete:loan-applications\`

```json
{"openapi":"3.0.4","info":{"title":"Henge Partner API","version":"1.22.0"},"tags":[{"name":"Documents","description":"A loan's documents: the vault, a document's text and search over the documents' text, unsorted uploads, the condition a document is filed under and its status in the LOS.\n\n**E-sign packages:** E-sign packages on a loan: create a draft from the loan's documents, send it to the signers, and follow each package's status and each signer's progress. Sending goes out through the e-sign provider, so it has its own scope, granted on request.\n\n`GET /types/loan-document-types` lists the document types the other routes accept.\n\n**Scopes:** `create:loan-applications`, `delete:loan-applications`, `read:loan-applications`, `read:types`, `send:esign-packages`, `update:loan-applications`"}],"servers":[{"url":"https://uat-api.hengelending.com/partner","description":"UAT (sandbox): build and test here"},{"url":"https://api.hengelending.com/partner","description":"Production"}],"security":[{"Bearer":[]}],"components":{"securitySchemes":{"Bearer":{"type":"http","description":"Access token from POST /oauth/token, sent as `Authorization: Bearer <token>`.","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"ValidationProblemDetails":{"required":["status","title","detail","instance","code","traceId"],"type":"object","properties":{"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}},"description":"The validation problems: each key is the name of the field that failed and its value lists the messages for that field. Present when `code` is `ValidationFailed`.","nullable":true},"type":{"type":"string","description":"A URI that identifies the kind of problem, or null when none is given.","nullable":true},"title":{"type":"string","description":"A short, human-readable summary of the problem; it does not change between occurrences of the same problem."},"status":{"type":"integer","description":"The HTTP status code of the response.","format":"int32"},"detail":{"type":"string","description":"A human-readable explanation of this occurrence of the problem."},"instance":{"type":"string","description":"A URI that identifies this occurrence of the problem, typically the request path."},"code":{"type":"string","description":"A stable error code, such as `NotFound`, `ValidationFailed`, `Conflict` or `BusinessRuleViolation`. Present on every error; the Errors guide lists every value."},"traceId":{"type":"string","description":"The request's trace id. Quote it when you contact support about a failed call."}},"additionalProperties":{},"description":"The error body of a 400: the problem details shape, plus `errors`, which lists the problems by field when the request failed validation (`code` `ValidationFailed`). Branch on `code`."},"ProblemDetails":{"required":["status","title","detail","instance","code","traceId"],"type":"object","properties":{"type":{"type":"string","description":"A URI that identifies the kind of problem, or null when none is given.","nullable":true},"title":{"type":"string","description":"A short, human-readable summary of the problem; it does not change between occurrences of the same problem."},"status":{"type":"integer","description":"The HTTP status code of the response.","format":"int32"},"detail":{"type":"string","description":"A human-readable explanation of this occurrence of the problem."},"instance":{"type":"string","description":"A URI that identifies this occurrence of the problem, typically the request path."},"code":{"type":"string","description":"A stable error code, such as `NotFound`, `ValidationFailed`, `Conflict` or `BusinessRuleViolation`. Present on every error; the Errors guide lists every value."},"traceId":{"type":"string","description":"The request's trace id. Quote it when you contact support about a failed call."},"requiredScope":{"type":"string","description":"The scope the token lacks, by its standard name. Present when `code` is `MissingScope` (403); ask your Henge contact to grant it to your credential."}},"additionalProperties":{},"description":"An error, in the RFC 9457 problem details shape. Branch on `code`, never on `title` or `detail`, which are for people and may change."}}},"paths":{"/loan-applications/{id}/vault-documents/{documentId}":{"delete":{"tags":["Documents"],"summary":"Deletes a specific vault document associated with a loan application.","description":"**Required scope:** `delete:loan-applications`","operationId":"LoanApplications_DeleteLoanApplicationVaultDocument","parameters":[{"name":"id","in":"path","description":"The unique identifier of the loan application.","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"documentId","in":"path","description":"The unique identifier of the vault document to be deleted.","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"204":{"description":"Loan application vault document deleted successfully"},"400":{"description":"Invalid identifier","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ValidationProblemDetails"}}}},"401":{"description":"Missing, invalid or expired access token.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The client application is not authorized to perform this action","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Loan application or vault document not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"An unexpected error occurred","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}}}}
```

## Loan Document Types

> \*\*Required scope:\*\* \`read:types\`\
> \
> Every document type a loan document can be filed under, grouped by folder.

```json
{"openapi":"3.0.4","info":{"title":"Henge Partner API","version":"1.22.0"},"tags":[{"name":"Documents","description":"A loan's documents: the vault, a document's text and search over the documents' text, unsorted uploads, the condition a document is filed under and its status in the LOS.\n\n**E-sign packages:** E-sign packages on a loan: create a draft from the loan's documents, send it to the signers, and follow each package's status and each signer's progress. Sending goes out through the e-sign provider, so it has its own scope, granted on request.\n\n`GET /types/loan-document-types` lists the document types the other routes accept.\n\n**Scopes:** `create:loan-applications`, `delete:loan-applications`, `read:loan-applications`, `read:types`, `send:esign-packages`, `update:loan-applications`"}],"servers":[{"url":"https://uat-api.hengelending.com/partner","description":"UAT (sandbox): build and test here"},{"url":"https://api.hengelending.com/partner","description":"Production"}],"security":[{"Bearer":[]}],"components":{"securitySchemes":{"Bearer":{"type":"http","description":"Access token from POST /oauth/token, sent as `Authorization: Bearer <token>`.","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"LoanDocumentTypeFolderResponse":{"type":"object","properties":{"folderName":{"type":"string","description":"Name of the folder.","nullable":true},"documentTypes":{"type":"array","items":{"$ref":"#/components/schemas/LoanDocumentTypeResponse"},"description":"The document types in the folder.","nullable":true}},"additionalProperties":false,"description":"One folder of loan document types."},"LoanDocumentTypeResponse":{"type":"object","properties":{"id":{"type":"string","description":"Id (GUID) of the document type; send it to file a document under this type.","format":"uuid"},"name":{"type":"string","description":"The document type's name.","nullable":true},"folderName":{"type":"string","description":"The folder this type belongs to.","nullable":true}},"additionalProperties":false,"description":"A document type a loan document can be filed under."},"ProblemDetails":{"required":["status","title","detail","instance","code","traceId"],"type":"object","properties":{"type":{"type":"string","description":"A URI that identifies the kind of problem, or null when none is given.","nullable":true},"title":{"type":"string","description":"A short, human-readable summary of the problem; it does not change between occurrences of the same problem."},"status":{"type":"integer","description":"The HTTP status code of the response.","format":"int32"},"detail":{"type":"string","description":"A human-readable explanation of this occurrence of the problem."},"instance":{"type":"string","description":"A URI that identifies this occurrence of the problem, typically the request path."},"code":{"type":"string","description":"A stable error code, such as `NotFound`, `ValidationFailed`, `Conflict` or `BusinessRuleViolation`. Present on every error; the Errors guide lists every value."},"traceId":{"type":"string","description":"The request's trace id. Quote it when you contact support about a failed call."},"requiredScope":{"type":"string","description":"The scope the token lacks, by its standard name. Present when `code` is `MissingScope` (403); ask your Henge contact to grant it to your credential."}},"additionalProperties":{},"description":"An error, in the RFC 9457 problem details shape. Branch on `code`, never on `title` or `detail`, which are for people and may change."}}},"paths":{"/types/loan-document-types":{"get":{"tags":["Documents"],"summary":"Loan Document Types","description":"**Required scope:** `read:types`\n\nEvery document type a loan document can be filed under, grouped by folder.","operationId":"Types_GetLoanDocumentTypes","responses":{"200":{"description":"Loan document types retrieved successfully","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/LoanDocumentTypeFolderResponse"}}}}},"401":{"description":"Missing, invalid or expired access token.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The client application is not authorized to access this resource","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Internal Server Error","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}}}}
```


---

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