> 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/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 of your company (loan officers, processors and other staff): find, create, read and update them, deactivate one, and read a user's active state licences.

**Scopes:** `create:users`, `delete:users`, `read:users`, `update:users`

## Get Users

> \*\*Required scope:\*\* \`read:users\`\
> \
> Answers an object: value holds the users and count the number of matches. Page with $skip and $top (default 50,> \
> no maximum). A top sent without the dollar sign also limits count.

```json
{"openapi":"3.0.4","info":{"title":"Henge Partner API","version":"1.22.0"},"tags":[{"name":"Users and companies","description":"Users of your company (loan officers, processors and other staff): find, create, read and update them, deactivate one, and read a user's active state licences.\n\n**Scopes:** `create:users`, `delete:users`, `read:users`, `update:users`"}],"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":{"UserList":{"type":"object","properties":{"value":{"type":"array","items":{"$ref":"#/components/schemas/User"},"description":"The users on this page: $top of them (50 when it is not sent), after $skip.","nullable":true},"count":{"type":"integer","description":"Number of matching users across every page. A top sent without the dollar sign also limits this number.","format":"int32"}},"additionalProperties":false,"description":"The users a list answers, as the OData filter writes them."},"User":{"required":["email","firstName","lastName","organizationId"],"type":"object","properties":{"id":{"type":"string","description":"Unique identifier (GUID) of the user. Set by the server; read-only.","format":"uuid","readOnly":true},"firstName":{"maxLength":64,"minLength":0,"type":"string","description":"User's legal first name, up to 64 characters."},"lastName":{"maxLength":64,"minLength":0,"type":"string","description":"User's legal last name, up to 64 characters."},"jobTitle":{"maxLength":512,"minLength":0,"type":"string","description":"User's job title, for example Loan Officer. On POST, required when roles includes Agent.","nullable":true},"profileImageUrl":{"type":"string","description":"Address of the user's profile picture.","nullable":true},"externalId":{"maxLength":512,"minLength":0,"type":"string","description":"Your own identifier for the user. Send it together with source.","nullable":true},"source":{"type":"string","description":"Name of your system that issued externalId. Required when externalId is sent, and the reverse.","nullable":true},"email":{"maxLength":1024,"minLength":0,"type":"string","description":"User's email address; used to sign in and to send notifications.","format":"email"},"nmlsId":{"maxLength":64,"minLength":0,"type":"string","description":"The user's NMLS identifier, for a licensed loan originator. On POST, required when roles includes Agent.","nullable":true},"addressLine1":{"maxLength":512,"minLength":0,"type":"string","description":"Street address of the user's office.","nullable":true},"addressLine2":{"maxLength":512,"minLength":0,"type":"string","description":"Unit, suite or other second line of the user's address.","nullable":true},"city":{"maxLength":256,"minLength":0,"type":"string","description":"City of the user's address.","nullable":true},"state":{"maxLength":32,"minLength":0,"type":"string","description":"State of the user's address.","nullable":true},"zipCode":{"maxLength":32,"minLength":0,"type":"string","description":"ZIP code of the user's address.","nullable":true},"workPhone":{"maxLength":64,"minLength":0,"type":"string","description":"Work phone number.","nullable":true},"mobilePhone":{"maxLength":64,"minLength":0,"type":"string","description":"Mobile phone number.","nullable":true},"fax":{"maxLength":64,"minLength":0,"type":"string","description":"Fax number.","nullable":true},"website":{"type":"string","description":"Address of the user's website.","nullable":true},"roles":{"type":"array","items":{"type":"string"},"description":"The roles granted to the user, for example Agent. Some roles cannot be granted through the Partner API; the request is refused with a 400 naming the role.","nullable":true},"enrollmentDate":{"type":"string","description":"Date the user enrolled, ISO 8601.","format":"date-time","nullable":true},"organizationId":{"type":"string","description":"Unique identifier (GUID) of the company the user belongs to. Required on create.","format":"uuid"},"hasRegistered":{"type":"boolean","description":"True when the user has completed sign-up and can sign in. Set by the server; read-only.","readOnly":true},"lastLoginOn":{"type":"string","description":"When the user last signed in, ISO 8601 in UTC; recorded at most once every 5 hours. Set by the server; read-only.","format":"date-time","nullable":true,"readOnly":true},"createdOn":{"type":"string","description":"When the user was created, ISO 8601 in UTC. Set by the server; read-only.","format":"date-time","nullable":true,"readOnly":true},"updatedOn":{"type":"string","description":"When the user was last changed, ISO 8601 in UTC. Set by the server; read-only.","format":"date-time","nullable":true,"readOnly":true}},"additionalProperties":false,"description":"firstName, lastName, email and organizationId are required on POST and on PATCH. PATCH replaces every writable field, so a field you leave out is cleared: send the full user. On POST always send roles (an empty array is fine): without it the user is created and the call still fails."},"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":{"/users":{"get":{"tags":["Users and companies"],"summary":"Get Users","description":"**Required scope:** `read:users`\n\nAnswers an object: value holds the users and count the number of matches. Page with $skip and $top (default 50,\r\nno maximum). A top sent without the dollar sign also limits count.","operationId":"Users_Find","parameters":[{"name":"searchText","in":"query","description":"Free text. Split on spaces, and every word must match part of the user's first name, last name, nickname or email. Deactivated users are never listed.","schema":{"type":"string"}},{"name":"$filter","in":"query","description":"An OData `$filter` expression over the fields of the returned items, for example `lastName eq 'Doe'` or `contains(email, '@example.com')`. Leave it out for every item. See the [OData filter tutorial](https://www.odata.org/getting-started/basic-tutorial/#filter).","schema":{"type":"string"}},{"name":"$select","in":"query","description":"An OData `$select` list of the fields to return on each item, comma-separated. Leave it out for every field. See the [OData select tutorial](https://www.odata.org/getting-started/basic-tutorial/#select).","schema":{"type":"string"}},{"name":"$orderby","in":"query","description":"The fields to sort by, comma-separated, each followed by `asc` (the default) or `desc`, for example `lastName asc,createdTimestamp desc`. A value naming `null` is ignored. See the [OData orderby tutorial](https://www.odata.org/getting-started/basic-tutorial/#orderby).","schema":{"type":"string"}},{"name":"$skip","in":"query","description":"The number of matching items to skip before the page starts. Defaults to 0. See [OData paging](https://www.odata.org/getting-started/basic-tutorial/#topskip).","schema":{"type":"integer"}},{"name":"$top","in":"query","description":"The number of items to return on the page. Defaults to 50. The response is `{ value, count }`, where `count` is the number of matching items before paging. See [OData paging](https://www.odata.org/getting-started/basic-tutorial/#topskip).","schema":{"type":"integer"}}],"responses":{"200":{"description":"Users found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserList"}}}},"401":{"description":"Missing, invalid or expired access token.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Unauthorized","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Internal Server Error","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}}}}
```

## Create a User

> \*\*Required scope:\*\* \`create:users\`

```json
{"openapi":"3.0.4","info":{"title":"Henge Partner API","version":"1.22.0"},"tags":[{"name":"Users and companies","description":"Users of your company (loan officers, processors and other staff): find, create, read and update them, deactivate one, and read a user's active state licences.\n\n**Scopes:** `create:users`, `delete:users`, `read:users`, `update:users`"}],"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":{"User":{"required":["email","firstName","lastName","organizationId"],"type":"object","properties":{"id":{"type":"string","description":"Unique identifier (GUID) of the user. Set by the server; read-only.","format":"uuid","readOnly":true},"firstName":{"maxLength":64,"minLength":0,"type":"string","description":"User's legal first name, up to 64 characters."},"lastName":{"maxLength":64,"minLength":0,"type":"string","description":"User's legal last name, up to 64 characters."},"jobTitle":{"maxLength":512,"minLength":0,"type":"string","description":"User's job title, for example Loan Officer. On POST, required when roles includes Agent.","nullable":true},"profileImageUrl":{"type":"string","description":"Address of the user's profile picture.","nullable":true},"externalId":{"maxLength":512,"minLength":0,"type":"string","description":"Your own identifier for the user. Send it together with source.","nullable":true},"source":{"type":"string","description":"Name of your system that issued externalId. Required when externalId is sent, and the reverse.","nullable":true},"email":{"maxLength":1024,"minLength":0,"type":"string","description":"User's email address; used to sign in and to send notifications.","format":"email"},"nmlsId":{"maxLength":64,"minLength":0,"type":"string","description":"The user's NMLS identifier, for a licensed loan originator. On POST, required when roles includes Agent.","nullable":true},"addressLine1":{"maxLength":512,"minLength":0,"type":"string","description":"Street address of the user's office.","nullable":true},"addressLine2":{"maxLength":512,"minLength":0,"type":"string","description":"Unit, suite or other second line of the user's address.","nullable":true},"city":{"maxLength":256,"minLength":0,"type":"string","description":"City of the user's address.","nullable":true},"state":{"maxLength":32,"minLength":0,"type":"string","description":"State of the user's address.","nullable":true},"zipCode":{"maxLength":32,"minLength":0,"type":"string","description":"ZIP code of the user's address.","nullable":true},"workPhone":{"maxLength":64,"minLength":0,"type":"string","description":"Work phone number.","nullable":true},"mobilePhone":{"maxLength":64,"minLength":0,"type":"string","description":"Mobile phone number.","nullable":true},"fax":{"maxLength":64,"minLength":0,"type":"string","description":"Fax number.","nullable":true},"website":{"type":"string","description":"Address of the user's website.","nullable":true},"roles":{"type":"array","items":{"type":"string"},"description":"The roles granted to the user, for example Agent. Some roles cannot be granted through the Partner API; the request is refused with a 400 naming the role.","nullable":true},"enrollmentDate":{"type":"string","description":"Date the user enrolled, ISO 8601.","format":"date-time","nullable":true},"organizationId":{"type":"string","description":"Unique identifier (GUID) of the company the user belongs to. Required on create.","format":"uuid"},"hasRegistered":{"type":"boolean","description":"True when the user has completed sign-up and can sign in. Set by the server; read-only.","readOnly":true},"lastLoginOn":{"type":"string","description":"When the user last signed in, ISO 8601 in UTC; recorded at most once every 5 hours. Set by the server; read-only.","format":"date-time","nullable":true,"readOnly":true},"createdOn":{"type":"string","description":"When the user was created, ISO 8601 in UTC. Set by the server; read-only.","format":"date-time","nullable":true,"readOnly":true},"updatedOn":{"type":"string","description":"When the user was last changed, ISO 8601 in UTC. Set by the server; read-only.","format":"date-time","nullable":true,"readOnly":true}},"additionalProperties":false,"description":"firstName, lastName, email and organizationId are required on POST and on PATCH. PATCH replaces every writable field, so a field you leave out is cleared: send the full user. On POST always send roles (an empty array is fine): without it the user is created and the call still fails."},"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":{"/users":{"post":{"tags":["Users and companies"],"summary":"Create a User","description":"**Required scope:** `create:users`","operationId":"Users_Create","parameters":[{"name":"sendInvite","in":"query","description":"If true, sends the invite email after creation","schema":{"type":"boolean","default":false}}],"requestBody":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/User"}}}},"responses":{"200":{"description":"Success 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":"Bad Request, including a role the application may not grant","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 create:users scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}}}}
```

## Get a User

> \*\*Required scope:\*\* \`read:users\`

```json
{"openapi":"3.0.4","info":{"title":"Henge Partner API","version":"1.22.0"},"tags":[{"name":"Users and companies","description":"Users of your company (loan officers, processors and other staff): find, create, read and update them, deactivate one, and read a user's active state licences.\n\n**Scopes:** `create:users`, `delete:users`, `read:users`, `update:users`"}],"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":{"User":{"required":["email","firstName","lastName","organizationId"],"type":"object","properties":{"id":{"type":"string","description":"Unique identifier (GUID) of the user. Set by the server; read-only.","format":"uuid","readOnly":true},"firstName":{"maxLength":64,"minLength":0,"type":"string","description":"User's legal first name, up to 64 characters."},"lastName":{"maxLength":64,"minLength":0,"type":"string","description":"User's legal last name, up to 64 characters."},"jobTitle":{"maxLength":512,"minLength":0,"type":"string","description":"User's job title, for example Loan Officer. On POST, required when roles includes Agent.","nullable":true},"profileImageUrl":{"type":"string","description":"Address of the user's profile picture.","nullable":true},"externalId":{"maxLength":512,"minLength":0,"type":"string","description":"Your own identifier for the user. Send it together with source.","nullable":true},"source":{"type":"string","description":"Name of your system that issued externalId. Required when externalId is sent, and the reverse.","nullable":true},"email":{"maxLength":1024,"minLength":0,"type":"string","description":"User's email address; used to sign in and to send notifications.","format":"email"},"nmlsId":{"maxLength":64,"minLength":0,"type":"string","description":"The user's NMLS identifier, for a licensed loan originator. On POST, required when roles includes Agent.","nullable":true},"addressLine1":{"maxLength":512,"minLength":0,"type":"string","description":"Street address of the user's office.","nullable":true},"addressLine2":{"maxLength":512,"minLength":0,"type":"string","description":"Unit, suite or other second line of the user's address.","nullable":true},"city":{"maxLength":256,"minLength":0,"type":"string","description":"City of the user's address.","nullable":true},"state":{"maxLength":32,"minLength":0,"type":"string","description":"State of the user's address.","nullable":true},"zipCode":{"maxLength":32,"minLength":0,"type":"string","description":"ZIP code of the user's address.","nullable":true},"workPhone":{"maxLength":64,"minLength":0,"type":"string","description":"Work phone number.","nullable":true},"mobilePhone":{"maxLength":64,"minLength":0,"type":"string","description":"Mobile phone number.","nullable":true},"fax":{"maxLength":64,"minLength":0,"type":"string","description":"Fax number.","nullable":true},"website":{"type":"string","description":"Address of the user's website.","nullable":true},"roles":{"type":"array","items":{"type":"string"},"description":"The roles granted to the user, for example Agent. Some roles cannot be granted through the Partner API; the request is refused with a 400 naming the role.","nullable":true},"enrollmentDate":{"type":"string","description":"Date the user enrolled, ISO 8601.","format":"date-time","nullable":true},"organizationId":{"type":"string","description":"Unique identifier (GUID) of the company the user belongs to. Required on create.","format":"uuid"},"hasRegistered":{"type":"boolean","description":"True when the user has completed sign-up and can sign in. Set by the server; read-only.","readOnly":true},"lastLoginOn":{"type":"string","description":"When the user last signed in, ISO 8601 in UTC; recorded at most once every 5 hours. Set by the server; read-only.","format":"date-time","nullable":true,"readOnly":true},"createdOn":{"type":"string","description":"When the user was created, ISO 8601 in UTC. Set by the server; read-only.","format":"date-time","nullable":true,"readOnly":true},"updatedOn":{"type":"string","description":"When the user was last changed, ISO 8601 in UTC. Set by the server; read-only.","format":"date-time","nullable":true,"readOnly":true}},"additionalProperties":false,"description":"firstName, lastName, email and organizationId are required on POST and on PATCH. PATCH replaces every writable field, so a field you leave out is cleared: send the full user. On POST always send roles (an empty array is fine): without it the user is created and the call still fails."},"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":{"/users/{id}":{"get":{"tags":["Users and companies"],"summary":"Get a User","description":"**Required scope:** `read:users`","operationId":"Users_GetById","parameters":[{"name":"id","in":"path","description":"The user's id. A user in another company, or a deactivated one, answers 404; the empty GUID answers 400.","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"User with Id found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/User"}}}},"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":"Unauthorized","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"User not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Internal Server Error","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}}}}
```

## Delete a User

> \*\*Required scope:\*\* \`delete:users\`

```json
{"openapi":"3.0.4","info":{"title":"Henge Partner API","version":"1.22.0"},"tags":[{"name":"Users and companies","description":"Users of your company (loan officers, processors and other staff): find, create, read and update them, deactivate one, and read a user's active state licences.\n\n**Scopes:** `create:users`, `delete:users`, `read:users`, `update:users`"}],"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":{"/users/{id}":{"delete":{"tags":["Users and companies"],"summary":"Delete a User","description":"**Required scope:** `delete:users`","operationId":"Users_Delete","parameters":[{"name":"id","in":"path","description":"The user to deactivate. The user is deactivated, not removed, and is then left out of user reads. A user in another company answers 404; the empty GUID answers 400.","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"204":{"description":"User 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":"Unauthorized","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"User not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Internal Server Error","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}}}}
```

## Update a User

> \*\*Required scope:\*\* \`update:users\`

```json
{"openapi":"3.0.4","info":{"title":"Henge Partner API","version":"1.22.0"},"tags":[{"name":"Users and companies","description":"Users of your company (loan officers, processors and other staff): find, create, read and update them, deactivate one, and read a user's active state licences.\n\n**Scopes:** `create:users`, `delete:users`, `read:users`, `update:users`"}],"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":{"User":{"required":["email","firstName","lastName","organizationId"],"type":"object","properties":{"id":{"type":"string","description":"Unique identifier (GUID) of the user. Set by the server; read-only.","format":"uuid","readOnly":true},"firstName":{"maxLength":64,"minLength":0,"type":"string","description":"User's legal first name, up to 64 characters."},"lastName":{"maxLength":64,"minLength":0,"type":"string","description":"User's legal last name, up to 64 characters."},"jobTitle":{"maxLength":512,"minLength":0,"type":"string","description":"User's job title, for example Loan Officer. On POST, required when roles includes Agent.","nullable":true},"profileImageUrl":{"type":"string","description":"Address of the user's profile picture.","nullable":true},"externalId":{"maxLength":512,"minLength":0,"type":"string","description":"Your own identifier for the user. Send it together with source.","nullable":true},"source":{"type":"string","description":"Name of your system that issued externalId. Required when externalId is sent, and the reverse.","nullable":true},"email":{"maxLength":1024,"minLength":0,"type":"string","description":"User's email address; used to sign in and to send notifications.","format":"email"},"nmlsId":{"maxLength":64,"minLength":0,"type":"string","description":"The user's NMLS identifier, for a licensed loan originator. On POST, required when roles includes Agent.","nullable":true},"addressLine1":{"maxLength":512,"minLength":0,"type":"string","description":"Street address of the user's office.","nullable":true},"addressLine2":{"maxLength":512,"minLength":0,"type":"string","description":"Unit, suite or other second line of the user's address.","nullable":true},"city":{"maxLength":256,"minLength":0,"type":"string","description":"City of the user's address.","nullable":true},"state":{"maxLength":32,"minLength":0,"type":"string","description":"State of the user's address.","nullable":true},"zipCode":{"maxLength":32,"minLength":0,"type":"string","description":"ZIP code of the user's address.","nullable":true},"workPhone":{"maxLength":64,"minLength":0,"type":"string","description":"Work phone number.","nullable":true},"mobilePhone":{"maxLength":64,"minLength":0,"type":"string","description":"Mobile phone number.","nullable":true},"fax":{"maxLength":64,"minLength":0,"type":"string","description":"Fax number.","nullable":true},"website":{"type":"string","description":"Address of the user's website.","nullable":true},"roles":{"type":"array","items":{"type":"string"},"description":"The roles granted to the user, for example Agent. Some roles cannot be granted through the Partner API; the request is refused with a 400 naming the role.","nullable":true},"enrollmentDate":{"type":"string","description":"Date the user enrolled, ISO 8601.","format":"date-time","nullable":true},"organizationId":{"type":"string","description":"Unique identifier (GUID) of the company the user belongs to. Required on create.","format":"uuid"},"hasRegistered":{"type":"boolean","description":"True when the user has completed sign-up and can sign in. Set by the server; read-only.","readOnly":true},"lastLoginOn":{"type":"string","description":"When the user last signed in, ISO 8601 in UTC; recorded at most once every 5 hours. Set by the server; read-only.","format":"date-time","nullable":true,"readOnly":true},"createdOn":{"type":"string","description":"When the user was created, ISO 8601 in UTC. Set by the server; read-only.","format":"date-time","nullable":true,"readOnly":true},"updatedOn":{"type":"string","description":"When the user was last changed, ISO 8601 in UTC. Set by the server; read-only.","format":"date-time","nullable":true,"readOnly":true}},"additionalProperties":false,"description":"firstName, lastName, email and organizationId are required on POST and on PATCH. PATCH replaces every writable field, so a field you leave out is cleared: send the full user. On POST always send roles (an empty array is fine): without it the user is created and the call still fails."},"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":{"/users/{id}":{"patch":{"tags":["Users and companies"],"summary":"Update a User","description":"**Required scope:** `update:users`","operationId":"Users_Update","parameters":[{"name":"id","in":"path","description":"The user's id. A user in another company answers 404; the empty GUID answers 400.","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/User"}}}},"responses":{"200":{"description":"User updated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Modified"}}}},"400":{"description":"Bad Request","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":"Unauthorized","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"User not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Internal Server Error","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}}}}
```

## Active licences for a user

> \*\*Required scope:\*\* \`read:users\`\
> \
> Useful for confirming a loan officer can be priced under for a given property state before> \
> calling the pricing search, which enforces the same rule.

```json
{"openapi":"3.0.4","info":{"title":"Henge Partner API","version":"1.22.0"},"tags":[{"name":"Users and companies","description":"Users of your company (loan officers, processors and other staff): find, create, read and update them, deactivate one, and read a user's active state licences.\n\n**Scopes:** `create:users`, `delete:users`, `read:users`, `update:users`"}],"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":{"GetUserLicensesResponse":{"type":"object","properties":{"userId":{"type":"string","description":"Unique identifier (GUID) of the user the licenses belong to.","format":"uuid"},"count":{"type":"integer","description":"Number of licenses returned.","format":"int32"},"licenses":{"type":"array","items":{"$ref":"#/components/schemas/UserLicenseInfo"},"description":"The user's state licenses.","nullable":true}},"additionalProperties":false},"UserLicenseInfo":{"type":"object","properties":{"state":{"type":"string","description":"2-letter state code (e.g. \"CA\"). Matches the property state passed to search_pricing.","nullable":true},"stateLicenseNumber":{"type":"string","description":"The license number the state issued.","nullable":true},"expirationYear":{"type":"string","description":"Four-digit year the license expires.","nullable":true},"licenseId":{"type":"string","description":"Unique identifier (GUID) of the license; returned only when inactive licenses are included.","format":"uuid","nullable":true},"licenseType":{"type":"string","description":"The license type; returned only when inactive licenses are included.","nullable":true},"issueDate":{"type":"string","description":"Date the license was issued; returned only when inactive licenses are included.","nullable":true},"expirationDate":{"type":"string","description":"Date the license expires; returned only when inactive licenses are included.","nullable":true},"isActive":{"type":"boolean","description":"True when the license is active; returned only when inactive licenses are included.","nullable":true},"isExpired":{"type":"boolean","description":"True when the license has expired; returned only when inactive licenses are included.","nullable":true}},"additionalProperties":false},"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":{"/users/{id}/licenses":{"get":{"tags":["Users and companies"],"summary":"Active licences for a user","description":"**Required scope:** `read:users`\n\nUseful for confirming a loan officer can be priced under for a given property state before\r\ncalling the pricing search, which enforces the same rule.","operationId":"Users_GetUserLicenses","parameters":[{"name":"id","in":"path","description":"The user's id. A user in another company, or a deactivated one, answers 404.","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Active licences","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetUserLicensesResponse"}}}},"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":"User not found","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/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.
