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

# Borrowers

Only available to POS customers.

Borrowers (clients) of your company: find, create and update them, and email a client the invitation to the borrower portal. A client belongs to a loan officer (its owner) and can be the borrower on several loan applications.

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

## Gets Client by Owner Id

> \*\*Required scope:\*\* \`read:clients\`\
> \
> Answers an object: value holds the clients 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":"Borrowers","description":"Only available to POS customers.\n\nBorrowers (clients) of your company: find, create and update them, and email a client the invitation to the borrower portal. A client belongs to a loan officer (its owner) and can be the borrower on several loan applications.\n\n**Scopes:** `create:clients`, `delete:clients`, `read:clients`, `update:clients`"}],"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":{"ClientList":{"type":"object","properties":{"value":{"type":"array","items":{"$ref":"#/components/schemas/Client"},"description":"The clients on this page: $top of them (50 when it is not sent), after $skip.","nullable":true},"count":{"type":"integer","description":"Number of matching clients across every page. A top sent without the dollar sign also limits this number.","format":"int32"}},"additionalProperties":false,"description":"The clients a list answers, as the OData filter writes them."},"Client":{"required":["email","firstName","lastName"],"type":"object","properties":{"externalId":{"type":"string","description":"Your own identifier for the client. Send it together with source; the pair identifies the client in your system.","nullable":true},"source":{"type":"string","description":"Name of your system that issued externalId. Send it with externalId: the pair identifies the client in your system. Not checked by the server: either may be sent without the other.","nullable":true},"ownerId":{"type":"string","description":"Unique identifier (GUID) of the user (loan officer) who owns the client.","format":"uuid","nullable":true},"referredById":{"type":"string","description":"Unique identifier (GUID) of the user who referred the client.","format":"uuid","nullable":true},"email":{"minLength":1,"pattern":"[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$","type":"string","description":"Client's email address; used to contact the borrower and must be a valid address."},"homePhone":{"type":"string","description":"Home phone number.","nullable":true},"workPhone":{"type":"string","description":"Work phone number.","nullable":true},"mobilePhone":{"type":"string","description":"Mobile phone number.","nullable":true},"fax":{"type":"string","description":"Fax number.","nullable":true},"contactAddress":{"$ref":"#/components/schemas/Address"},"isSilenced":{"type":"boolean","description":"True when emails to the client are suppressed (for example after an unsubscribe). It does not remove their access. Left out, it is false, also on PATCH."},"isArchived":{"type":"boolean","description":"True when the client is archived and hidden from active lists. Left out, it is false, also on PATCH."},"createdOn":{"type":"string","description":"When the client was created, ISO 8601 in UTC. Set by the server; read-only.","format":"date-time","readOnly":true},"updatedOn":{"type":"string","description":"When the client was last changed, ISO 8601 in UTC. Set by the server; read-only.","format":"date-time","nullable":true,"readOnly":true},"fico":{"type":"integer","description":"The client's FICO credit score.","format":"int32","nullable":true},"totalIncome":{"type":"number","description":"Total income in dollars.","format":"double","nullable":true},"totalDebtPayments":{"type":"number","description":"Total monthly debt payments in dollars.","format":"double","nullable":true},"firstTimeBuyer":{"type":"boolean","description":"True when the client is a first-time home buyer.","nullable":true},"loginToken":{"type":"string","description":"A link that signs the holder in as this borrower, valid 30 days. Returned only when a single client is read, and omitted when the company's borrowers do not use the borrower portal. Treat it as a credential.","nullable":true},"id":{"type":"string","description":"Unique identifier (GUID) of the client (borrower). Set by the server; read-only.","format":"uuid","readOnly":true},"firstName":{"minLength":1,"type":"string","description":"Borrower's legal first name."},"lastName":{"minLength":1,"type":"string","description":"Borrower's legal last name."}},"additionalProperties":false,"description":"`contactAddress`: Optional. When sent, the address's own rules apply (state is required inside it). PUT clears the stored address when absent; PATCH keeps it. firstName, lastName and email are required on POST, PUT and PATCH alike. On PATCH, a text or number field left out or null keeps its stored value, but isSilenced and isArchived are set to false when left out."},"Address":{"required":["state"],"type":"object","properties":{"addressLine1":{"type":"string","description":"Street address, for example 123 Main St.","nullable":true},"addressLine2":{"type":"string","description":"Unit, suite or other second line; optional.","nullable":true},"city":{"type":"string","description":"City name.","nullable":true},"state":{"minLength":1,"type":"string","description":"Two-letter state code."},"zipCode":{"type":"string","description":"Postal (ZIP) code.","nullable":true}},"additionalProperties":false,"description":"A US mailing address."},"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":{"/clients":{"get":{"tags":["Borrowers"],"summary":"Gets Client by Owner Id","description":"**Required scope:** `read:clients`\n\nAnswers an object: value holds the clients 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":"Clients_Find","parameters":[{"name":"ownerId","in":"query","description":"Only clients owned by this loan officer (a user `id`). Defaults to your application's acting user, so leave it out to list that user's clients.","schema":{"type":"string","format":"uuid"}},{"name":"searchText","in":"query","description":"Free text. Split on spaces, and every word must match part of the client's first name, last name or email.","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":"The matching clients","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientList"}}}},"401":{"description":"Missing, invalid or expired access token.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The access token lacks the read:clients scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}}}}
```

