@model-match/api 3.90.0 → 3.92.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/RELEASE_NOTES.md CHANGED
@@ -2,6 +2,17 @@
2
2
 
3
3
  Changes to `@model-match/api` that affect how you use it. Each version is generated from the ModelMatch API's OpenAPI spec, so new endpoints and fields appear in the [API reference](https://docs.modelmatch.com/developers) as they ship.
4
4
 
5
+ ## 3.92.0
6
+
7
+ - **Two more outcomes for home models.** `createStudioModel` accepts `outcome: "home_listed"` (the home is listed for sale, whether or not the listing sells) and `outcome: "refinance"` (a new first mortgage replaces the one on record; home equity loans and purchases do not count). A `home_listed` model leaves out homes already listed in the 6 months before the as-of date. `getStudioModelOptions` lists both. Existing outcomes and models are unchanged.
8
+
9
+ ## 3.91.0
10
+
11
+ - **Studio models can rank loan officers.** `createStudioModel` takes `subject: "loan_officer"` to score loan officers on who is likely to move to another company, or to gain or lose share of their state's loans. A loan-officer model uses that subject's own outcomes, data points and populations, and its uploaded outcomes are matched by NMLS id (`nmls_id`). `getStudioModelOptions` lists them under `subjects`, with the scope forms each subject takes under `scopeKinds`. Leave `subject` out to model homes, as before.
12
+ - **Models can cover more than one state.** `scope` takes exactly one of `{ state }`, `{ states }`, `{ counties }`, `{ zipCodes }` or `{ national: true }`. Homes take all five forms; loan officers take `state`, `states` and `national`. `getStudioModelOptions` returns `scope.kinds` with the most values each form may list.
13
+ - **Breaking: a model's `scope.state` is now optional.** A model's `scope` is returned in the form it was created with, plus `label` (for example "OK and TX" or "the whole country"). Models created with `{ state }` still have `state`. Use `scope.label` to show where a model looks.
14
+ - **Some loan-officer data points need to be enabled.** Tenure at a company and career length track closely with a person's age. They are marked `ageProxy: true` and work only when your organization has them enabled. Otherwise `createStudioModel` and `refreshStudioModel` answer `403 entitlement_missing`, with `details.fields` naming them. If access cannot be checked right now, they answer `503 entitlement_unavailable`.
15
+
5
16
  ## 3.90.0
6
17
 
7
18
  - **One list of everything that alerts you**: `listMonitors` (`GET /v1/monitors`) returns the alert recipes you subscribed to and your Studio jobs with alert rules, each with what it watches, how often it checks, when it last sent an alert and how to change it (`edit`). Free. If Studio cannot be read, the recipe monitors still come back, with `partial: true`.
