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

# Reporting

**Reports:** Loan reporting and analytics: the current pipeline by stage, loans reaching each milestone per period, tasks and conditions across loans, aggregates by dimension, and condition categories against loan outcomes. Every report covers your company's loans only. `GET /reports/metadata` lists the values each filter accepts.

**Loan query:** Custom queries that return one row per loan, for when the fixed report filters are not enough. Read the available fields first: only those fields can be selected, filtered and sorted on. Results cover your company's loans only.

**Scopes:** `read:loans`, `read:reports`

## Custom whitelisted loan query

> \*\*Required scope:\*\* \`read:loans\`\
> \
> Not raw SQL. Fields come from a fixed whitelist (see GET loans/query/fields) and values are> \
> bound as parameters, so an unknown field key is rejected rather than interpolated. Read-only.

```json
{"openapi":"3.0.4","info":{"title":"Henge Partner API","version":"1.22.0"},"tags":[{"name":"Reporting","description":"**Reports:** Loan reporting and analytics: the current pipeline by stage, loans reaching each milestone per period, tasks and conditions across loans, aggregates by dimension, and condition categories against loan outcomes. Every report covers your company's loans only. `GET /reports/metadata` lists the values each filter accepts.\n\n**Loan query:** Custom queries that return one row per loan, for when the fixed report filters are not enough. Read the available fields first: only those fields can be selected, filtered and sorted on. Results cover your company's loans only.\n\n**Scopes:** `read:loans`, `read:reports`"}],"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":{"QueryLoansRequestDto":{"type":"object","properties":{"conditions":{"type":"array","items":{"$ref":"#/components/schemas/LoanQueryConditionDto"},"description":"WHERE conditions, AND'd. Fields come from a fixed whitelist (GET /loans/query/fields) and values are bound as parameters.","nullable":true},"select":{"type":"array","items":{"type":"string"},"description":"Field keys to return. Defaults to a standard loan summary.","nullable":true},"orderBy":{"type":"string","description":"Field key to sort by, from GET /loans/query/fields; a select-only field cannot be used.","nullable":true},"orderDescending":{"type":"boolean","description":"True (the default) to sort highest or newest first."},"skip":{"type":"integer","description":"Number of rows to skip, for paging; default 0.","format":"int32"},"top":{"type":"integer","description":"1-50, default 20.","format":"int32"}},"additionalProperties":false,"description":"A custom, whitelisted query returning one row per loan. Send {} for the 20 most recently updated loans."},"LoanQueryConditionDto":{"required":["field"],"type":"object","properties":{"field":{"type":"string","description":"Whitelisted field key. An unknown key is rejected, never interpolated."},"operator":{"$ref":"#/components/schemas/LoanQueryOperator"},"value":{"type":"string","description":"The value to compare the field with, as text; numbers and dates are parsed from it. Not used by the In operator, which takes values. Required for Eq, Ne, Gt, Gte, Lt and Lte.","nullable":true},"values":{"type":"array","items":{"type":"string"},"description":"Values for the In operator. Required, with at least one entry, for In.","nullable":true}},"additionalProperties":false,"description":"Send value for every operator except In, which takes values; Contains and StartsWith also accept no value (treated as empty text)."},"LoanQueryOperator":{"enum":["Eq","Ne","Gt","Gte","Lt","Lte","Contains","StartsWith","In"],"type":"string","description":"Comparison used in a query condition: Eq (equals), Ne (not equals), Gt (greater than), Gte (greater than or equal), Lt (less than), Lte (less than or equal), Contains (text contains), StartsWith (text starts with) or In (equals any of a list)."},"QueryLoansResponse":{"type":"object","properties":{"totalCount":{"type":"integer","description":"Number of loans matching the query, across every page.","format":"int32"},"skip":{"type":"integer","description":"Number of rows skipped before this page.","format":"int32"},"top":{"type":"integer","description":"Maximum number of rows on this page.","format":"int32"},"fields":{"type":"array","items":{"type":"string"},"description":"The field keys returned in each row, in order.","nullable":true},"rows":{"type":"array","items":{"type":"object","additionalProperties":{}},"description":"One object per loan, keyed by field key.","nullable":true}},"additionalProperties":false},"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":{"/loans/query":{"post":{"tags":["Reporting"],"summary":"Custom whitelisted loan query","description":"**Required scope:** `read:loans`\n\nNot raw SQL. Fields come from a fixed whitelist (see GET loans/query/fields) and values are\r\nbound as parameters, so an unknown field key is rejected rather than interpolated. Read-only.","operationId":"LoanQuery_QueryLoans","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/QueryLoansRequestDto"}}}},"responses":{"200":{"description":"Matching loans","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QueryLoansResponse"}}}},"400":{"description":"Unknown field, operator, or malformed value","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ValidationProblemDetails"}}}},"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"}}}},"500":{"description":"Internal Server Error","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}}}}
```

## Fields available to the custom loan query

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

```json
{"openapi":"3.0.4","info":{"title":"Henge Partner API","version":"1.22.0"},"tags":[{"name":"Reporting","description":"**Reports:** Loan reporting and analytics: the current pipeline by stage, loans reaching each milestone per period, tasks and conditions across loans, aggregates by dimension, and condition categories against loan outcomes. Every report covers your company's loans only. `GET /reports/metadata` lists the values each filter accepts.\n\n**Loan query:** Custom queries that return one row per loan, for when the fixed report filters are not enough. Read the available fields first: only those fields can be selected, filtered and sorted on. Results cover your company's loans only.\n\n**Scopes:** `read:loans`, `read:reports`"}],"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":{"LoanQueryFieldsResponse":{"type":"object","properties":{"operators":{"type":"array","items":{"type":"string"},"description":"The comparison operators a condition may use.","nullable":true},"fields":{"type":"array","items":{"$ref":"#/components/schemas/LoanQueryFieldInfo"},"description":"The fields a query may filter on or select, with how each may be used.","nullable":true}},"additionalProperties":false,"description":"The whitelist of fields a custom loan query may filter or select."},"LoanQueryFieldInfo":{"type":"object","properties":{"field":{"type":"string","description":"The field key to use in query conditions, `select` and `orderBy`.","nullable":true},"type":{"type":"string","description":"The field's data type: String, Number, Date, Guid or Boolean.","nullable":true},"scope":{"type":"string","description":"Whose data the field holds: Loan (the loan), Borrower (the loan's borrowers; filter only) or User (personal data, returned only to callers allowed to see it).","nullable":true},"canSelect":{"type":"boolean","description":"True when the field can be returned in the result rows."},"filterOnly":{"type":"boolean","description":"True when the field can be used in conditions but not returned in rows."},"selectOnly":{"type":"boolean","description":"Computed after the query (e.g. companyName): selectable, but not usable in conditions or orderBy."},"requiresUserDataAccess":{"type":"boolean","description":"True when the field holds personal data and is returned only to callers allowed to see it."},"description":{"type":"string","description":"What the field actually holds, for the fields whose key alone is misleading (see\r\n`LoanQuerySchema`). Omitted from the payload when absent so its presence is a signal:\r\na described field is one with a trap in it.","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":{"/loans/query/fields":{"get":{"tags":["Reporting"],"summary":"Fields available to the custom loan query","description":"**Required scope:** `read:loans`","operationId":"LoanQuery_Fields","responses":{"200":{"description":"Field whitelist","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoanQueryFieldsResponse"}}}},"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"}}}}}}}}}
```

## Condition categories vs. loan outcomes

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

```json
{"openapi":"3.0.4","info":{"title":"Henge Partner API","version":"1.22.0"},"tags":[{"name":"Reporting","description":"**Reports:** Loan reporting and analytics: the current pipeline by stage, loans reaching each milestone per period, tasks and conditions across loans, aggregates by dimension, and condition categories against loan outcomes. Every report covers your company's loans only. `GET /reports/metadata` lists the values each filter accepts.\n\n**Loan query:** Custom queries that return one row per loan, for when the fixed report filters are not enough. Read the available fields first: only those fields can be selected, filtered and sorted on. Results cover your company's loans only.\n\n**Scopes:** `read:loans`, `read:reports`"}],"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":{"LoanFilterDto":{"type":"object","properties":{"searchText":{"type":"string","description":"Case-insensitive match on loan number and borrower first/last name and email. All whitespace-separated tokens must match.","nullable":true},"statuses":{"type":"array","items":{"type":"string"},"description":"Exact LOS status names, OR'd together (e.g. \"Loan Funded\", \"Loan Underwriting\").","nullable":true},"loanTypes":{"type":"array","items":{"type":"string"},"description":"Exact loan type names (e.g. \"Conventional\", \"FHA\", \"VA\"). See GET /reports/metadata.","nullable":true},"purposes":{"type":"array","items":{"type":"string"},"description":"Exact loan purpose names (e.g. \"Purchase\", \"Refinance\"). See GET /reports/metadata.","nullable":true},"statusDateFrom":{"type":"string","description":"Loans whose CURRENT status was set on/after this date. Not \"closed in period\" - use the milestones report for that.","format":"date-time","nullable":true},"statusDateTo":{"type":"string","description":"Loans whose current status was set on or before this date.","format":"date-time","nullable":true},"closingDateFrom":{"type":"string","description":"Estimated closing date. Sparsely populated - an empty result usually means the field is unset, not that nothing closed.","format":"date-time","nullable":true},"closingDateTo":{"type":"string","description":"Estimated closing date on or before this date.","format":"date-time","nullable":true},"updatedFrom":{"type":"string","description":"Loans updated on or after this date and time.","format":"date-time","nullable":true},"updatedTo":{"type":"string","description":"Loans updated on or before this date and time.","format":"date-time","nullable":true},"loanOfficerIds":{"type":"array","items":{"type":"string","format":"uuid"},"description":"Restrict to these loan officers. Always applied in addition to your company scope, so it can only narrow the result.","nullable":true},"referringAgentId":{"type":"string","description":"Only loans referred by this user (GUID).","format":"uuid","nullable":true},"processorId":{"type":"string","description":"Only loans worked by this processor (GUID).","format":"uuid","nullable":true},"loanAmountMin":{"type":"number","description":"Minimum loan amount in dollars.","format":"double","nullable":true},"loanAmountMax":{"type":"number","description":"Maximum loan amount in dollars.","format":"double","nullable":true},"commissionMin":{"type":"number","description":"Locked compensation range, in USD.","format":"double","nullable":true},"commissionMax":{"type":"number","description":"Maximum locked compensation in dollars.","format":"double","nullable":true},"propertyState":{"type":"string","description":"Two-letter subject-property state code, e.g. \"FL\".","nullable":true}},"additionalProperties":false,"description":"Caller-supplied loan filter for the reporting endpoints. Send {} for no filter."},"ConditionOutcomeResponse":{"type":"object","properties":{"closedLoanTotal":{"type":"integer","description":"Distinct closed/funded loans (with conditions) in scope.","format":"int32"},"failedLoanTotal":{"type":"integer","description":"Distinct failed loans (with conditions) in scope.","format":"int32"},"categories":{"type":"array","items":{"$ref":"#/components/schemas/ConditionOutcomeRow"},"description":"One row per condition category with closed and failed counts and the failed share.","nullable":true},"note":{"type":"string","description":"A short explanation of how the figures were counted, to show beside the report.","nullable":true}},"additionalProperties":false},"ConditionOutcomeRow":{"type":"object","properties":{"conditionCategory":{"type":"string","description":"The condition category the row counts.","nullable":true},"closedLoanCount":{"type":"integer","description":"Distinct closed/funded loans that carried at least one condition in this category.","format":"int32"},"failedLoanCount":{"type":"integer","description":"Distinct failed (denied/withdrawn/cancelled/...) loans with at least one condition in this category.","format":"int32"},"closedConditionCount":{"type":"integer","description":"Number of conditions in this category on closed or funded loans.","format":"int32"},"failedConditionCount":{"type":"integer","description":"Number of conditions in this category on failed loans.","format":"int32"},"failedShare":{"type":"number","description":"FailedLoanCount / (FailedLoanCount + ClosedLoanCount). Higher = more associated with non-closing loans.","format":"double","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":{"/reports/conditions-by-outcome":{"post":{"tags":["Reporting"],"summary":"Condition categories vs. loan outcomes","description":"**Required scope:** `read:reports`","operationId":"Reports_ConditionsByOutcome","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoanFilterDto"}}}},"responses":{"200":{"description":"Per-category outcome counts","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConditionOutcomeResponse"}}}},"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"}}}},"500":{"description":"Internal Server Error","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}}}}
```

## Loans reaching each milestone per period

> \*\*Required scope:\*\* \`read:reports\`\
> \
> Reads persisted historical status crossings, so it still counts loans whose current status has> \
> since moved on. This is the endpoint for "how much did we close last quarter". A loan counts> \
> once per stage, in the period of its earliest crossing inside the look-back window, so the> \
> periods sum to unique loans; changing the look-back can move which period a loan falls in.

```json
{"openapi":"3.0.4","info":{"title":"Henge Partner API","version":"1.22.0"},"tags":[{"name":"Reporting","description":"**Reports:** Loan reporting and analytics: the current pipeline by stage, loans reaching each milestone per period, tasks and conditions across loans, aggregates by dimension, and condition categories against loan outcomes. Every report covers your company's loans only. `GET /reports/metadata` lists the values each filter accepts.\n\n**Loan query:** Custom queries that return one row per loan, for when the fixed report filters are not enough. Read the available fields first: only those fields can be selected, filtered and sorted on. Results cover your company's loans only.\n\n**Scopes:** `read:loans`, `read:reports`"}],"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":{"LoanMilestoneReportResponse":{"type":"object","properties":{"granularity":{"type":"string","description":"Size of each time bucket: Week or Month.","nullable":true},"groupBy":{"type":"string","description":"The dimension the milestones were grouped by.","nullable":true},"truncated":{"type":"boolean","description":"True when the buckets were capped and some are not shown."},"from":{"type":"string","description":"First day of the milestone-date window the buckets cover (inclusive).","format":"date"},"to":{"type":"string","description":"Last day of the milestone-date window the buckets cover (inclusive).","format":"date"},"note":{"type":"string","description":"A message about how to read the result, when there is one.","nullable":true},"buckets":{"type":"array","items":{"$ref":"#/components/schemas/MilestoneBucket"},"description":"The milestone counts per period and stage.","nullable":true}},"additionalProperties":false},"MilestoneBucket":{"type":"object","properties":{"period":{"type":"string","description":"First day of the week (yyyy-MM-dd) or the month (yyyy-MM) the loans first reached the stage.","nullable":true},"stage":{"type":"string","description":"Name of the milestone stage the loans reached.","nullable":true},"stageOrder":{"type":"integer","description":"Position of the stage in the loan pipeline, starting at 0.","format":"int32"},"loanCount":{"type":"integer","description":"Number of loans that reached the stage in the period.","format":"int32"},"loanAmount":{"type":"number","description":"Total loan amount of those loans, in dollars.","format":"double","nullable":true}},"additionalProperties":false},"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":{"/reports/loan-milestones":{"get":{"tags":["Reporting"],"summary":"Loans reaching each milestone per period","description":"**Required scope:** `read:reports`\n\nReads persisted historical status crossings, so it still counts loans whose current status has\r\nsince moved on. This is the endpoint for \"how much did we close last quarter\". A loan counts\r\nonce per stage, in the period of its earliest crossing inside the look-back window, so the\r\nperiods sum to unique loans; changing the look-back can move which period a loan falls in.","operationId":"Reports_LoanMilestones","parameters":[{"name":"granularity","in":"query","description":"The period loans are counted in: `Week` (weeks start on Monday) or `Month`, ignoring case. Defaults to `Month`; any other value counts as `Month`.","schema":{"type":"string","default":"Month"}},{"name":"lookback","in":"query","description":"How many periods to cover, counting the current one, up to today (UTC). Defaults to 4; a value of 0 or less counts as 4.","schema":{"type":"integer","format":"int32","default":4}},{"name":"groupByNorthstar","in":"query","description":"`true` (the default) to count by the five summary stages (`1. Opened` to `5. Closed & Funded`); `false` to count by each LOS milestone name.","schema":{"type":"boolean","default":true}},{"name":"excludeStages","in":"query","description":"Stages to leave out, matched exactly but ignoring case against the stage names in use (the summary stages, or milestone names when `groupByNorthstar` is `false`). Repeat the parameter for several. `GET /reports/metadata` lists the summary stages.","schema":{"type":"array","items":{"type":"string"}}}],"responses":{"200":{"description":"Milestone buckets","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoanMilestoneReportResponse"}}}},"400":{"description":"Invalid granularity","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ValidationProblemDetails"}}}},"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"}}}},"500":{"description":"Internal Server Error","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}}}}
```

## Current pipeline by stage, with monthly trend

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

```json
{"openapi":"3.0.4","info":{"title":"Henge Partner API","version":"1.22.0"},"tags":[{"name":"Reporting","description":"**Reports:** Loan reporting and analytics: the current pipeline by stage, loans reaching each milestone per period, tasks and conditions across loans, aggregates by dimension, and condition categories against loan outcomes. Every report covers your company's loans only. `GET /reports/metadata` lists the values each filter accepts.\n\n**Loan query:** Custom queries that return one row per loan, for when the fixed report filters are not enough. Read the available fields first: only those fields can be selected, filtered and sorted on. Results cover your company's loans only.\n\n**Scopes:** `read:loans`, `read:reports`"}],"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":{"LoanPipelineReportResponse":{"type":"object","properties":{"currentPipelineByStage":{"type":"array","items":{"$ref":"#/components/schemas/LoanPipelineStageCount"},"description":"Snapshot distribution of loans across pipeline stages, ordered by stage.","nullable":true},"monthlyTrend":{"type":"array","items":{"$ref":"#/components/schemas/LoanPipelinePeriodCount"},"description":"Loan activity (by status date) per month for the requested look-back window.","nullable":true},"activeLoanCount":{"type":"integer","description":"Count of loans in non-terminal stages.","format":"int32"},"note":{"type":"string","description":"A short explanation of how the figures were counted, to show beside the report.","nullable":true}},"additionalProperties":false},"LoanPipelineStageCount":{"type":"object","properties":{"stage":{"type":"string","description":"Name of the pipeline stage.","nullable":true},"order":{"type":"integer","description":"The stage's position in the pipeline; stages are listed in this order.","format":"int32"},"isTerminal":{"type":"boolean","description":"True for an end stage (closed, denied, withdrawn and the like); loans in it are not counted as active."},"count":{"type":"integer","description":"Number of loans currently in the stage.","format":"int32"},"totalLoanAmount":{"type":"number","description":"Sum of the loan amounts of the loans in the stage, in dollars.","format":"double","nullable":true},"statuses":{"type":"array","items":{"type":"string"},"description":"The loan statuses that roll up into this stage.","nullable":true}},"additionalProperties":false},"LoanPipelinePeriodCount":{"type":"object","properties":{"period":{"type":"string","description":"The month, formatted yyyy-MM.","nullable":true},"count":{"type":"integer","description":"Number of loans with activity in the month.","format":"int32"},"totalLoanAmount":{"type":"number","description":"Sum of the loan amounts of those loans, in dollars.","format":"double","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":{"/reports/loan-pipeline":{"get":{"tags":["Reporting"],"summary":"Current pipeline by stage, with monthly trend","description":"**Required scope:** `read:reports`","operationId":"Reports_LoanPipeline","parameters":[{"name":"lookbackMonths","in":"query","description":"How many months of trend to return. Defaults to 3; a value of 0 or less counts as 3.","schema":{"type":"integer","format":"int32","default":3}}],"responses":{"200":{"description":"Pipeline snapshot","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoanPipelineReportResponse"}}}},"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"}}}},"500":{"description":"Internal Server Error","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}}}}
```

## Search loan tasks and conditions

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

```json
{"openapi":"3.0.4","info":{"title":"Henge Partner API","version":"1.22.0"},"tags":[{"name":"Reporting","description":"**Reports:** Loan reporting and analytics: the current pipeline by stage, loans reaching each milestone per period, tasks and conditions across loans, aggregates by dimension, and condition categories against loan outcomes. Every report covers your company's loans only. `GET /reports/metadata` lists the values each filter accepts.\n\n**Loan query:** Custom queries that return one row per loan, for when the fixed report filters are not enough. Read the available fields first: only those fields can be selected, filtered and sorted on. Results cover your company's loans only.\n\n**Scopes:** `read:loans`, `read:reports`"}],"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":{"GetTasksPipelineResponse":{"type":"object","properties":{"count":{"type":"integer","description":"Total number of tasks or conditions matching the query, before paging.","format":"int32"},"value":{"type":"array","items":{"$ref":"#/components/schemas/TaskPipelineItem"},"description":"The page of tasks or conditions returned.","nullable":true}},"additionalProperties":false},"TaskPipelineItem":{"type":"object","properties":{"loanApplicationId":{"type":"string","description":"Id (GUID) of the loan the task or condition belongs to.","format":"uuid"},"externalLoanNumber":{"type":"string","description":"The loan's number in the Loan Origination System.","nullable":true},"borrowers":{"type":"array","items":{"type":"string"},"description":"Names of the loan's borrowers.","nullable":true},"agent":{"$ref":"#/components/schemas/LoanAppUser"},"referredBy":{"$ref":"#/components/schemas/LoanAppUser"},"isLocalCondition":{"type":"boolean","description":"True for a condition row that groups the loan's document requests by document type. It is not a task: its id is empty and its status is null."},"groupCode":{"type":"string","description":"For a grouped condition row, the code of the document type group it stands for; null otherwise.","nullable":true},"taskCount":{"type":"integer","description":"For a grouped condition row, the number of document requests in it. A request with several documents counts once.","format":"int32"},"requestedTaskCount":{"type":"integer","description":"For a grouped condition row, how many of its document requests are still in the Requested status.","format":"int32"},"id":{"type":"string","description":"Id of the task or condition (GUID).","format":"uuid","nullable":true},"taskStatusTimestamp":{"type":"string","description":"When the task's status last changed (ISO 8601 date and time, UTC).","format":"date-time","nullable":true},"updatedTimestamp":{"type":"string","description":"When the task was last changed (ISO 8601 date and time, UTC).","format":"date-time"},"createdTimestamp":{"type":"string","description":"When the task was created (ISO 8601 date and time, UTC).","format":"date-time"},"item":{"$ref":"#/components/schemas/Item"},"assignedToBorrowerId":{"type":"string","description":"Id (GUID) of the borrower the task is assigned to. Null for a user task or a task for the loan's borrowers generally.","format":"uuid","nullable":true},"status":{"$ref":"#/components/schemas/TaskStatus"},"document":{"$ref":"#/components/schemas/Document"},"rejectionReasonNote":{"type":"string","description":"The reviewer's free-text note when the task's document was rejected.","nullable":true},"rejectionReason":{"$ref":"#/components/schemas/TaskRejectionReason"},"creditReportType":{"$ref":"#/components/schemas/PosCreditReportType"},"isForPrimaryBorrower":{"type":"boolean","description":"True when the task is for the primary borrower, false when it is for the co-borrower. Null when it is for neither in particular.","nullable":true},"isRequired":{"type":"boolean","description":"Whether the task must be completed before the file can move forward."},"isAccountMainTask":{"type":"boolean","description":"True for the main task of an asset account, the one that requests the account's statements."},"questionType":{"$ref":"#/components/schemas/TaskQuestionType"},"yesNoResponse":{"type":"boolean","description":"The borrower's answer to a yes/no question task. Null until answered.","nullable":true},"shortAnswer":{"type":"string","description":"The borrower's answer to a short-answer question task. Null until answered.","nullable":true},"assignedToUser":{"$ref":"#/components/schemas/LoanAppUser"},"name":{"type":"string","description":"Display name of the task or condition.","nullable":true},"description":{"type":"string","description":"Description of the task. For a condition, the condition text: the reworded text when staff edited it in Henge, otherwise the LOS text.","nullable":true},"displayOrder":{"type":"integer","description":"Position of the task among its siblings, lowest first.","format":"int32","nullable":true},"type":{"$ref":"#/components/schemas/TaskType"},"code":{"type":"string","description":"Short code of the task.","nullable":true},"conditionNo":{"type":"integer","description":"Condition number in the LOS. Conditions only.","format":"int32","nullable":true},"conditionCategory":{"type":"string","description":"Category of the condition in the LOS. Conditions only.","nullable":true},"conditionDueDate":{"type":"string","description":"Due date of the condition (ISO 8601 date). Conditions only.","format":"date","nullable":true},"conditionAssignedUserFullName":{"type":"string","description":"Full name of the user the condition is assigned to in the LOS. Conditions only.","nullable":true},"conditionBorrowerFullName":{"type":"string","description":"Full name of the borrower the condition is for. Conditions only.","nullable":true},"conditionIsHidden":{"type":"boolean","description":"True when the condition is hidden from the borrower. Staff roles still see it; a caller that receives a hidden condition is entitled to it.","nullable":true},"conditionSourceText":{"type":"string","description":"The LOS's original condition text. Set only when staff reworded the condition in Henge, in which case description carries the rewording; null otherwise.","nullable":true},"isConditionTextEdited":{"type":"boolean","description":"True when staff reworded this condition in Henge. The rewording is never sent to the LOS."},"notes":{"type":"string","description":"Notes on the task or condition.","nullable":true},"taskAssignmentType":{"$ref":"#/components/schemas/TaskAssignmentType"},"isSubscribed":{"type":"boolean","description":"Whether the calling user is subscribed to status-change notifications for this task. Null when not computed.","nullable":true},"conditionTaskId":{"type":"string","description":"Id (GUID) of the condition this task belongs to. Null on conditions and on standalone tasks. Read on create; ignored on update.","format":"uuid","nullable":true},"assetAccountId":{"type":"string","description":"Id (GUID) of the asset account the task belongs to, if any. Needed on create only for a Transaction History task; ignored on update.","format":"uuid","nullable":true},"assetAccountName":{"type":"string","description":"Name of the asset account the task belongs to. Response only, and filled only where the response includes accounts.","nullable":true},"creditReportNumber":{"type":"string","description":"For credit report tasks, the credit agency's report number.","nullable":true},"requestTaskId":{"type":"string","description":"Id of the first task of the document request this task is a copy of (one task per document). Null on the first task itself. On create, naming any task of a request makes the new task a copy that joins that request.","format":"uuid","nullable":true},"requestedStartDate":{"type":"string","description":"Transaction History tasks only: the first day of the period the account activity must cover (ISO 8601 date).","format":"date","nullable":true},"requestedEndDate":{"type":"string","description":"Transaction History tasks only: the last day of the period the account activity must cover (ISO 8601 date).","format":"date","nullable":true},"ownerPairId":{"type":"string","description":"Id (GUID) of the borrower pair staff made the owner of this task or condition. Empty when the owner is worked out on read.","format":"uuid","nullable":true},"appliesToAllPairs":{"type":"boolean","description":"True for a whole-loan task or condition that every borrower pair sees."}},"additionalProperties":false},"LoanAppUser":{"type":"object","properties":{"id":{"type":"string","description":"Id of the user (GUID).","format":"uuid"},"firstName":{"type":"string","description":"The user's first name.","nullable":true},"lastName":{"type":"string","description":"The user's last name.","nullable":true}},"additionalProperties":false,"description":"A user, such as the staff member a task is assigned to."},"Item":{"type":"object","properties":{"id":{"type":"string","description":"Id of the item (GUID).","format":"uuid"},"code":{"type":"string","description":"Stable code of the item; send it as the item code when you create a task.","nullable":true},"name":{"type":"string","description":"Display name of the item.","nullable":true},"groupCode":{"type":"string","description":"Code of the condition group the item's tasks are shown under. Null means Other.","nullable":true},"canCreateManually":{"type":"boolean","description":"True when staff can create a task for this item by hand."},"canUploadDocument":{"type":"boolean","description":"True when a document can be uploaded against this item."}},"additionalProperties":false,"description":"A kind of request a task can ask for, such as a specific document."},"TaskStatus":{"type":"object","properties":{"id":{"type":"string","description":"Id of the status (GUID).","format":"uuid"},"code":{"type":"string","description":"Stable code of the status.","nullable":true},"name":{"type":"string","description":"Display name of the status.","nullable":true}},"additionalProperties":false,"description":"The status of a task, for example Requested, Uploaded, Submitted or Accepted."},"Document":{"type":"object","properties":{"id":{"type":"string","description":"Id (GUID) of the document.","format":"uuid"},"name":{"type":"string","description":"The document's file name.","nullable":true},"externalId":{"type":"string","description":"The document's id in the Loan Origination System; empty until it has been sent there.","nullable":true},"isPdfConversionComplete":{"type":"boolean","description":"True once an uploaded file has been converted to PDF and can be opened; false while conversion is still running."},"loanApplicationId":{"type":"string","description":"Id (GUID) of the loan the document belongs to.","format":"uuid","nullable":true},"loanApplicationTaskId":{"type":"string","description":"Id of the task or condition the document is attached to; null for a document uploaded straight to the loan.","format":"uuid","nullable":true},"blobName":{"type":"string","description":"The name the file is stored under. An internal storage key: download through the document routes rather than using it.","nullable":true},"createdTimestamp":{"type":"string","description":"When the document was created, in UTC (ISO 8601).","format":"date-time"},"updatedTimestamp":{"type":"string","description":"When the document was last changed, in UTC (ISO 8601).","format":"date-time"},"updatedBy":{"type":"string","description":"Id of the user who last changed the document; null when the change was automatic or unknown.","format":"uuid","nullable":true},"documentTypeId":{"type":"string","description":"Id of the platform's broad document category (such as a vault or task document). Not the loan document type, which is loanDocumentTypeId.","format":"uuid","nullable":true},"isVault":{"type":"boolean","description":"True when the document was uploaded straight to the loan's vault, false when it hangs off a\r\ntask, a condition or an asset account. Callers use it to decide what a user may do with the\r\ndocument: only a vault document can be deleted. Any document can be given a document type."},"loanDocumentTypeId":{"type":"string","description":"Id of the loan document type the document is filed under (from the loan document types list); null when it has none.","format":"uuid","nullable":true},"loanDocumentTypeName":{"type":"string","description":"Name of the loan document type; null when the document has none.","nullable":true},"loanDocumentTypeExternalId":{"type":"string","description":"The loan document type's id in the Loan Origination System.","nullable":true},"loanDocumentTypeFolderName":{"type":"string","description":"Name of the folder the loan document type belongs to; null when the document has no type.","nullable":true},"description":{"type":"string","description":"A free-text description of the document; may be empty.","nullable":true},"isDeleted":{"type":"boolean","description":"True when the document has been deleted. Deleted documents are normally left out of lists."},"isInternal":{"type":"boolean","description":"True for a staff-only document that is hidden from borrowers and partner applications."},"isObsolete":{"type":"boolean","description":"The LOS no longer considers this document active. It stays visible so users can still see\r\nit, but it is not current and is never pushed back to the LOS."},"isProtected":{"type":"boolean","description":"The LOS holds the document as Protected, locked there against edits and deletion. Set and\r\ncleared by Admin and Processor through the document status endpoints, or in the LOS itself."},"losStatus":{"$ref":"#/components/schemas/LoanDocumentLosStatus"},"title":{"type":"string","description":"The title shown for the document; may be empty, in which case the file name is shown.","nullable":true},"splitFromDocumentId":{"type":"string","description":"On a part of a split combined PDF: the id of the original document it was cut from. Null on every other document.","format":"uuid","nullable":true},"splitStartPage":{"type":"integer","description":"On a part of a split combined PDF: the first page of the original it holds. Null on every other document.","format":"int32","nullable":true},"splitEndPage":{"type":"integer","description":"On a part of a split combined PDF: the last page of the original it holds. Null on every other document.","format":"int32","nullable":true},"isUnsorted":{"type":"boolean","description":"True while the document was bulk-uploaded to the loan with no task and no type and nobody has\r\nsorted it. It is held out of the LOS until it is put on a task or given a type."},"hasNoFile":{"type":"boolean","description":"True for a staff-only entry the Loan Origination System holds with no file here (a non-PDF assigned to a condition): there is nothing to open, download or move."},"intakeStatus":{"type":"string","description":"NeedsPassword or Duplicate for a bulk-uploaded document that is held for that reason; null\r\notherwise. See DocumentIntakeStatuses.","nullable":true},"duplicateOfDocumentId":{"type":"string","description":"The existing document this one repeats, when IntakeStatus is Duplicate.","format":"uuid","nullable":true},"indexStatus":{"type":"string","description":"Whether the document's text is searchable: Indexed, Pending, Failed or NotSubmitted. Set by\r\nthe document lists for staff callers; null when it was not looked up, or the lookup failed.","nullable":true},"analysis":{"$ref":"#/components/schemas/DocumentAnalysisSummary"},"internalNotes":{"type":"string","description":"Staff-only internal notes on the document, verbatim from the Loan Origination System. Returned only to callers who may see internal notes; null for everyone else.","nullable":true}},"additionalProperties":false,"description":"A document on a loan: the file, the task or condition it is attached to, its type and its status."},"LoanDocumentLosStatus":{"enum":["Active","Protected","Obsolete","Rejected","Screened"],"type":"string","description":"A loan document's status, one value per document, set here or in the LOS and kept in step both ways. The names are the LOS's own; the app shows Active as Pending, Screened as Accepted and Obsolete as Deleted."},"DocumentAnalysisSummary":{"type":"object","properties":{"status":{"type":"string","description":"Pending, Completed, Failed or Skipped. Failed reads \"Not analysed\".","nullable":true},"verdict":{"type":"string","description":"Whether the document is what was asked for: Matches, Mismatch, Unreadable or Unknown.","nullable":true},"reasonCode":{"type":"string","description":"On a Mismatch, why: WrongDocument, WrongPeriod, WrongAccount, WrongBorrower, MissingPages or Expired. On an Unreadable verdict from the page quality check, UnreadablePages.","nullable":true},"reason":{"type":"string","description":"One line in plain language explaining the verdict, written for the borrower.","nullable":true},"suggestedRejectionReasonCode":{"type":"string","description":"The seeded TaskRejectionReason code the panel pre-selects for a Mismatch.","nullable":true},"suggestedTaskId":{"type":"string","description":"Id of the task or condition the document appears to belong to; null when none matched.","format":"uuid","nullable":true},"suggestedTaskName":{"type":"string","description":"Name of the suggested task or condition.","nullable":true},"isOnSuggestedTask":{"type":"boolean","description":"False when the document sits on a different task than the best match: shown for confirmation."},"matchConfidence":{"type":"number","description":"How sure the analysis is of the suggested task, from 0 to 1.","format":"double","nullable":true},"suggestedLoanDocumentTypeId":{"type":"string","description":"Id of the loan document type the document looks like; null when not determined.","format":"uuid","nullable":true},"suggestedLoanDocumentTypeName":{"type":"string","description":"Name of the suggested loan document type.","nullable":true},"suggestedTitle":{"type":"string","description":"The title the analysis suggests for the document, built from what it read (for example the account and statement period).","nullable":true},"titleAppliedAutomatically":{"type":"boolean","description":"True when the document's current title was set by the analysis rather than by a person."},"previousTitle":{"type":"string","description":"The title the document had before the analysis renamed it; null when it was not renamed.","nullable":true},"autoNameDisabled":{"type":"boolean","description":"True when a person undid an automatic name; the analysis never renames this document again."},"filedByType":{"type":"boolean","description":"Filed under the suggested LOS type and folder by the analysis, for a person to confirm or correct."},"duplicateOfDocumentId":{"type":"string","description":"Id of an earlier document on the loan with the same content, when this one repeats it; otherwise null.","format":"uuid","nullable":true},"supersedesDocumentId":{"type":"string","description":"Id of an earlier document this one replaces (a newer version of the same document); otherwise null.","format":"uuid","nullable":true},"supersededByDocumentId":{"type":"string","description":"Id of a newer document that replaces this one; otherwise null.","format":"uuid","nullable":true},"outcome":{"type":"string","description":"What a person did with the suggestion: Confirmed, Corrected, Rejected or Ignored; null while no one has acted.","nullable":true},"outcomeAt":{"type":"string","description":"When the person acted on the suggestion, in UTC (ISO 8601); null while no one has.","format":"date-time","nullable":true},"coveredPeriods":{"type":"array","items":{"type":"string"},"description":"For a request that needs a span of statements, the months the uploaded documents cover, each formatted yyyy-MM.","nullable":true},"missingPeriods":{"type":"array","items":{"type":"string"},"description":"The requested months no uploaded document covers yet, each formatted yyyy-MM.","nullable":true},"monthsMissing":{"type":"integer","description":"How many months of the request are still missing.","format":"int32","nullable":true},"analyzedAt":{"type":"string","description":"When the analysis was done, in UTC (ISO 8601).","format":"date-time"},"splitSuggestion":{"$ref":"#/components/schemas/SplitSuggestion"},"pageIssues":{"type":"array","items":{"$ref":"#/components/schemas/PageIssue"},"description":"The pages the quality check flagged, which the Unreadable-page request names.","nullable":true}},"additionalProperties":false,"description":"What the document review shows for a document: the suggested task, type and title, the verdict and whether the title was applied automatically. The evidence and page text the analysis read are not included."},"SplitSuggestion":{"type":"object","properties":{"pageCount":{"type":"integer","description":"Number of pages in the PDF that was analysed.","format":"int32"},"parts":{"type":"array","items":{"$ref":"#/components/schemas/SplitPartRange"},"description":"The suggested page ranges, one per document found.","nullable":true},"reason":{"type":"string","description":"The segmenter's account of why, e.g. \"3 document(s) across 12 page(s)\".","nullable":true}},"additionalProperties":false,"description":"The split suggested for a PDF that holds several documents and was not split on upload. Nothing changes until a person accepts it."},"SplitPartRange":{"type":"object","properties":{"startPage":{"type":"integer","description":"First page of the run, counting from 1.","format":"int32"},"endPage":{"type":"integer","description":"Last page of the run, inclusive.","format":"int32"},"loanDocumentTypeId":{"type":"string","description":"What the segmenter took the run to be, for the suggestion only. Never trusted when splitting.","format":"uuid","nullable":true},"loanDocumentTypeName":{"type":"string","description":"Name of the document type the run was taken to be, for the suggestion only.","nullable":true}},"additionalProperties":false,"description":"One run of pages of a combined PDF that is one document. 1-based, inclusive."},"PageIssue":{"type":"object","properties":{"page":{"type":"integer","description":"The page the issue is on, starting at 1.","format":"int32"},"kind":{"type":"string","description":"The problem found: Blank (no text), LowConfidence (scan quality too low to read reliably) or CutOff (text stops mid-sentence).","nullable":true}},"additionalProperties":false,"description":"A page the quality check flagged. 1-based, in the document the analysis read."},"TaskRejectionReason":{"type":"object","properties":{"id":{"type":"string","description":"Id of the rejection reason (GUID).","format":"uuid"},"name":{"type":"string","description":"Display name of the rejection reason.","nullable":true},"code":{"type":"string","description":"Stable code of the rejection reason.","nullable":true},"displayOrder":{"type":"integer","description":"Position of the reason in lists, lowest first.","format":"int32","nullable":true}},"additionalProperties":false,"description":"A reason a reviewer gives for rejecting a task's document."},"PosCreditReportType":{"type":"object","properties":{"id":{"type":"string","description":"Id of the report type (GUID).","format":"uuid","nullable":true},"code":{"type":"string","description":"Stable code of the report type.","nullable":true},"name":{"type":"string","description":"Display name of the report type.","nullable":true}},"additionalProperties":false,"description":"The type of credit report a credit report task asks for."},"TaskQuestionType":{"type":"object","properties":{"id":{"type":"string","description":"Id of the question type (GUID).","format":"uuid"},"name":{"type":"string","description":"Display name of the question type.","nullable":true},"code":{"type":"string","description":"Stable code of the question type.","nullable":true},"displayOrder":{"type":"integer","description":"Position of the question type in lists, lowest first.","format":"int32","nullable":true}},"additionalProperties":false,"description":"For a question task, the kind of answer it asks for, such as yes/no or a short answer."},"TaskType":{"type":"object","properties":{"id":{"type":"string","description":"Id of the task type (GUID).","format":"uuid"},"code":{"type":"string","description":"Stable code of the task type.","nullable":true},"name":{"type":"string","description":"Display name of the task type.","nullable":true}},"additionalProperties":false,"description":"The kind of task."},"TaskAssignmentType":{"type":"object","properties":{"id":{"type":"string","description":"Id of the assignment type (GUID).","format":"uuid"},"code":{"type":"string","description":"Stable code of the assignment type.","nullable":true},"name":{"type":"string","description":"Display name of the assignment type.","nullable":true}},"additionalProperties":false,"description":"Who a task is assigned to: a borrower or a user."},"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":{"/reports/loan-tasks":{"get":{"tags":["Reporting"],"summary":"Search loan tasks and conditions","description":"**Required scope:** `read:reports`","operationId":"Reports_SearchLoanTasks","parameters":[{"name":"searchText","in":"query","description":"Free text. Split on spaces, and every word must match part of the loan number, the task's name, or a borrower's first or last name, ignoring case.","schema":{"type":"string"}},{"name":"taskStatus","in":"query","description":"Only tasks with this status code, matched exactly: `Requested`, `InProgress`, `Uploaded`, `Submitted`, `Processing`, `Accepted` or `Rejected`.","schema":{"type":"string"}},{"name":"conditionCategory","in":"query","description":"Only tasks whose condition category is exactly this, as the LOS names it.","schema":{"type":"string"}},{"name":"assignedToUserName","in":"query","description":"Only tasks assigned to someone whose full name contains this text, ignoring case.","schema":{"type":"string"}},{"name":"orderBy","in":"query","description":"Sort order, ignoring case: one of `createdtimestamp`, `name`, `status`, `duedate`, `loannumber`, `borrower`, `loanofficer`, `category` or `assigned`, followed by a space and `asc` or `desc`, or `updatedtimestamp asc`. Defaults to most recently updated first; any other value also sorts that way.","schema":{"type":"string"}},{"name":"top","in":"query","description":"The number of tasks to return. Defaults to 25; a value of 0 or less counts as 25.","schema":{"type":"integer","format":"int32","default":25}},{"name":"skip","in":"query","description":"The number of matching tasks to skip before the page starts. Defaults to 0; a negative value counts as 0.","schema":{"type":"integer","format":"int32","default":0}}],"responses":{"200":{"description":"Matching tasks","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetTasksPipelineResponse"}}}},"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"}}}},"500":{"description":"Internal Server Error","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}}}}
```

## Aggregate loans by dimension and metric

> \*\*Required scope:\*\* \`read:reports\`\
> \
> A point-in-time aggregate over loans' CURRENT attributes. It cannot answer "how much did we> \
> close in period X" - loans do not stay at a terminal status, so a current-status filter> \
> undercounts badly. Use the milestones report for that.

```json
{"openapi":"3.0.4","info":{"title":"Henge Partner API","version":"1.22.0"},"tags":[{"name":"Reporting","description":"**Reports:** Loan reporting and analytics: the current pipeline by stage, loans reaching each milestone per period, tasks and conditions across loans, aggregates by dimension, and condition categories against loan outcomes. Every report covers your company's loans only. `GET /reports/metadata` lists the values each filter accepts.\n\n**Loan query:** Custom queries that return one row per loan, for when the fixed report filters are not enough. Read the available fields first: only those fields can be selected, filtered and sorted on. Results cover your company's loans only.\n\n**Scopes:** `read:loans`, `read:reports`"}],"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":{"ReportLoansRequestDto":{"type":"object","properties":{"filter":{"$ref":"#/components/schemas/LoanFilterDto"},"groupBy":{"$ref":"#/components/schemas/LoanGroupByDimension"},"metric":{"$ref":"#/components/schemas/LoanMetricFunction"},"metricField":{"$ref":"#/components/schemas/LoanMetricField"},"dateField":{"$ref":"#/components/schemas/LoanDateField"}},"additionalProperties":false,"description":"Group-by + metric aggregation over the loan snapshot."},"LoanFilterDto":{"type":"object","properties":{"searchText":{"type":"string","description":"Case-insensitive match on loan number and borrower first/last name and email. All whitespace-separated tokens must match.","nullable":true},"statuses":{"type":"array","items":{"type":"string"},"description":"Exact LOS status names, OR'd together (e.g. \"Loan Funded\", \"Loan Underwriting\").","nullable":true},"loanTypes":{"type":"array","items":{"type":"string"},"description":"Exact loan type names (e.g. \"Conventional\", \"FHA\", \"VA\"). See GET /reports/metadata.","nullable":true},"purposes":{"type":"array","items":{"type":"string"},"description":"Exact loan purpose names (e.g. \"Purchase\", \"Refinance\"). See GET /reports/metadata.","nullable":true},"statusDateFrom":{"type":"string","description":"Loans whose CURRENT status was set on/after this date. Not \"closed in period\" - use the milestones report for that.","format":"date-time","nullable":true},"statusDateTo":{"type":"string","description":"Loans whose current status was set on or before this date.","format":"date-time","nullable":true},"closingDateFrom":{"type":"string","description":"Estimated closing date. Sparsely populated - an empty result usually means the field is unset, not that nothing closed.","format":"date-time","nullable":true},"closingDateTo":{"type":"string","description":"Estimated closing date on or before this date.","format":"date-time","nullable":true},"updatedFrom":{"type":"string","description":"Loans updated on or after this date and time.","format":"date-time","nullable":true},"updatedTo":{"type":"string","description":"Loans updated on or before this date and time.","format":"date-time","nullable":true},"loanOfficerIds":{"type":"array","items":{"type":"string","format":"uuid"},"description":"Restrict to these loan officers. Always applied in addition to your company scope, so it can only narrow the result.","nullable":true},"referringAgentId":{"type":"string","description":"Only loans referred by this user (GUID).","format":"uuid","nullable":true},"processorId":{"type":"string","description":"Only loans worked by this processor (GUID).","format":"uuid","nullable":true},"loanAmountMin":{"type":"number","description":"Minimum loan amount in dollars.","format":"double","nullable":true},"loanAmountMax":{"type":"number","description":"Maximum loan amount in dollars.","format":"double","nullable":true},"commissionMin":{"type":"number","description":"Locked compensation range, in USD.","format":"double","nullable":true},"commissionMax":{"type":"number","description":"Maximum locked compensation in dollars.","format":"double","nullable":true},"propertyState":{"type":"string","description":"Two-letter subject-property state code, e.g. \"FL\".","nullable":true}},"additionalProperties":false,"description":"Caller-supplied loan filter for the reporting endpoints. Send {} for no filter."},"LoanGroupByDimension":{"enum":["None","Status","LoanType","Purpose","LoanOfficer","ReferringAgent","Month","Quarter","Year","Company","Day"],"type":"string","description":"What to group loans by: None (one bucket), Status, LoanType, Purpose, LoanOfficer, ReferringAgent, Month, Quarter, Year, Company or Day. Month, Quarter, Year and Day bucket by the chosen date field."},"LoanMetricFunction":{"enum":["Count","Sum","Average","Min","Max"],"type":"string","description":"How to combine the metric field across a bucket: Count, Sum, Average, Min or Max."},"LoanMetricField":{"enum":["LoanAmount","LockedCompensation","EstimatedCompensation"],"type":"string","description":"The loan figure to measure: LoanAmount (dollars), LockedCompensation (compensation on locked loans, dollars) or EstimatedCompensation (estimated compensation, dollars)."},"LoanDateField":{"enum":["StatusDate","ClosingDate","Updated","Created"],"type":"string","description":"Which date drives Month/Quarter/Year bucketing."},"LoanAggregationResponse":{"type":"object","properties":{"groupBy":{"type":"string","description":"The dimension the loans were grouped by.","nullable":true},"metric":{"type":"string","description":"The loan field that was measured, for example LoanAmount.","nullable":true},"function":{"type":"string","description":"The function applied to the metric: Count, Sum, Average, Min or Max.","nullable":true},"totalCount":{"type":"integer","description":"Total loans matched by the filter (sum across buckets).","format":"int32"},"bucketCount":{"type":"integer","description":"Number of buckets returned.","format":"int32"},"truncated":{"type":"boolean","description":"True when buckets were capped (high-cardinality group-by); see BucketCount."},"buckets":{"type":"array","items":{"$ref":"#/components/schemas/LoanAggregationBucket"},"description":"The result buckets.","nullable":true}},"additionalProperties":false},"LoanAggregationBucket":{"type":"object","properties":{"key":{"type":"string","description":"Bucket label: status name, \"2026-06\", \"2026-Q2\", \"2026\", a loan-officer name, or \"all\".","nullable":true},"keyId":{"type":"string","description":"Set when grouping by LoanOfficer / ReferringAgent so the caller can drill back via search_loans.","format":"uuid","nullable":true},"count":{"type":"integer","description":"Number of loans in the bucket.","format":"int32"},"inLosCount":{"type":"integer","description":"Loans in the bucket that have a loan number in the LOS, that is, that have reached it.","format":"int32"},"keys":{"type":"array","items":{"$ref":"#/components/schemas/LoanAggregationKey"},"description":"One entry per grouping dimension (groupBy, then each thenBy), in order. `Key` and\r\n`KeyId` repeat the first, so single-dimension callers read what they always read.","nullable":true},"sum":{"type":"number","description":"Sum of the chosen metric field over the bucket's loans; null when no loan has a value.","format":"double","nullable":true},"average":{"type":"number","description":"Average of the chosen metric field over the bucket's loans.","format":"double","nullable":true},"min":{"type":"number","description":"Smallest value of the chosen metric field in the bucket.","format":"double","nullable":true},"max":{"type":"number","description":"Largest value of the chosen metric field in the bucket.","format":"double","nullable":true}},"additionalProperties":false},"LoanAggregationKey":{"type":"object","properties":{"dimension":{"type":"string","description":"The grouping dimension this key belongs to.","nullable":true},"key":{"type":"string","description":"The bucket's value on this dimension: a name for officers, referrers and companies when resolvable.","nullable":true},"keyId":{"type":"string","description":"Set for LoanOfficer, ReferringAgent and Company.","format":"uuid","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":{"/reports/loans":{"post":{"tags":["Reporting"],"summary":"Aggregate loans by dimension and metric","description":"**Required scope:** `read:reports`\n\nA point-in-time aggregate over loans' CURRENT attributes. It cannot answer \"how much did we\r\nclose in period X\" - loans do not stay at a terminal status, so a current-status filter\r\nundercounts badly. Use the milestones report for that.","operationId":"Reports_ReportLoans","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportLoansRequestDto"}}}},"responses":{"200":{"description":"Aggregation buckets","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoanAggregationResponse"}}}},"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"}}}},"500":{"description":"Internal Server Error","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}}}}
```

## Valid values accepted by the reporting endpoints

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

```json
{"openapi":"3.0.4","info":{"title":"Henge Partner API","version":"1.22.0"},"tags":[{"name":"Reporting","description":"**Reports:** Loan reporting and analytics: the current pipeline by stage, loans reaching each milestone per period, tasks and conditions across loans, aggregates by dimension, and condition categories against loan outcomes. Every report covers your company's loans only. `GET /reports/metadata` lists the values each filter accepts.\n\n**Loan query:** Custom queries that return one row per loan, for when the fixed report filters are not enough. Read the available fields first: only those fields can be selected, filtered and sorted on. Results cover your company's loans only.\n\n**Scopes:** `read:loans`, `read:reports`"}],"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":{"LoanReportingMetadataResponse":{"type":"object","properties":{"statuses":{"type":"array","items":{"type":"string"},"description":"The loan status names a status filter accepts.","nullable":true},"loanTypes":{"type":"array","items":{"type":"string"},"description":"The loan type names a loan type filter accepts, for example Conventional, FHA or VA.","nullable":true},"purposes":{"type":"array","items":{"type":"string"},"description":"The loan purpose names a purpose filter accepts, for example Purchase or Refinance.","nullable":true},"groupByDimensions":{"type":"array","items":{"type":"string"},"description":"The dimensions loans can be grouped by in an aggregation report.","nullable":true},"metricFunctions":{"type":"array","items":{"type":"string"},"description":"The functions an aggregation can apply to a metric: Count, Sum, Average, Min or Max.","nullable":true},"metricFields":{"type":"array","items":{"type":"string"},"description":"The loan figures an aggregation can measure.","nullable":true},"dateFields":{"type":"array","items":{"type":"string"},"description":"The dates that can drive Month, Quarter, Year and Day grouping.","nullable":true},"orderByOptions":{"type":"array","items":{"type":"string"},"description":"The sort keys a loan list accepts.","nullable":true},"northstarStages":{"type":"array","items":{"type":"string"},"description":"The funnel stages (Opened, Pre-Approved, Rate Locked, Approved, Closed and Funded) that milestone reports can group by, in order.","nullable":true},"milestoneGranularities":{"type":"array","items":{"type":"string"},"description":"The bucket sizes a milestone report accepts: Week or Month.","nullable":true},"loanTypeCodes":{"type":"object","additionalProperties":{"type":"string","nullable":true},"description":"The LOS loan-type code table: each code and the loan type name it stands for. Published beside mortgageLoanTypeCodes because both are 0-based integers that mean different things.","nullable":true},"mortgageLoanTypeCodes":{"type":"object","additionalProperties":{"type":"string","nullable":true},"description":"The LOS mortgage loan type code table: each code and the product class it stands for (for example government, conforming, non-conforming). It is a different field from the loan type.","nullable":true},"notes":{"type":"array","items":{"type":"string"},"description":"Caveats about how the value lists above apply, for example which field each vocabulary belongs to.","nullable":true}},"additionalProperties":false,"description":"The valid vocabulary for the loan reporting endpoints, so a caller does not have to guess values."},"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":{"/reports/metadata":{"get":{"tags":["Reporting"],"summary":"Valid values accepted by the reporting endpoints","description":"**Required scope:** `read:reports`","operationId":"Reports_Metadata","responses":{"200":{"description":"Reporting vocabulary","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoanReportingMetadataResponse"}}}},"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"}}}}}}}}}
```


---

# 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/reporting.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.