## Creates a Client

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

```json
{"openapi":"3.0.4","info":{"title":"Henge Partner API","version":"1.22.0"},"tags":[{"name":"Borrowers","description":"Only available to POS customers.\n\nBorrowers (clients) of your company: find, create and update them, and email a client the invitation to the borrower portal. A client belongs to a loan officer (its owner) and can be the borrower on several loan applications.\n\n**Scopes:** `create:clients`, `delete:clients`, `read:clients`, `update:clients`"}],"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":{"Client":{"required":["email","firstName","lastName"],"type":"object","properties":{"externalId":{"type":"string","description":"Your own identifier for the client. Send it together with source; the pair identifies the client in your system.","nullable":true},"source":{"type":"string","description":"Name of your system that issued externalId. Send it with externalId: the pair identifies the client in your system. Not checked by the server: either may be sent without the other.","nullable":true},"ownerId":{"type":"string","description":"Unique identifier (GUID) of the user (loan officer) who owns the client.","format":"uuid","nullable":true},"referredById":{"type":"string","description":"Unique identifier (GUID) of the user who referred the client.","format":"uuid","nullable":true},"email":{"minLength":1,"pattern":"[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$","type":"string","description":"Client's email address; used to contact the borrower and must be a valid address."},"homePhone":{"type":"string","description":"Home phone number.","nullable":true},"workPhone":{"type":"string","description":"Work phone number.","nullable":true},"mobilePhone":{"type":"string","description":"Mobile phone number.","nullable":true},"fax":{"type":"string","description":"Fax number.","nullable":true},"contactAddress":{"$ref":"#/components/schemas/Address"},"isSilenced":{"type":"boolean","description":"True when emails to the client are suppressed (for example after an unsubscribe). It does not remove their access. Left out, it is false, also on PATCH."},"isArchived":{"type":"boolean","description":"True when the client is archived and hidden from active lists. Left out, it is false, also on PATCH."},"createdOn":{"type":"string","description":"When the client was created, ISO 8601 in UTC. Set by the server; read-only.","format":"date-time","readOnly":true},"updatedOn":{"type":"string","description":"When the client was last changed, ISO 8601 in UTC. Set by the server; read-only.","format":"date-time","nullable":true,"readOnly":true},"fico":{"type":"integer","description":"The client's FICO credit score.","format":"int32","nullable":true},"totalIncome":{"type":"number","description":"Total income in dollars.","format":"double","nullable":true},"totalDebtPayments":{"type":"number","description":"Total monthly debt payments in dollars.","format":"double","nullable":true},"firstTimeBuyer":{"type":"boolean","description":"True when the client is a first-time home buyer.","nullable":true},"loginToken":{"type":"string","description":"A link that signs the holder in as this borrower, valid 30 days. Returned only when a single client is read, and omitted when the company's borrowers do not use the borrower portal. Treat it as a credential.","nullable":true},"id":{"type":"string","description":"Unique identifier (GUID) of the client (borrower). Set by the server; read-only.","format":"uuid","readOnly":true},"firstName":{"minLength":1,"type":"string","description":"Borrower's legal first name."},"lastName":{"minLength":1,"type":"string","description":"Borrower's legal last name."}},"additionalProperties":false,"description":"`contactAddress`: Optional. When sent, the address's own rules apply (state is required inside it). PUT clears the stored address when absent; PATCH keeps it. firstName, lastName and email are required on POST, PUT and PATCH alike. On PATCH, a text or number field left out or null keeps its stored value, but isSilenced and isArchived are set to false when left out."},"Address":{"required":["state"],"type":"object","properties":{"addressLine1":{"type":"string","description":"Street address, for example 123 Main St.","nullable":true},"addressLine2":{"type":"string","description":"Unit, suite or other second line; optional.","nullable":true},"city":{"type":"string","description":"City name.","nullable":true},"state":{"minLength":1,"type":"string","description":"Two-letter state code."},"zipCode":{"type":"string","description":"Postal (ZIP) code.","nullable":true}},"additionalProperties":false,"description":"A US mailing address."},"ClientModified":{"required":["alreadyExists","id"],"type":"object","properties":{"alreadyExists":{"type":"boolean","description":"True when the loan officer already held a client with this email in a portal company: nothing was written\r\nand `id` is that client."},"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":"The audit record of a client create, with whether the client already existed."},"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":{"/clients":{"post":{"tags":["Borrowers"],"summary":"Creates a Client","description":"**Required scope:** `create:clients`","operationId":"Clients_Create","requestBody":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Client"}}}},"responses":{"200":{"description":"OK 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/ClientModified"}}}},"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. A request that matched an existing client (alreadyExists true) creates nothing and still answers 200.","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/ClientModified"}}}},"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:clients scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}}}}
```

