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

# Users and companies

Users, their licenses and profiles, and companies.

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

## add\_company\_license

Add a state license to a Henge company. One license per state: a second license for the same state is a "Conflict"; update the existing one instead. Needs state, licenseNumber and expirationDate; licenseType and issueDate are optional and isActive defaults to true. Admin can license any company; a CompanyAdmin only their own and is refused for any other. Read a company's licenses with get\_company\_profile.

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

**Reads or writes:** writes

| Input            | Type          | Description                                                                                                                          |
| ---------------- | ------------- | ------------------------------------------------------------------------------------------------------------------------------------ |
| `companyId`      | string (uuid) | Henge company id (GUID).                                                                                                             |
| `state`          | string        | U.S. state, as a 2-letter code ("CA") or full name. One license per state per owner.                                                 |
| `licenseNumber`  | string        | The state license number (up to 64 characters).                                                                                      |
| `licenseType`    | string        | License type, if the state has one (e.g. "MLO", "Mortgage Lender"; up to 50 characters).                                             |
| `issueDate`      | string (date) | Issue date, yyyy-MM-dd.                                                                                                              |
| `expirationDate` | string (date) | Expiration date, yyyy-MM-dd. Required. Its year is also stored as the license's expiration year, which the web app and pricing read. |
| `isActive`       | boolean       | Whether the license is active. Default true. An inactive license is kept on record but is not used for pricing.                      |

## add\_user\_license

Add a state license to a Henge user (a loan officer). One license per state: a second license for the same state is a "Conflict"; update the existing one instead. Needs state, licenseNumber and expirationDate; licenseType and issueDate are optional and isActive defaults to true. Admin can license any user; a CompanyAdmin only users in their own company and is refused for anyone else. Get the user id from search\_users and read licenses back with get\_user\_licenses (includeInactive true).

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

**Reads or writes:** writes

| Input            | Type          | Description                                                                                                                          |
| ---------------- | ------------- | ------------------------------------------------------------------------------------------------------------------------------------ |
| `userId`         | string (uuid) | Henge user id (GUID), from search\_users.                                                                                            |
| `state`          | string        | U.S. state, as a 2-letter code ("CA") or full name. One license per state per owner.                                                 |
| `licenseNumber`  | string        | The state license number (up to 64 characters).                                                                                      |
| `licenseType`    | string        | License type, if the state has one (e.g. "MLO", "Mortgage Lender"; up to 50 characters).                                             |
| `issueDate`      | string (date) | Issue date, yyyy-MM-dd.                                                                                                              |
| `expirationDate` | string (date) | Expiration date, yyyy-MM-dd. Required. Its year is also stored as the license's expiration year, which the web app and pricing read. |
| `isActive`       | boolean       | Whether the license is active. Default true. An inactive license is kept on record but is not used for pricing.                      |

## create\_user

Create a Henge user in a company, with given roles and optionally a username/password login so a broker can sign in at <https://app.hengelending.com/tpo>. The user is placed in the given organization, else the company's default organization. With a login an Auth0 user is created and the user is emailed a one-time set-password link; no password is ever returned or emailed. If an Auth0 user with that email already exists it is linked and nothing is created or sent. Whether a login is created: an explicit createLogin (true or false) wins; when it is omitted the company decides, by its createLoginByDefault override if set, else true for a TPO company and false for any other type (read both on get\_company\_profile, set it with update\_company). In UAT an explicit createLogin true is refused unless isTestUser is true, while a login that comes only from the company default is skipped for a non-test user: the user is still created and the result says no login was created (loginSkippedInUat). Admin, or a CompanyAdmin for their own company only (company-roles flag): a CompanyAdmin can only give the Agent role. Get companyId from report\_companies, organizationId from list\_company\_organizations and the role codes from list\_user\_roles. Read the result: login says Created, Linked or None (loginDecidedBy says whether the call, the company override or the company type decided), and welcomeEmailSent false on a Created login means the user exists but was NOT notified.

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

**Reads or writes:** writes

