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

# Identifiers

A loan has three identifiers. Mixing them up is the most common cause of a `404`.

| Name         | Where you see it                                                               | What it is                                                                                                                                                               |
| ------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `id`         | The response of `POST /loan-applications`, every loan read, webhook `entityId` | Henge's loan application id, a GUID. It exists from the moment the loan is created.                                                                                      |
| `externalId` | `loanInfo.loanId` on a loan read                                               | The loan's id in the loan origination system (LOS). It is set when the loan is submitted, so a loan that has not been submitted has none. It is **not** the loan number. |
| Loan number  | `loanInfo.loanNumber` on a loan read                                           | The number the LOS gives the loan, for example the one staff quote on the phone. Also set at submit.                                                                     |

Use `id` unless you only have one of the others.

## Calling a route with the LOS loan id

Routes that take a loan accept `externalId` as a query parameter. Put the empty GUID in the path and pass the LOS loan id:

```http
GET /loan-applications/00000000-0000-0000-0000-000000000000?externalId=<LOS loan id>
```

If you send both, `externalId` wins and the id in the path is ignored. A loan in another company, or an `externalId` that matches nothing, is a `404`.

Sending the loan number as `externalId` does not work. It is a different value and returns `404`.

## Finding a loan from its loan number

There is no lookup by loan number. Search for it and read `id` from the result:

```http
GET /loan-applications?searchText=<loan number>
```

A loan number matches exactly. The search also matches borrower names and emails and the property street, so check that the loan number on the result is the one you asked for. The search covers your company's loans only, and a loan that has not been submitted has no loan number to find.

## Webhooks

A webhook carries Henge ids only. `entityId` is the id of the thing that changed: the loan application, the task or the vault document, depending on `objectType`. It is never the LOS loan id or the loan number. See [Loan lifecycle](https://api-docs.hengelending.com/api/guides/loan-lifecycle.md#webhooks) for the events.


---

# 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/guides/identifiers.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.