## Gets Client by Id

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

```json
{"openapi":"3.0.4","info":{"title":"Henge Partner API","version":"1.22.0"},"tags":[{"name":"Borrowers","description":"Only available to POS customers.\n\nBorrowers (clients) of your company: find, create and update them, and email a client the invitation to the borrower portal. A client belongs to a loan officer (its owner) and can be the borrower on several loan applications.\n\n**Scopes:** `create:clients`, `delete:clients`, `read:clients`, `update:clients`"}],"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":{"Client":{"required":["email","firstName","lastName"],"type":"object","properties":{"externalId":{"type":"string","description":"Your own identifier for the client. Send it together with source; the pair identifies the client in your system.","nullable":true},"source":{"type":"string","description":"Name of your system that issued externalId. Send it with externalId: the pair identifies the client in your system. Not checked by the server: either may be sent without the other.","nullable":true},"ownerId":{"type":"string","description":"Unique identifier (GUID) of the user (loan officer) who owns the client.","format":"uuid","nullable":true},"referredById":{"type":"string","description":"Unique identifier (GUID) of the user who referred the client.","format":"uuid","nullable":true},"email":{"minLength":1,"pattern":"[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$","type":"string","description":"Client's email address; used to contact the borrower and must be a valid address."},"homePhone":{"type":"string","description":"Home phone number.","nullable":true},"workPhone":{"type":"string","description":"Work phone number.","nullable":true},"mobilePhone":{"type":"string","description":"Mobile phone number.","nullable":true},"fax":{"type":"string","description":"Fax number.","nullable":true},"contactAddress":{"$ref":"#/components/schemas/Address"},"isSilenced":{"type":"boolean","description":"True when emails to the client are suppressed (for example after an unsubscribe). It does not remove their access. Left out, it is false, also on PATCH."},"isArchived":{"type":"boolean","description":"True when the client is archived and hidden from active lists. Left out, it is false, also on PATCH."},"createdOn":{"type":"string","description":"When the client was created, ISO 8601 in UTC. Set by the server; read-only.","format":"date-time","readOnly":true},"updatedOn":{"type":"string","description":"When the client was last changed, ISO 8601 in UTC. Set by the server; read-only.","format":"date-time","nullable":true,"readOnly":true},"fico":{"type":"integer","description":"The client's FICO credit score.","format":"int32","nullable":true},"totalIncome":{"type":"number","description":"Total income in dollars.","format":"double","nullable":true},"totalDebtPayments":{"type":"number","description":"Total monthly debt payments in dollars.","format":"double","nullable":true},"firstTimeBuyer":{"type":"boolean","description":"True when the client is a first-time home buyer.","nullable":true},"loginToken":{"type":"string","description":"A link that signs the holder in as this borrower, valid 30 days. Returned only when a single client is read, and omitted when the company's borrowers do not use the borrower portal. Treat it as a credential.","nullable":true},"id":{"type":"string","description":"Unique identifier (GUID) of the client (borrower). Set by the server; read-only.","format":"uuid","readOnly":true},"firstName":{"minLength":1,"type":"string","description":"Borrower's legal first name."},"lastName":{"minLength":1,"type":"string","description":"Borrower's legal last name."}},"additionalProperties":false,"description":"`contactAddress`: Optional. When sent, the address's own rules apply (state is required inside it). PUT clears the stored address when absent; PATCH keeps it. firstName, lastName and email are required on POST, PUT and PATCH alike. On PATCH, a text or number field left out or null keeps its stored value, but isSilenced and isArchived are set to false when left out."},"Address":{"required":["state"],"type":"object","properties":{"addressLine1":{"type":"string","description":"Street address, for example 123 Main St.","nullable":true},"addressLine2":{"type":"string","description":"Unit, suite or other second line; optional.","nullable":true},"city":{"type":"string","description":"City name.","nullable":true},"state":{"minLength":1,"type":"string","description":"Two-letter state code."},"zipCode":{"type":"string","description":"Postal (ZIP) code.","nullable":true}},"additionalProperties":false,"description":"A US mailing address."},"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":{"/clients/{id}":{"get":{"tags":["Borrowers"],"summary":"Gets Client by Id","description":"**Required scope:** `read:clients`","operationId":"Clients_GetById","parameters":[{"name":"id","in":"path","description":"GUID of client to read","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Client with Id found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Client"}}}},"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":"Client 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"}}}}}}}}}
```