| Input            | Type            | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| ---------------- | --------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `companyId`      | string (uuid)   | Henge company id (GUID) the user is created in. Get it from report\_companies.                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| `organizationId` | string (uuid)   | Organization id (GUID) within that company. Get it from list\_company\_organizations. Omit to use the company's default organization.                                                                                                                                                                                                                                                                                                                                                                          |
| `email`          | string          | The user's email. Must not already belong to a Henge user. Also the username when a login is created.                                                                                                                                                                                                                                                                                                                                                                                                          |
| `firstName`      | string          | First name.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| `lastName`       | string          | Last name.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| `jobTitle`       | string          | Optional job title.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| `roles`          | array of string | Role codes from list\_user\_roles, e.g. Agent, DualLicensedAgent, ConciergeKey, Processor, CompanyAdmin. An unknown code is refused by name. DualLicensedAgent and ConciergeKey already grant the Agent surface, so Agent is not stored beside them.                                                                                                                                                                                                                                                           |
| `createLogin`    | boolean         | True to create a username/password login (Auth0) so the user can sign in at <https://app.hengelending.com/tpo>: the user is emailed a one-time set-password link. If an Auth0 user with that email already exists it is linked instead and nothing is sent. False creates no login. Omit to use the company's setting: its createLoginByDefault override if set, else true for a TPO company and false for any other type (see get\_company\_profile). An explicit true or false always wins over the company. |
| `isTestUser`     | boolean         | Marks the user as a test user. Required to create a login in UAT; not needed otherwise. In UAT a login that comes only from the company default is skipped for a user who is not a test user.                                                                                                                                                                                                                                                                                                                  |

## get\_company\_profile

Return one Henge lending company's public-facing and compliance details: legal name, street address, phone, website, company NMLS id, state licenses, its sender email (senderEmail: the address its borrower emails are sent from; null means Henge's default address under the company's name), and its branding (logo, brand colors, every branding asset, and disclosure links). Use it with get\_user\_profile to assemble compliance material such as a loan-officer flier: get\_user\_profile supplies the officer's name, NMLS id and contact details, this supplies the company's. Defaults to the calling user's own company; only Admin may request another company. A Processor's loan and user access is org-wide and a ConciergeKey's managed agents are not company-bounded, so either may legitimately be working a loan whose lending company is not their own and will get "Unauthorized" when requesting that company's profile. IMPORTANT: check branding.isTenantBranding — when false the company has no branding of its own and the colors and assets returned are the Henge default, which must not be presented as that company's brand.

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

**Reads or writes:** reads only

| Input             | Type          | Description                                                                                                                                                                          |
| ----------------- | ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `companyId`       | string (uuid) | Henge company id (GUID), as returned in companyId by get\_user\_profile or get\_current\_user. Omit to return the calling user's own company.                                        |
| `includeBranding` | boolean       | Include the branding block (logo, brand colors, assets, disclosures). Default true. Pass false to skip the blob-storage read when only the company's address and NMLS id are needed. |

## get\_current\_user

Return the identity of the signed-in caller: Henge userId, name, email, roles, and whether the connection came through Auth0 directly or the Henge AI chat backend. Call this first in every session: every other tool is scoped to this user, and its userId is what you pass to search\_pricing, get\_user\_licenses, get\_user\_profile and query\_loans filters. Roles: Admin (Henge staff, sees everything), Processor (all loans and all users, org-wide across every company), Agent / DualLicensedAgent (loan officer: own and referred loans), ConciergeKey (partner/team-lead who owns loan officers via their ckUserId and sees everything of those managed agents), CompanyProcessor (a processor confined to their own company: every loan and every user of that company), CompanyAdmin (can open any loan of their own company and manage its licenses, but does not widen searches or reports). A user may hold several roles; read them together.

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

**Reads or writes:** reads only

Takes no inputs.

## get\_user\_licenses

Return the U.S. states a Henge user is currently licensed in (active, unexpired licenses only unless includeInactive is true, which also returns expired and inactive licenses with their ids and dates). Useful to confirm a loan officer can be priced under for a given property state before calling search\_pricing. Defaults to the calling user when userId is omitted; only users within your access scope can be queried.

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

**Reads or writes:** reads only

| Input             | Type          | Description                                                                                                                                                                                         |
| ----------------- | ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `userId`          | string (uuid) | Henge user ID (GUID) whose state licenses to return. Obtain it from search\_users, or from a loan application's loan officer via get\_loan\_application. Defaults to the calling user when omitted. |
| `includeInactive` | boolean       | Set true to also return expired and inactive licenses, each with its id, type, issue and expiration dates, isActive and isExpired. Default false: only active, unexpired licenses, as before.       |

