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

# API credentials

Every call to the Partner API needs an access token, and every token comes from a **client id** and **client secret**. A company admin creates these credentials in Henge. You don't need to ask your account executive or support.

## Who can manage credentials

A **company admin** manages their own company's credentials. A user without the company admin role does not see the section; ask your company admin, or ask support to give you the role.

## Create a credential

1. Sign in to Henge in the environment you will call. Use UAT while you build and production when you go live. UAT credentials do not work in production. See [Environments](https://api-docs.hengelending.com/environments).
2. Open the menu at the top right and choose **Company Profile**.
3. In **API credentials**, choose **Create credential**.
4. Give it a name your team will recognize, such as "LOS sync (production)".
5. Choose an **acting user**: the active user of your company that the integration's calls act as. Loans you create through the API are this user's, and reads follow what this user can see. Pick the loan officer, or the processor or company admin, whose work the integration does. A credential with no acting user is refused on the endpoints that act as a user, but not yet with one status: most writes answer `400` saying the change cannot be attributed, some endpoints answer `401` or `403`, and creating a loan (`POST /loan-applications`) answers `500` with the code `LoanCreateRefused` and `No valid user selected`. Set the acting user before you go live.
6. Copy the **client secret** and store it in your secrets manager. **It is shown once.** Henge does not keep it and cannot show it again. If you lose it, rotate the credential.

Then exchange the credentials for a token, as the [Quickstart](https://api-docs.hengelending.com/api/quickstart) shows:

```http
POST /oauth/token
Content-Type: application/json

{ "client_id": "<your client id>", "client_secret": "<your client secret>" }
```

The token is scoped to your company: it reads and writes your company's loans only.

## What a new credential can call

A new credential can call every endpoint except the ones that cost money or reach someone outside your company on your behalf. Those need an action scope:

| Scope                       | What it allows                                                                                                                                                         |
| --------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `order:credit-reports`      | Order or reissue a credit report on a loan.                                                                                                                            |
| `order:voe-voi`             | Order an income and employment verification on a loan.                                                                                                                 |
| `send:esign-packages`       | Create an e-sign package and send it to the borrowers for signature. Each package spends an e-sign credit.                                                             |
| `run:aus`                   | Submit a loan to the agency's automated underwriting system, check a run, and read the loan's AUS runs and findings.                                                   |
| `submit:broker-requests`    | Read and submit change-of-circumstance, exception and locked-rate-row requests. A submission goes to the lender's underwriting team and cannot be edited or withdrawn. |
| `submit:appraisal-requests` | Request an appraisal on a loan. The request emails the lender's processing team.                                                                                       |

A call to one of these endpoints returns `403` until the scope is added. To add one, ask support and name the credential's client id and the scopes you need. Each endpoint's reference page names the scope it needs, and [Scopes](https://api-docs.hengelending.com/api/guides/scopes.md) lists every scope.

## Rotate a secret

Choose **Rotate** on the credential. You get a new client secret, shown once, and **the old secret stops working at once**: your integration's next token request with the old secret fails.

To rotate without downtime, use a second credential instead. A company can hold two active credentials:

1. Create a second credential with the same acting user and ask support to add the same scopes, if the first one has extra scopes.
2. Switch your integration to the new client id and secret.
3. Once nothing uses the old one, revoke it.

## Revoke a credential

Choose **Revoke** on the credential. Token requests with it fail from then on. Tokens it already received stay valid until they expire, which is the `expires_in` of the token response. Revoking cannot be undone: create a new credential if you need one again.

Revoke a credential as soon as its secret may have leaked, then create a new one.

## Limits

* Two active credentials per company. A third create is refused until you revoke one.
* A name can be up to 200 characters.
* The acting user must be an active user of your company. If that user is later disabled, create a new credential with another acting user and revoke the old one.

## Credentials made before self-serve

If Henge set up your integration by hand before this page existed, your credentials keep working. They may not appear in the list yet. Ask support if you want them listed so you can rotate them yourself.


---

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