## Replaces a Client

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

```json
{"openapi":"3.0.4","info":{"title":"Henge Partner API","version":"1.22.0"},"tags":[{"name":"Borrowers","description":"Only available to POS customers.\n\nBorrowers (clients) of your company: find, create and update them, and email a client the invitation to the borrower portal. A client belongs to a loan officer (its owner) and can be the borrower on several loan applications.\n\n**Scopes:** `create:clients`, `delete:clients`, `read:clients`, `update:clients`"}],"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":{"Client":{"required":["email","firstName","lastName"],"type":"object","properties":{"externalId":{"type":"string","description":"Your own identifier for the client. Send it together with source; the pair identifies the client in your system.","nullable":true},"source":{"type":"string","description":"Name of your system that issued externalId. Send it with externalId: the pair identifies the client in your system. Not checked by the server: either may be sent without the other.","nullable":true},"ownerId":{"type":"string","description":"Unique identifier (GUID) of the user (loan officer) who owns the client.","format":"uuid","nullable":true},"referredById":{"type":"string","description":"Unique identifier (GUID) of the user who referred the client.","format":"uuid","nullable":true},"email":{"minLength":1,"pattern":"[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$","type":"string","description":"Client's email address; used to contact the borrower and must be a valid address."},"homePhone":{"type":"string","description":"Home phone number.","nullable":true},"workPhone":{"type":"string","description":"Work phone number.","nullable":true},"mobilePhone":{"type":"string","description":"Mobile phone number.","nullable":true},"fax":{"type":"string","description":"Fax number.","nullable":true},"contactAddress":{"$ref":"#/components/schemas/Address"},"isSilenced":{"type":"boolean","description":"True when emails to the client are suppressed (for example after an unsubscribe). It does not remove their access. Left out, it is false, also on PATCH."},"isArchived":{"type":"boolean","description":"True when the client is archived and hidden from active lists. Left out, it is false, also on PATCH."},"createdOn":{"type":"string","description":"When the client was created, ISO 8601 in UTC. Set by the server; read-only.","format":"date-time","readOnly":true},"updatedOn":{"type":"string","description":"When the client was last changed, ISO 8601 in UTC. Set by the server; read-only.","format":"date-time","nullable":true,"readOnly":true},"fico":{"type":"integer","description":"The client's FICO credit score.","format":"int32","nullable":true},"totalIncome":{"type":"number","description":"Total income in dollars.","format":"double","nullable":true},"totalDebtPayments":{"type":"number","description":"Total monthly debt payments in dollars.","format":"double","nullable":true},"firstTimeBuyer":{"type":"boolean","description":"True when the client is a first-time home buyer.","nullable":true},"loginToken":{"type":"string","description":"A link that signs the holder in as this borrower, valid 30 days. Returned only when a single client is read, and omitted when the company's borrowers do not use the borrower portal. Treat it as a credential.","nullable":true},"id":{"type":"string","description":"Unique identifier (GUID) of the client (borrower). Set by the server; read-only.","format":"uuid","readOnly":true},"firstName":{"minLength":1,"type":"string","description":"Borrower's legal first name."},"lastName":{"minLength":1,"type":"string","description":"Borrower's legal last name."}},"additionalProperties":false,"description":"`contactAddress`: Optional. When sent, the address's own rules apply (state is required inside it). PUT clears the stored address when absent; PATCH keeps it. firstName, lastName and email are required on POST, PUT and PATCH alike. On PATCH, a text or number field left out or null keeps its stored value, but isSilenced and isArchived are set to false when left out."},"Address":{"required":["state"],"type":"object","properties":{"addressLine1":{"type":"string","description":"Street address, for example 123 Main St.","nullable":true},"addressLine2":{"type":"string","description":"Unit, suite or other second line; optional.","nullable":true},"city":{"type":"string","description":"City name.","nullable":true},"state":{"minLength":1,"type":"string","description":"Two-letter state code."},"zipCode":{"type":"string","description":"Postal (ZIP) code.","nullable":true}},"additionalProperties":false,"description":"A US mailing address."},"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."},"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":{"/clients/{id}":{"put":{"tags":["Borrowers"],"summary":"Replaces a Client","description":"**Required scope:** `update:clients`","operationId":"Clients_Put","parameters":[{"name":"id","in":"path","description":"The client's id. A client in another company, or a deleted one, answers 404.","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Client"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Modified"}}}},"401":{"description":"Missing, invalid or expired access token.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The access token lacks the update:clients scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}}}}
```