## get\_user\_profile

Return full metadata for one Henge user: identity, contact details (phone, mailing address, headshot), roles, company/organization, ConciergeKey owner (ckUserId/ckUserName), NMLS id, state licenses, enabled/test flags, created and enrollment dates, last sign-in timestamp, and Optimal Blue pricing configuration (obChannelIndex = OB Channel ID, obOriginatorIndex = OB User Index, hasOwnObAccount). Defaults to the calling user when userId is omitted; only users within your access scope can be queried. Last sign-in is coarse (recorded at most once per 5 hours); no login history is available. addressSource says whether the address returned is the user's own or the company's, substituted because the user has none. For the company's own name, address, NMLS id and branding, call get\_company\_profile with the companyId returned here.

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

**Reads or writes:** reads only

| Input    | Type          | Description                                                          |
| -------- | ------------- | -------------------------------------------------------------------- |
| `userId` | string (uuid) | Henge user id (GUID). Omit to return the calling user's own profile. |

## list\_company\_organizations

List a company's organizations with the id create\_user takes as organizationId; isDefault marks the one used when none is given. An unknown company is a "Not found". Admin, or a CompanyAdmin (company-roles flag) for their own company only.

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

**Reads or writes:** reads only

| Input       | Type          | Description                                             |
| ----------- | ------------- | ------------------------------------------------------- |
| `companyId` | string (uuid) | Henge company id (GUID). Get it from report\_companies. |

## list\_user\_roles

List the role codes create\_user accepts in roles and report\_users accepts as role, each with a short description. Admin, or a CompanyAdmin (company-roles flag), who is listed only the role they may give.

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

**Reads or writes:** reads only

Takes no inputs.

## remove\_company\_license

Remove a state license from a Henge company, found by companyId and state. The license row is deleted, not just deactivated; to keep it on record, call update\_company\_license with isActive false instead. Admin can remove any company's license; a CompanyAdmin only their own company's.

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

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

| Input       | Type          | Description                                                          |
| ----------- | ------------- | -------------------------------------------------------------------- |
| `companyId` | string (uuid) | Henge company id (GUID).                                             |
| `state`     | string        | The state of the license to remove, as a 2-letter code or full name. |

## remove\_user\_license

Remove a state license from a Henge user, found by userId and state. The license row is deleted, not just deactivated; to keep it on record, call update\_user\_license with isActive false instead. Admin can remove any user's license; a CompanyAdmin only for users in their own company.

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

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

| Input    | Type          | Description                                                          |
| -------- | ------------- | -------------------------------------------------------------------- |
| `userId` | string (uuid) | Henge user id (GUID), from search\_users.                            |
| `state`  | string        | The state of the license to remove, as a 2-letter code or full name. |

## report\_companies

List every Henge lending company (tenant) with its code, name, company type and business type (ids and names), disabled flag, created date, and counts of its active (not disabled) users and of the clients those users own (not deleted or archived). Use it for company growth (net new companies per month from createdTimestamp) and for user and client mix by company; for per-month user or client growth by company use report\_users and report\_clients. Admin and Processor only. Users and clients belonging to test users are left out of the counts unless you are a test user.

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

**Reads or writes:** reads only

| Input             | Type    | Description                                                                                        |
| ----------------- | ------- | -------------------------------------------------------------------------------------------------- |
| `includeDisabled` | boolean | Also list disabled companies. Default true, so growth over time counts every company ever created. |

## report\_users

Paged report of every Henge user within your access scope with full metadata per user (see get\_user\_profile), for user-configuration and activity reporting. Filter by companyId, ckUserId (ConciergeKey owner), role, isDisabled, hasOwnObAccount (own Optimal Blue channel/originator vs company default), and last sign-in window (lastLoginAfter / lastLoginBefore, with includeNeverLoggedIn to also return users with no recorded sign-in). Results are ordered by last name then first name; page through with page/pageSize (max 200). Admin and Processor both see all users across every company. Last sign-in is coarse (recorded at most once per 5 hours).

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