@@ -14881,8 +14881,34 @@ type StudioModel = {
14881
14881
  * How often the scores are refreshed: `manual` (when you ask), `weekly` or `monthly`.
14882
14882
  */
14883
14883
  schedule: 'manual' | 'weekly' | 'monthly';
14884
+ /**
14885
+ * Where the model looks: exactly one of `state`, `states`, `counties`, `zipCodes` or `national` (the same form the request gave), and `label`. A model from before scopes could be wider has `state`.
14886
+ */
14884
14887
  scope: {
14885
- state: string;
14888
+ /**
14889
+ * Counties: their five-digit county codes.
14890
+ */
14891
+ counties?: Array<string>;
14892
+ /**
14893
+ * Where the model looks, in plain words: "TX", "OK and TX", "12 counties", "the whole country". Show a person this.
14894
+ */
14895
+ label?: string;
14896
+ /**
14897
+ * True: the whole country.
14898
+ */
14899
+ national?: boolean;
14900
+ /**
14901
+ * One state: its two-letter code.
14902
+ */
14903
+ state?: string;
14904
+ /**
14905
+ * Several states: their two-letter codes.
14906
+ */
14907
+ states?: Array<string>;
14908
+ /**
14909
+ * ZIP codes: five digits each.
14910
+ */
14911
+ zipCodes?: Array<string>;
14886
14912
  };
14887
14913
  /**
14888
14914
  * Where the scores are. Null: this model has no scores table.
@@ -14907,6 +14933,10 @@ type StudioModel = {
14907
14933
  * `training` — still working; ask again in a minute. `ready` — it passed its checks and has scores. `refused` — it was trained, or checked, and is not dependable enough to publish: `card.refusal` says why and what would help; it has no scores. `failed` — something went wrong on our side (`error`); nothing was charged.
14908
14934
  */
14909
14935
  status: 'training' | 'ready' | 'refused' | 'failed';
14936
+ /**
14937
+ * Who or what the model scores: `home`, or `loan_officer` (a `subjects[].id` from getStudioModelOptions).
14938
+ */
14939
+ subject?: string;
14910
14940
  /**
14911
14941
  * The table the scores are queried as. It exists only while `scores` is not null.
14912
14942
  */
@@ -14978,14 +15008,34 @@ type StudioModelCreate = {
14978
15008
  */
14979
15009
  schedule?: 'manual' | 'weekly' | 'monthly';
14980
15010
  /**
14981
- * Required unless `basedOn` supplies it.
15011
+ * Where the model looks: give exactly ONE of `state`, `states`, `counties`, `zipCodes` or `national: true`. Each subject lists the forms it takes (`subjects[].scopeKinds` in getStudioModelOptions; loan officers: `state`, `states`, `national`). Sampling and size limits apply to the whole area. Required unless `basedOn` supplies it.
14982
15012
  */
14983
15013
  scope?: {
14984
15014
  /**
14985
- * Two-letter state. One state per model for now.
15015
+ * Counties: five-digit county codes, which may span states. Homes only.
14986
15016
  */
14987
- state: string;
15017
+ counties?: Array<string>;
15018
+ /**
15019
+ * `true`: the whole country.
15020
+ */
15021
+ national?: boolean;
15022
+ /**
15023
+ * One state: its two-letter code.
15024
+ */
15025
+ state?: string;
15026
+ /**
15027
+ * Several states: two-letter codes.
15028
+ */
15029
+ states?: Array<string>;
15030
+ /**
15031
+ * ZIP codes: five digits each. Homes only.
15032
+ */
15033
+ zipCodes?: Array<string>;
14988
15034
  };
15035
+ /**
15036
+ * Who or what the model scores: `home` (default) or `loan_officer`, a `subjects[].id` from getStudioModelOptions. Each subject has its own outcomes, populations, data points and upload keys.
15037
+ */
15038
+ subject?: string;
14989
15039
  };
14990
15040
  type StudioModelCreated = {
14991
15041
  credits: StudioModelCredits;
@@ -15073,7 +15123,7 @@ type StudioModelError = {
15073
15123
  type StudioModelKey = {
15074
15124
  columns: Array<string>;
15075
15125
  /**
15076
- * `property_address` (`address_key`, ZIP), `property_id` or `loan_id`.
15126
+ * Homes: `property_address` (`address_key`, ZIP), `property_id` or `loan_id`. Loan officers: `nmls_id` (the NMLS id column).
15077
15127
  */
15078
15128
  kind: string;
15079
15129
  };
@@ -15119,6 +15169,96 @@ type StudioModelOptions = {
15119
15169
  }>;
15120
15170
  note: string;
15121
15171
  };
15172
+ /**
15173
+ * Where a model can look: one state, several states, counties, ZIP codes or the whole country, with the most values each may list.
15174
+ */
15175
+ scope?: {
15176
+ description: string;
15177
+ kinds: Array<{
15178
+ description: string;
15179
+ field: string;
15180
+ kind: string;
15181
+ label: string;
15182
+ maxValues?: number;
15183
+ }>;
15184
+ };
15185
+ /**
15186
+ * What can be scored: `home` (the default; its lists are also the top-level `outcomes`, `populations` and `themes`) and `loan_officer`. Each subject has its own outcomes, populations, data points, upload keys and scope forms; a model uses one subject's.
15187
+ */
15188
+ subjects?: Array<{
15189
+ boostColumns: Array<{
15190
+ column: string;
15191
+ label: string;
15192
+ needsFairLendingReview: boolean;
15193
+ operators: Array<string>;
15194
+ type: string;
15195
+ }>;
15196
+ default?: boolean;
15197
+ gatedEntitlements?: {
15198
+ [key: string]: string;
15199
+ };
15200
+ /**
15201
+ * The `subject` to send: `home` or `loan_officer`.
15202
+ */
15203
+ id: string;
15204
+ keyKinds: Array<{
15205
+ columnCount?: number;
15206
+ columns: string;
15207
+ kind: string;
15208
+ label: string;
15209
+ note: string;
15210
+ }>;
15211
+ label: string;
15212
+ minPositivesPerTestQuarter?: number;
15213
+ nouns?: {
15214
+ plural: string;
15215
+ singular: string;
15216
+ };
15217
+ outcomes: Array<{
15218
+ defaultHorizonMonths: number;
15219
+ description: string;
15220
+ id: string;
15221
+ label: string;
15222
+ question: string;
15223
+ }>;
15224
+ populations: Array<{
15225
+ description: string;
15226
+ kind: string;
15227
+ label: string;
15228
+ requires: Array<string>;
15229
+ }>;
15230
+ /**
15231
+ * The `scope` forms this subject takes; absent: all of them.
15232
+ */
15233
+ scopeKinds?: Array<string>;
15234
+ themes: Array<{
15235
+ dataPoints: Array<{
15236
+ /**
15237
+ * True when a direction rule may be set on it (numbers).
15238
+ */
15239
+ acceptsDirection?: boolean;
15240
+ /**
15241
+ * True for a data point that tracks closely with a person's age (a loan officer's tenure or career length): usable only when your organization has it enabled (`gatedEntitlements.ageProxy` on its subject), and never part of using every data point.
15242
+ */
15243
+ ageProxy?: boolean;
15244
+ description: string;
15245
+ id: string;
15246
+ kind: 'number' | 'category';
15247
+ label: string;
15248
+ /**
15249
+ * True for data points about the neighbourhood: available to every organization, but geography can act as a proxy for protected classes, so a model that uses them should have a fair-lending review before it decides who gets an offer (the report card says so).
15250
+ */
15251
+ needsFairLendingReview: boolean;
15252
+ /**
15253
+ * One line on why someone might believe this matters.
15254
+ */
15255
+ whyItMightMatter: string;
15256
+ }>;
15257
+ description: string;
15258
+ label: string;
15259
+ theme: string;
15260
+ }>;
15261
+ }>;
15122
15262
  /**
15123
15263
  * The data points a model can use, grouped by theme. Offer the themes and ask which data points the person believes matter.
15124
15264
  */
@@ -15128,6 +15268,10 @@ type StudioModelOptions = {
15128
15268
  * True when a direction rule may be set on it (numbers).
15129
15269
  */
15130
15270
  acceptsDirection?: boolean;
15271
+ /**
15272
+ * True for a data point that tracks closely with a person's age (a loan officer's tenure or career length): usable only when your organization has it enabled (`gatedEntitlements.ageProxy` on its subject), and never part of using every data point.
15273
+ */
15274
+ ageProxy?: boolean;
15131
15275
  description: string;
15132
15276
  id: string;
15133
15277
  kind: 'number' | 'category';
@@ -15288,9 +15432,9 @@ type StudioModelPopulation = {
15288
15432
  companyNmlsId?: string;
15289
15433
  key?: StudioModelKey;
15290
15434
  /**
15291
- * Who is scored: `homes` (recent mortgage, in the state), `company_book` (`companyNmlsId`) or `uploaded_list` (`table`, `key`).
15435
+ * Who is scored. Homes: `homes` (recent mortgage, in the scope), `company_book` (`companyNmlsId`) or `uploaded_list` (`table`, `key`). Loan officers: `loan_officers` (active in the scope), `company_loan_officers` (`companyNmlsId`) or `uploaded_list` (key `nmls_id`).
15292
15436
  */
15293
- kind: 'homes' | 'company_book' | 'uploaded_list';
15437
+ kind: 'homes' | 'company_book' | 'uploaded_list' | 'loan_officers' | 'company_loan_officers';
15294
15438
  table?: string;
15295
15439
  };
15296
15440
  type StudioModelRefresh = {
@@ -33599,7 +33743,7 @@ type ListStudioModelsErrors = {
33599
33743
  */
33600
33744
  401: StudioModelError;
33601
33745
  /**
33602
- * `no_organization` — models belong to an organization; select one and try again.
33746
+ * `no_organization` — models belong to an organization; select one and try again. `entitlement_missing` — the model uses a data point that tracks closely with a person's age (a loan officer's tenure or career length), which your organization does not have enabled: `details.fields` names them; ask your ModelMatch admin, or leave them out.
33603
33747
  */
33604
33748
  403: StudioModelError;
33605
33749
  /**
@@ -33619,7 +33763,7 @@ type ListStudioModelsErrors = {
33619
33763
  */
33620
33764
  429: StudioModelError;
33621
33765
  /**
33622
- * `models_unavailable` — training is switched off right now (reading models and querying published scores still work); `studio_unavailable` — try again in a minute. `billing_unavailable` — the model is finished but could not be charged for right now, so it is not published yet; read it again in a minute (it is never charged twice).
33766
+ * `entitlement_unavailable` — we could not confirm whether your organization may use the age-related data points the model asks for; nothing was started, try again in a minute. `models_unavailable` — training is switched off right now (reading models and querying published scores still work); `studio_unavailable` — try again in a minute. `billing_unavailable` — the model is finished but could not be charged for right now, so it is not published yet; read it again in a minute (it is never charged twice).
33623
33767
  */
33624
33768
  503: StudioModelError;
33625
33769
  };
@@ -33647,7 +33791,7 @@ type CreateStudioModelErrors = {
33647
33791
  */
33648
33792
  401: StudioModelError;
33649
33793
  /**
33650
- * `no_organization` — models belong to an organization; select one and try again.
33794
+ * `no_organization` — models belong to an organization; select one and try again. `entitlement_missing` — the model uses a data point that tracks closely with a person's age (a loan officer's tenure or career length), which your organization does not have enabled: `details.fields` names them; ask your ModelMatch admin, or leave them out.
33651
33795
  */
33652
33796
  403: StudioModelError;
33653
33797
  /**
@@ -33667,7 +33811,7 @@ type CreateStudioModelErrors = {
33667
33811
  */
33668
33812
  429: StudioModelError;
33669
33813
  /**
33670
- * `models_unavailable` — training is switched off right now (reading models and querying published scores still work); `studio_unavailable` — try again in a minute. `billing_unavailable` — the model is finished but could not be charged for right now, so it is not published yet; read it again in a minute (it is never charged twice).
33814
+ * `entitlement_unavailable` — we could not confirm whether your organization may use the age-related data points the model asks for; nothing was started, try again in a minute. `models_unavailable` — training is switched off right now (reading models and querying published scores still work); `studio_unavailable` — try again in a minute. `billing_unavailable` — the model is finished but could not be charged for right now, so it is not published yet; read it again in a minute (it is never charged twice).
33671
33815
  */
33672
33816
  503: StudioModelError;
33673
33817
  };
@@ -33695,7 +33839,7 @@ type GetStudioModelOptionsErrors = {
33695
33839
  */
33696
33840
  401: StudioModelError;
33697
33841
  /**
33698
- * `no_organization` — models belong to an organization; select one and try again.
33842
+ * `no_organization` — models belong to an organization; select one and try again. `entitlement_missing` — the model uses a data point that tracks closely with a person's age (a loan officer's tenure or career length), which your organization does not have enabled: `details.fields` names them; ask your ModelMatch admin, or leave them out.
33699
33843
  */
33700
33844
  403: StudioModelError;
33701
33845
  /**
@@ -33715,7 +33859,7 @@ type GetStudioModelOptionsErrors = {
33715
33859
  */
33716
33860
  429: StudioModelError;
33717
33861
  /**
33718
- * `models_unavailable` — training is switched off right now (reading models and querying published scores still work); `studio_unavailable` — try again in a minute. `billing_unavailable` — the model is finished but could not be charged for right now, so it is not published yet; read it again in a minute (it is never charged twice).
33862
+ * `entitlement_unavailable` — we could not confirm whether your organization may use the age-related data points the model asks for; nothing was started, try again in a minute. `models_unavailable` — training is switched off right now (reading models and querying published scores still work); `studio_unavailable` — try again in a minute. `billing_unavailable` — the model is finished but could not be charged for right now, so it is not published yet; read it again in a minute (it is never charged twice).
33719
33863
  */
33720
33864
  503: StudioModelError;
33721
33865
  };
@@ -33793,7 +33937,7 @@ type DeleteStudioModelErrors = {
33793
33937
  */
33794
33938
  401: StudioModelError;
33795
33939
  /**
33796
- * `no_organization` — models belong to an organization; select one and try again.
33940
+ * `no_organization` — models belong to an organization; select one and try again. `entitlement_missing` — the model uses a data point that tracks closely with a person's age (a loan officer's tenure or career length), which your organization does not have enabled: `details.fields` names them; ask your ModelMatch admin, or leave them out.
33797
33941
  */
33798
33942
  403: StudioModelError;
33799
33943
  /**
@@ -33813,7 +33957,7 @@ type DeleteStudioModelErrors = {
33813
33957
  */
33814
33958
  429: StudioModelError;
33815
33959
  /**
33816
- * `models_unavailable` — training is switched off right now (reading models and querying published scores still work); `studio_unavailable` — try again in a minute. `billing_unavailable` — the model is finished but could not be charged for right now, so it is not published yet; read it again in a minute (it is never charged twice).
33960
+ * `entitlement_unavailable` — we could not confirm whether your organization may use the age-related data points the model asks for; nothing was started, try again in a minute. `models_unavailable` — training is switched off right now (reading models and querying published scores still work); `studio_unavailable` — try again in a minute. `billing_unavailable` — the model is finished but could not be charged for right now, so it is not published yet; read it again in a minute (it is never charged twice).
33817
33961
  */
33818
33962
  503: StudioModelError;
33819
33963
  };
@@ -33850,7 +33994,7 @@ type GetStudioModelErrors = {
33850
33994
  */
33851
33995
  402: StudioModelPaymentRequired;
33852
33996
  /**
33853
- * `no_organization` — models belong to an organization; select one and try again.
33997
+ * `no_organization` — models belong to an organization; select one and try again. `entitlement_missing` — the model uses a data point that tracks closely with a person's age (a loan officer's tenure or career length), which your organization does not have enabled: `details.fields` names them; ask your ModelMatch admin, or leave them out.
33854
33998
  */
33855
33999
  403: StudioModelError;
33856
34000
  /**
@@ -33870,7 +34014,7 @@ type GetStudioModelErrors = {
33870
34014
  */
33871
34015
  429: StudioModelError;
33872
34016
  /**
33873
- * `models_unavailable` — training is switched off right now (reading models and querying published scores still work); `studio_unavailable` — try again in a minute. `billing_unavailable` — the model is finished but could not be charged for right now, so it is not published yet; read it again in a minute (it is never charged twice).
34017
+ * `entitlement_unavailable` — we could not confirm whether your organization may use the age-related data points the model asks for; nothing was started, try again in a minute. `models_unavailable` — training is switched off right now (reading models and querying published scores still work); `studio_unavailable` — try again in a minute. `billing_unavailable` — the model is finished but could not be charged for right now, so it is not published yet; read it again in a minute (it is never charged twice).
33874
34018
  */
33875
34019
  503: StudioModelError;
33876
34020
  };
@@ -33907,7 +34051,7 @@ type RefreshStudioModelErrors = {
33907
34051
  */
33908
34052
  402: StudioModelPaymentRequired;
33909
34053
  /**
33910
- * `no_organization` — models belong to an organization; select one and try again.
34054
+ * `no_organization` — models belong to an organization; select one and try again. `entitlement_missing` — the model uses a data point that tracks closely with a person's age (a loan officer's tenure or career length), which your organization does not have enabled: `details.fields` names them; ask your ModelMatch admin, or leave them out.
33911
34055
  */
33912
34056
  403: StudioModelError;
33913
34057
  /**
@@ -33927,7 +34071,7 @@ type RefreshStudioModelErrors = {
33927
34071
  */
33928
34072
  429: StudioModelError;
33929
34073
  /**
33930
- * `models_unavailable` — training is switched off right now (reading models and querying published scores still work); `studio_unavailable` — try again in a minute. `billing_unavailable` — the model is finished but could not be charged for right now, so it is not published yet; read it again in a minute (it is never charged twice).
34074
+ * `entitlement_unavailable` — we could not confirm whether your organization may use the age-related data points the model asks for; nothing was started, try again in a minute. `models_unavailable` — training is switched off right now (reading models and querying published scores still work); `studio_unavailable` — try again in a minute. `billing_unavailable` — the model is finished but could not be charged for right now, so it is not published yet; read it again in a minute (it is never charged twice).
33931
34075
  */
33932
34076
  503: StudioModelError;
33933
34077
  };