## Deletes Client by Id

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

```json
{"openapi":"3.0.4","info":{"title":"Henge Partner API","version":"1.22.0"},"tags":[{"name":"Borrowers","description":"Only available to POS customers.\n\nBorrowers (clients) of your company: find, create and update them, and email a client the invitation to the borrower portal. A client belongs to a loan officer (its owner) and can be the borrower on several loan applications.\n\n**Scopes:** `create:clients`, `delete:clients`, `read:clients`, `update:clients`"}],"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":{"/clients/{id}":{"delete":{"tags":["Borrowers"],"summary":"Deletes Client by Id","description":"**Required scope:** `delete:clients`","operationId":"Clients_Delete","parameters":[{"name":"id","in":"path","description":"Client GUID","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"204":{"description":"Client 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":"Client 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"}}}}}}}}}
```

## Updates a Client

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

```json
{"openapi":"3.0.4","info":{"title":"Henge Partner API","version":"1.22.0"},"tags":[{"name":"Borrowers","description":"Only available to POS customers.\n\nBorrowers (clients) of your company: find, create and update them, and email a client the invitation to the borrower portal. A client belongs to a loan officer (its owner) and can be the borrower on several loan applications.\n\n**Scopes:** `create:clients`, `delete:clients`, `read:clients`, `update:clients`"}],"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":{"Client":{"required":["email","firstName","lastName"],"type":"object","properties":{"externalId":{"type":"string","description":"Your own identifier for the client. Send it together with source; the pair identifies the client in your system.","nullable":true},"source":{"type":"string","description":"Name of your system that issued externalId. Send it with externalId: the pair identifies the client in your system. Not checked by the server: either may be sent without the other.","nullable":true},"ownerId":{"type":"string","description":"Unique identifier (GUID) of the user (loan officer) who owns the client.","format":"uuid","nullable":true},"referredById":{"type":"string","description":"Unique identifier (GUID) of the user who referred the client.","format":"uuid","nullable":true},"email":{"minLength":1,"pattern":"[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$","type":"string","description":"Client's email address; used to contact the borrower and must be a valid address."},"homePhone":{"type":"string","description":"Home phone number.","nullable":true},"workPhone":{"type":"string","description":"Work phone number.","nullable":true},"mobilePhone":{"type":"string","description":"Mobile phone number.","nullable":true},"fax":{"type":"string","description":"Fax number.","nullable":true},"contactAddress":{"$ref":"#/components/schemas/Address"},"isSilenced":{"type":"boolean","description":"True when emails to the client are suppressed (for example after an unsubscribe). It does not remove their access. Left out, it is false, also on PATCH."},"isArchived":{"type":"boolean","description":"True when the client is archived and hidden from active lists. Left out, it is false, also on PATCH."},"createdOn":{"type":"string","description":"When the client was created, ISO 8601 in UTC. Set by the server; read-only.","format":"date-time","readOnly":true},"updatedOn":{"type":"string","description":"When the client was last changed, ISO 8601 in UTC. Set by the server; read-only.","format":"date-time","nullable":true,"readOnly":true},"fico":{"type":"integer","description":"The client's FICO credit score.","format":"int32","nullable":true},"totalIncome":{"type":"number","description":"Total income in dollars.","format":"double","nullable":true},"totalDebtPayments":{"type":"number","description":"Total monthly debt payments in dollars.","format":"double","nullable":true},"firstTimeBuyer":{"type":"boolean","description":"True when the client is a first-time home buyer.","nullable":true},"loginToken":{"type":"string","description":"A link that signs the holder in as this borrower, valid 30 days. Returned only when a single client is read, and omitted when the company's borrowers do not use the borrower portal. Treat it as a credential.","nullable":true},"id":{"type":"string","description":"Unique identifier (GUID) of the client (borrower). Set by the server; read-only.","format":"uuid","readOnly":true},"firstName":{"minLength":1,"type":"string","description":"Borrower's legal first name."},"lastName":{"minLength":1,"type":"string","description":"Borrower's legal last name."}},"additionalProperties":false,"description":"`contactAddress`: Optional. When sent, the address's own rules apply (state is required inside it). PUT clears the stored address when absent; PATCH keeps it. firstName, lastName and email are required on POST, PUT and PATCH alike. On PATCH, a text or number field left out or null keeps its stored value, but isSilenced and isArchived are set to false when left out."},"Address":{"required":["state"],"type":"object","properties":{"addressLine1":{"type":"string","description":"Street address, for example 123 Main St.","nullable":true},"addressLine2":{"type":"string","description":"Unit, suite or other second line; optional.","nullable":true},"city":{"type":"string","description":"City name.","nullable":true},"state":{"minLength":1,"type":"string","description":"Two-letter state code."},"zipCode":{"type":"string","description":"Postal (ZIP) code.","nullable":true}},"additionalProperties":false,"description":"A US mailing address."},"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."},"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":{"/clients/{id}":{"patch":{"tags":["Borrowers"],"summary":"Updates a Client","description":"**Required scope:** `update:clients`","operationId":"Clients_Patch","parameters":[{"name":"id","in":"path","description":"The client's id. A client in another company, or a deleted one, answers 404.","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Client"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Modified"}}}},"401":{"description":"Missing, invalid or expired access token.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The access token lacks the update:clients scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}}}}
```