**Reads or writes:** reads only

| Input                  | Type               | Description                                                                                                                                                                               |
| ---------------------- | ------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `companyId`            | string (uuid)      | Restrict to users in this company.                                                                                                                                                        |
| `ckUserId`             | string (uuid)      | Restrict to the loan officers owned by this ConciergeKey (CK) user, i.e. users whose ckUserId equals this id. A ConciergeKey caller passes their own userId to list their managed agents. |
| `role`                 | string             | Restrict to users holding this role (a code from list\_user\_roles), e.g. Agent, Processor, Admin.                                                                                        |
| `isDisabled`           | boolean            | true = disabled users only; false = enabled only. Omit for both.                                                                                                                          |
| `hasOwnObAccount`      | boolean            | true = only users with their own Optimal Blue channel/originator configured; false = only users on the company default account. Omit for both.                                            |
| `lastLoginAfter`       | string (date-time) | Only users whose last sign-in is on or after this UTC date-time.                                                                                                                          |
| `lastLoginBefore`      | string (date-time) | Only users whose last sign-in is before this UTC date-time. Combine with includeNeverLoggedIn to also return users with no recorded sign-in.                                              |
| `includeNeverLoggedIn` | boolean            | When a last-login filter is set, also include users who have never signed in. Default false.                                                                                              |
| `page`                 | integer            | 1-based page number. Default 1.                                                                                                                                                           |
| `pageSize`             | integer            | Rows per page, 1-200. Default 50.                                                                                                                                                         |

## search\_users

Search Henge users you have access to by free-text matching their first name, last name, or email. Returns lightweight user records (id, name, email, roles); pass the id as userId to other tools such as search\_pricing when the user is the pricing agent. Only users within your access scope are returned.

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

**Reads or writes:** reads only

| Input        | Type   | Description                                                                                                                                                                                                             |
| ------------ | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `searchText` | string | Free-text search. Matches (case-insensitive, partial) against a user's first name, last name, and email. Whitespace-separated tokens must all match, so "jane doe" matches first name Jane and last name Doe. Required. |

## send\_user\_login

Give an existing Henge user an Auth0 username/password login, or resend their set-password email, without recreating the user. The email is the TPO welcome email with a fresh one-time set-password link; no password or link is ever returned. If the user has no login, an Auth0 user with their email is linked when one exists (login Linked, no email is sent; call again to send one), else a new one is created and the email sent (login Created). If the user has a login, a new link is emailed and any earlier link is replaced (login Existing). If the stored login no longer exists in Auth0 a new one is created (login Created). A failed email is an error, not a result: call the tool again to resend. A disabled user is refused. In UAT a login is only created or sent for a test user. Admin can act on any user; a CompanyAdmin only on users in their own company. Read the result: login says Created, Linked or Existing, and welcomeEmailSent says whether an email went out.

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

**Reads or writes:** writes

| Input    | Type          | Description                                                                                                        |
| -------- | ------------- | ------------------------------------------------------------------------------------------------------------------ |
| `userId` | string (uuid) | Henge user id (GUID) of the existing user to give a login or resend the set-password email to, from search\_users. |

## update\_company