## Emails a Client the borrower portal invitation

> \*\*Required scope:\*\* \`update:clients\`\
> \
> The invitation the web app's Invite action sends, through the same email path, from the client's> \
> owning loan officer. The company's notification settings can still suppress borrower email, in> \
> which case nothing is sent and the call still succeeds.

```json
{"openapi":"3.0.4","info":{"title":"Henge Partner API","version":"1.22.0"},"tags":[{"name":"Borrowers","description":"Only available to POS customers.\n\nBorrowers (clients) of your company: find, create and update them, and email a client the invitation to the borrower portal. A client belongs to a loan officer (its owner) and can be the borrower on several loan applications.\n\n**Scopes:** `create:clients`, `delete:clients`, `read:clients`, `update:clients`"}],"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":{"/clients/{id}/email/invitation":{"post":{"tags":["Borrowers"],"summary":"Emails a Client the borrower portal invitation","description":"**Required scope:** `update:clients`\n\nThe invitation the web app's Invite action sends, through the same email path, from the client's\r\nowning loan officer. The company's notification settings can still suppress borrower email, in\r\nwhich case nothing is sent and the call still succeeds.","operationId":"Clients_SendInvitation","parameters":[{"name":"id","in":"path","description":"GUID of client to invite","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"copyType","in":"query","description":"Optional: \"cc\" or \"bcc\" copies the acting user on the email","schema":{"type":"string"}}],"responses":{"204":{"description":"Invitation sent"},"400":{"description":"Invalid copyType, or the client cannot be emailed","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":"Client not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"The client's company does not use the client portal","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Internal Server Error","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}}}}
```


---

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

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

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

```
GET https://api-docs.hengelending.com/api/api-reference/borrowers.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.