Change a Henge company's details: name, address, state, zip, phone, website, company email, sender email, NMLS id, company type (companyTypeId from list\_company\_types), createLoginByDefault (whether create\_user creates a login when createLogin is omitted: true or false overrides the company type, null clears the override so a TPO creates one and other types do not) and the disabled flag. Admin only, except as stated. Fields you leave out stay as they are; only senderEmail can be blanked (an empty string clears it). senderEmail is the address the company's borrower emails are sent from: its domain must be authenticated in SendGrid, else the call is refused naming the domain and nothing is saved. A CompanyAdmin (company-roles flag) can change only their own company, and only name, address, state, zip, phone, website and senderEmail: any other field is refused. companyCode and businessTypeId cannot change (the code names the company's Key Vault): omit them or pass the current value, any other value is a "Bad request" naming the field. An invalid company type or a state that is not a 2-letter USPS code is a "Bad request". isDisabled only sets the company's disabled flag: it does not delete or touch the Key Vault and it is NOT access control: it does not disable the company's users, block sign-in or change its loans, tokens or integrations. What it does do is make the company's own lookups, edits and new organizations treat it as missing, and report\_companies leaves it out unless includeDisabled. Enabling a disabled company is done first, so the same call can also edit it; a disabled company's details cannot be edited unless the call enables it. Returns changedFields; a call that changes nothing writes nothing.

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

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

| Input                  | Type          | Description                                                                                                                                                                                                                                                                                                                                                                                                                              |
| ---------------------- | ------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `companyId`            | string (uuid) | Id of the company to change (required).                                                                                                                                                                                                                                                                                                                                                                                                  |
| `name`                 | string        | New company name (up to 512 characters). Omit to leave it as it is.                                                                                                                                                                                                                                                                                                                                                                      |
| `companyCode`          | string        | Cannot be changed: it names the company's Key Vault. Omit it, or pass the current code; any other value is refused.                                                                                                                                                                                                                                                                                                                      |
| `businessTypeId`       | string (uuid) | Cannot be changed. Omit it, or pass the current business type id; any other value is refused.                                                                                                                                                                                                                                                                                                                                            |
| `companyTypeId`        | string (uuid) | Company type id (GUID) from list\_company\_types, Standard or TPO. Omit to leave the type as it is.                                                                                                                                                                                                                                                                                                                                      |
| `address1`             | string        |                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| `address2`             | string        |                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| `city`                 | string        |                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| `state`                | string        | 2-letter USPS code, e.g. CA. Anything else is refused.                                                                                                                                                                                                                                                                                                                                                                                   |
| `zipCode`              | string        |                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| `phone`                | string        |                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| `website`              | string        |                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| `companyEmail`         | string        |                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| `senderEmail`          | string        | The address the company's borrower emails are sent from, e.g. <contact@homabroker.com>. Its domain must be authenticated in SendGrid, else the call is refused naming the domain and nothing is saved; "SendGrid could not be asked" means the server's SendGrid key cannot read domain authentication. An empty string clears it, so the emails go back to Henge's default address under the company's name. Omit to leave it as it is. |
| `nmlsId`               | string        | Company NMLS id.                                                                                                                                                                                                                                                                                                                                                                                                                         |
| `isDisabled`           | boolean       | true disables the company, false enables it. Omit to leave it as it is. Only sets the company's disabled flag.                                                                                                                                                                                                                                                                                                                           |
| `createLoginByDefault` | any           | Whether create\_user creates a login for this company's users when the call does not say. true or false overrides the company type; null clears the override so a TPO company creates one and any other type does not. Omit to leave it as it is.                                                                                                                                                                                        |

## update\_company\_license

Update a state license on a Henge company, found by companyId and state. Only the fields you pass change; an omitted field keeps its stored value, so a licenseType, issueDate or expirationDate cannot be cleared through this tool (replace it with a new value instead). isActive false keeps the license on record but marks it inactive. The state cannot be changed: remove the license and add another. Admin can update any company's license; a CompanyAdmin only their own company's.

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

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

| Input            | Type          | Description                                                                                                                                  |
| ---------------- | ------------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
| `companyId`      | string (uuid) | Henge company id (GUID).                                                                                                                     |
| `state`          | string        | The state of the license to update, as a 2-letter code or full name. The state itself cannot be changed: remove the license and add another. |
| `licenseNumber`  | string        | New license number. Omit to keep the stored one.                                                                                             |
| `licenseType`    | string        | New license type. Omit to keep the stored one.                                                                                               |
| `issueDate`      | string (date) | New issue date, yyyy-MM-dd. Omit to keep the stored one.                                                                                     |
| `expirationDate` | string (date) | New expiration date, yyyy-MM-dd. Omit to keep the stored one. Its year becomes the license's expiration year.                                |
| `isActive`       | boolean       | Set true or false to activate or deactivate the license. Omit to keep its status.                                                            |

## update\_user

Update a Henge user: name, job title, phone, mailing address, NMLS id, ckUserId, Optimal Blue channel and originator index, organization, enabled flag, test flag and roles. Omitted fields stay as they are; nothing here clears a value. Roles are replaced as a whole, under the same rules as create\_user. An organization from another company and an unknown ckUserId are refused by name. Disabling a user does not touch their Auth0 login. In UAT a change to the roles, enabled flag or test flag of a user with a login is refused unless that user is a test user. Admin can update any user. A CompanyAdmin can update only users in their own company and cannot change roles, the test flag or the enabled flag. Read changedFields: it lists what actually changed.

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

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

| Input               | Type            | Description                                                                                                                                                                                                                                                                                            |
| ------------------- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `userId`            | string (uuid)   | Henge user id (GUID) of the user to update.                                                                                                                                                                                                                                                            |
| `firstName`         | string          | New first name. Omit to keep it.                                                                                                                                                                                                                                                                       |
| `lastName`          | string          | New last name. Omit to keep it.                                                                                                                                                                                                                                                                        |
| `jobTitle`          | string          | New job title. Omit to keep it.                                                                                                                                                                                                                                                                        |
| `phone`             | string          | New phone number. Omit to keep it.                                                                                                                                                                                                                                                                     |
| `address1`          | string          | Mailing address line 1. Omit to keep it.                                                                                                                                                                                                                                                               |
| `address2`          | string          | Mailing address line 2. Omit to keep it.                                                                                                                                                                                                                                                               |
| `city`              | string          | Mailing address city. Omit to keep it.                                                                                                                                                                                                                                                                 |
| `state`             | string          | Mailing address state. Omit to keep it.                                                                                                                                                                                                                                                                |
| `zipCode`           | string          | Mailing address ZIP code. Omit to keep it.                                                                                                                                                                                                                                                             |
| `nmlsid`            | string          | NMLS id. Omit to keep it.                                                                                                                                                                                                                                                                              |
| `ckUserId`          | string (uuid)   | User id (GUID) of the ConciergeKey user this user is attached to. An unknown id is refused by name. Omit to keep it.                                                                                                                                                                                   |
| `obChannelIndex`    | integer         | Optimal Blue channel index. Omit to keep it.                                                                                                                                                                                                                                                           |
| `obOriginatorIndex` | integer         | Optimal Blue originator index. Omit to keep it.                                                                                                                                                                                                                                                        |
| `organizationId`    | string (uuid)   | Organization id (GUID) to move the user to. It must belong to the user's company. Omit to keep it.                                                                                                                                                                                                     |
| `isEnabled`         | boolean         | False disables the user, true enables a disabled one. Only the Henge user is changed; the Auth0 login is left as it is. Admin only. Omit to keep it.                                                                                                                                                   |
| `isTest`            | boolean         | Marks or unmarks the user as a test user. Admin only. Omit to keep it.                                                                                                                                                                                                                                 |
| `roles`             | array of string | Replaces the user's roles with these role codes, e.g. Agent, DualLicensedAgent, ConciergeKey, Processor, CompanyAdmin. An unknown code is refused by name. DualLicensedAgent and ConciergeKey already grant the Agent surface, so Agent is not stored beside them. Admin only. Omit to keep the roles. |

## update\_user\_license

Update a state license on a Henge user, found by userId and state. Only the fields you pass change; an omitted field keeps its stored value, so a licenseType, issueDate or expirationDate cannot be cleared through this tool (replace it with a new value instead). isActive false keeps the license on record but stops it counting for pricing. The state cannot be changed: remove the license and add another. Admin can update any user's license; a CompanyAdmin only for users in their own company.

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

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

| Input            | Type          | Description                                                                                                                                  |
| ---------------- | ------------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
| `userId`         | string (uuid) | Henge user id (GUID), from search\_users.                                                                                                    |
| `state`          | string        | The state of the license to update, as a 2-letter code or full name. The state itself cannot be changed: remove the license and add another. |
| `licenseNumber`  | string        | New license number. Omit to keep the stored one.                                                                                             |
| `licenseType`    | string        | New license type. Omit to keep the stored one.                                                                                               |
| `issueDate`      | string (date) | New issue date, yyyy-MM-dd. Omit to keep the stored one.                                                                                     |
| `expirationDate` | string (date) | New expiration date, yyyy-MM-dd. Omit to keep the stored one. Its year becomes the license's expiration year.                                |
| `isActive`       | boolean       | Set true or false to activate or deactivate the license. Omit to keep its status.                                                            |


---

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

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

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

```
GET https://api-docs.hengelending.com/mcp/tool-reference/users-and-companies.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.
