@model-match/api 3.73.0 → 3.76.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/openapi.json CHANGED
@@ -14154,6 +14154,199 @@
14154
14154
  ],
14155
14155
  "type": "object"
14156
14156
  },
14157
+ "CompanyLikelyToSell": {
14158
+ "properties": {
14159
+ "address": {
14160
+ "description": "From the company's loan record on the parcel.",
14161
+ "type": "string"
14162
+ },
14163
+ "lender": {
14164
+ "description": "Current lender of record: the lender on that loan, which is still the borrower's latest (retained).",
14165
+ "nullable": true,
14166
+ "type": "string"
14167
+ },
14168
+ "loanAmount": {
14169
+ "description": "Original amount of that loan.",
14170
+ "type": "number"
14171
+ },
14172
+ "loanDate": {
14173
+ "description": "Date of the company's latest loan on the parcel.",
14174
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
14175
+ "type": "string"
14176
+ },
14177
+ "originatorName": {
14178
+ "type": "string"
14179
+ },
14180
+ "originatorNmlsId": {
14181
+ "description": "The LO who wrote the company's latest loan on the parcel — employed by the company on that loan.",
14182
+ "type": "string"
14183
+ },
14184
+ "propensityCategory": {
14185
+ "description": "The score's band label (e.g. `High`).",
14186
+ "nullable": true,
14187
+ "type": "string"
14188
+ },
14189
+ "propertyId": {
14190
+ "type": "string"
14191
+ },
14192
+ "salePropensity": {
14193
+ "description": "Likely-to-list score, 0–100: a priority / likelihood ranking (higher = more likely to list soon), not a probability. Every row is 90 or more.",
14194
+ "type": "number"
14195
+ },
14196
+ "writtenAt": {
14197
+ "description": "`view=team` only: the previous employer the LO wrote this loan at. Null on a loan written at the company (and on every `view=company` row).",
14198
+ "nullable": true,
14199
+ "type": "string"
14200
+ }
14201
+ },
14202
+ "required": [
14203
+ "propertyId",
14204
+ "address",
14205
+ "salePropensity",
14206
+ "propensityCategory",
14207
+ "originatorNmlsId",
14208
+ "originatorName",
14209
+ "loanDate",
14210
+ "loanAmount",
14211
+ "lender"
14212
+ ],
14213
+ "type": "object"
14214
+ },
14215
+ "CompanyLikelyToSellResponse": {
14216
+ "properties": {
14217
+ "companyNmlsId": {
14218
+ "type": "string"
14219
+ },
14220
+ "computedAt": {
14221
+ "description": "When the weekly batch checked these borrowers (ISO-8601). Rows are as of this time, not live.",
14222
+ "type": "string"
14223
+ },
14224
+ "cursor": {
14225
+ "description": "Cursor for the next page; absent on the last page.",
14226
+ "type": "string"
14227
+ },
14228
+ "data": {
14229
+ "items": {
14230
+ "$ref": "#/components/schemas/CompanyLikelyToSell"
14231
+ },
14232
+ "type": "array"
14233
+ },
14234
+ "status": {
14235
+ "description": "`timeout`: the check did not finish in this run, so the previous run's rows and counts are kept (or none, on a first run).",
14236
+ "enum": [
14237
+ "ok",
14238
+ "timeout"
14239
+ ],
14240
+ "type": "string"
14241
+ },
14242
+ "total": {
14243
+ "description": "Rows matching the filter, across all pages.",
14244
+ "type": "integer"
14245
+ }
14246
+ },
14247
+ "required": [
14248
+ "companyNmlsId",
14249
+ "computedAt",
14250
+ "status",
14251
+ "data",
14252
+ "total"
14253
+ ],
14254
+ "type": "object"
14255
+ },
14256
+ "CompanyLikelyToSellSummary": {
14257
+ "description": "Retained borrowers likely to list their home for sale (likely-to-list score 90+, not listed now), on loans by the company's own LOs: the count and top LOs (rows: `GET /companies/{nmlsId}/retention/likely-to-sell`). Same for every window. Null until the weekly batch has checked this company.",
14258
+ "nullable": true,
14259
+ "properties": {
14260
+ "computedAt": {
14261
+ "description": "When the batch checked these borrowers (ISO-8601) — the run that wrote the rows. As of this time, not live.",
14262
+ "type": "string"
14263
+ },
14264
+ "parcelsChecked": {
14265
+ "description": "Retained parcels whose latest company loan was written by an LO the company employed on it — the population checked (the same one active listings checks).",
14266
+ "type": "integer"
14267
+ },
14268
+ "parcelsScored": {
14269
+ "description": "Of those, parcels with a likely-to-list score on file. A parcel without one is unknown, not unlikely.",
14270
+ "type": "integer"
14271
+ },
14272
+ "status": {
14273
+ "description": "`timeout`: the check did not finish in this run, so the previous run's rows and counts are kept (or none, on a first run).",
14274
+ "enum": [
14275
+ "ok",
14276
+ "timeout"
14277
+ ],
14278
+ "type": "string"
14279
+ },
14280
+ "team": {
14281
+ "description": "The current-team view's counts; null until the batch has checked it for this company.",
14282
+ "nullable": true,
14283
+ "properties": {
14284
+ "roster": {
14285
+ "description": "Current LOs (active sponsorships) checked.",
14286
+ "type": "integer"
14287
+ },
14288
+ "status": {
14289
+ "enum": [
14290
+ "ok",
14291
+ "timeout"
14292
+ ],
14293
+ "type": "string"
14294
+ },
14295
+ "total": {
14296
+ "description": "Rows in `view=team`: borrowers likely to list on loans by the company's current LOs, written at the company or at a previous employer.",
14297
+ "type": "integer"
14298
+ },
14299
+ "writtenElsewhere": {
14300
+ "description": "Of those, loans the LOs wrote at a previous employer.",
14301
+ "type": "integer"
14302
+ }
14303
+ },
14304
+ "required": [
14305
+ "status",
14306
+ "total",
14307
+ "writtenElsewhere",
14308
+ "roster"
14309
+ ],
14310
+ "type": "object"
14311
+ },
14312
+ "topOriginators": {
14313
+ "description": "Top 10 LOs by borrowers likely to list.",
14314
+ "items": {
14315
+ "properties": {
14316
+ "count": {
14317
+ "type": "integer"
14318
+ },
14319
+ "name": {
14320
+ "type": "string"
14321
+ },
14322
+ "nmlsId": {
14323
+ "type": "string"
14324
+ }
14325
+ },
14326
+ "required": [
14327
+ "nmlsId",
14328
+ "name",
14329
+ "count"
14330
+ ],
14331
+ "type": "object"
14332
+ },
14333
+ "type": "array"
14334
+ },
14335
+ "total": {
14336
+ "description": "Retained borrowers, on loans written by the company's own LOs, whose home has a likely-to-list score of 90 or more and is not listed for sale or under contract now.",
14337
+ "type": "integer"
14338
+ }
14339
+ },
14340
+ "required": [
14341
+ "computedAt",
14342
+ "status",
14343
+ "total",
14344
+ "parcelsChecked",
14345
+ "parcelsScored",
14346
+ "topOriginators"
14347
+ ],
14348
+ "type": "object"
14349
+ },
14157
14350
  "CompanyListRequest": {
14158
14351
  "additionalProperties": false,
14159
14352
  "properties": {
@@ -16399,6 +16592,9 @@
16399
16592
  ],
16400
16593
  "type": "object"
16401
16594
  },
16595
+ "likelyToSell": {
16596
+ "$ref": "#/components/schemas/CompanyLikelyToSellSummary"
16597
+ },
16402
16598
  "originatorRetention": {
16403
16599
  "description": "Refinance retention for the company's own loan officers, ranked by borrowers who refinanced at another company (top 10; only LOs with at least 10 refi events in the window).",
16404
16600
  "items": {
@@ -16817,6 +17013,7 @@
16817
17013
  "originatorRetention",
16818
17014
  "previous",
16819
17015
  "activeListings",
17016
+ "likelyToSell",
16820
17017
  "book"
16821
17018
  ],
16822
17019
  "type": "object"
@@ -44208,6 +44405,9 @@
44208
44405
  "listingContact": {
44209
44406
  "$ref": "#/components/schemas/SaleListingContact"
44210
44407
  },
44408
+ "media": {
44409
+ "$ref": "#/components/schemas/SaleMedia"
44410
+ },
44211
44411
  "mlsBoards": {
44212
44412
  "nullable": true
44213
44413
  },
@@ -44894,6 +45094,9 @@
44894
45094
  "lon": {
44895
45095
  "type": "number"
44896
45096
  },
45097
+ "media": {
45098
+ "$ref": "#/components/schemas/SaleMediaSummary"
45099
+ },
44897
45100
  "price": {
44898
45101
  "description": "Sold price for a closed sale (`SLD`), otherwise the list price, in dollars",
44899
45102
  "nullable": true,
@@ -45030,6 +45233,291 @@
45030
45233
  ],
45031
45234
  "type": "object"
45032
45235
  },
45236
+ "SaleMarketStatsActive": {
45237
+ "properties": {
45238
+ "count": {
45239
+ "description": "Active inventory: status `ACT`, price at least $25,000, not a rental, touched within `scope.activeWithinDays`",
45240
+ "type": "integer"
45241
+ },
45242
+ "medianListPrice": {
45243
+ "description": "Dollars",
45244
+ "nullable": true,
45245
+ "type": "number"
45246
+ },
45247
+ "priceCutCount": {
45248
+ "description": "Active listings whose current list price is below the original list price",
45249
+ "type": "integer"
45250
+ },
45251
+ "priceCutShare": {
45252
+ "description": "`priceCutCount` / `count`, 0-1; null when `count` is 0",
45253
+ "nullable": true,
45254
+ "type": "number"
45255
+ }
45256
+ },
45257
+ "required": [
45258
+ "count",
45259
+ "medianListPrice",
45260
+ "priceCutCount",
45261
+ "priceCutShare"
45262
+ ],
45263
+ "type": "object"
45264
+ },
45265
+ "SaleMarketStatsRequest": {
45266
+ "additionalProperties": false,
45267
+ "properties": {
45268
+ "activeWithinDays": {
45269
+ "description": "An active listing counts only if its status was last touched within this many days (default 180). Active rows are not removed from the index when they go stale, so without this the inventory includes listings that sold or expired years ago.",
45270
+ "maximum": 365,
45271
+ "minimum": 1,
45272
+ "type": "integer"
45273
+ },
45274
+ "advancedFilters": {
45275
+ "$ref": "#/components/schemas/FilterNode"
45276
+ },
45277
+ "filters": {
45278
+ "$ref": "#/components/schemas/FilterNode"
45279
+ },
45280
+ "flatFilters": {
45281
+ "$ref": "#/components/schemas/SaleFlatFilters"
45282
+ },
45283
+ "period": {
45284
+ "allOf": [
45285
+ {
45286
+ "$ref": "#/components/schemas/DatedPeriod"
45287
+ },
45288
+ {
45289
+ "description": "Window for the SOLD figures, on the sale date. Defaults to `last12Months`. Does not apply to the ACTIVE figures, which describe the market now."
45290
+ }
45291
+ ]
45292
+ }
45293
+ },
45294
+ "type": "object"
45295
+ },
45296
+ "SaleMarketStatsResponse": {
45297
+ "properties": {
45298
+ "active": {
45299
+ "$ref": "#/components/schemas/SaleMarketStatsActive"
45300
+ },
45301
+ "locationNormalizations": {
45302
+ "description": "How each location filter value resolved, as on the list route.",
45303
+ "items": {
45304
+ "$ref": "#/components/schemas/LocationNormalization"
45305
+ },
45306
+ "type": "array"
45307
+ },
45308
+ "scope": {
45309
+ "$ref": "#/components/schemas/SaleMarketStatsScope"
45310
+ },
45311
+ "sold": {
45312
+ "$ref": "#/components/schemas/SaleMarketStatsSold"
45313
+ }
45314
+ },
45315
+ "required": [
45316
+ "sold",
45317
+ "active",
45318
+ "scope"
45319
+ ],
45320
+ "type": "object"
45321
+ },
45322
+ "SaleMarketStatsScope": {
45323
+ "properties": {
45324
+ "activeSince": {
45325
+ "description": "`YYYY-MM-DD`",
45326
+ "type": "string"
45327
+ },
45328
+ "activeWithinDays": {
45329
+ "type": "integer"
45330
+ },
45331
+ "period": {
45332
+ "type": "string"
45333
+ },
45334
+ "soldFrom": {
45335
+ "description": "`YYYY-MM-DD`; null for `allTime`",
45336
+ "nullable": true,
45337
+ "type": "string"
45338
+ },
45339
+ "soldTo": {
45340
+ "nullable": true,
45341
+ "type": "string"
45342
+ }
45343
+ },
45344
+ "required": [
45345
+ "period",
45346
+ "soldFrom",
45347
+ "soldTo",
45348
+ "activeWithinDays",
45349
+ "activeSince"
45350
+ ],
45351
+ "type": "object"
45352
+ },
45353
+ "SaleMarketStatsSold": {
45354
+ "properties": {
45355
+ "count": {
45356
+ "description": "Closed sales (status `SLD`, price at least $25,000, not a rental) in `scope.soldFrom`..`scope.soldTo`",
45357
+ "type": "integer"
45358
+ },
45359
+ "medianDaysToSell": {
45360
+ "description": "Median days from MLS list date to MLS sold date, over sales carrying both (`samples.daysToSell`)",
45361
+ "nullable": true,
45362
+ "type": "number"
45363
+ },
45364
+ "medianPricePerSqft": {
45365
+ "description": "Median of sold price / living area, over the sales with a living area of at least 300 sqft (`samples.pricePerSqft`). Living area is missing on a large share of sold records.",
45366
+ "nullable": true,
45367
+ "type": "number"
45368
+ },
45369
+ "medianSaleToListRatio": {
45370
+ "description": "Median of sold price / final list price (0.95 = 5% under list), over sales carrying both (`samples.saleToList`)",
45371
+ "nullable": true,
45372
+ "type": "number"
45373
+ },
45374
+ "medianSoldPrice": {
45375
+ "description": "Dollars",
45376
+ "nullable": true,
45377
+ "type": "number"
45378
+ },
45379
+ "samples": {
45380
+ "description": "How many sales each median above is computed from. Read these before trusting a median: a neighborhood with a handful of sales has a noisy one.",
45381
+ "properties": {
45382
+ "daysToSell": {
45383
+ "type": "integer"
45384
+ },
45385
+ "pricePerSqft": {
45386
+ "type": "integer"
45387
+ },
45388
+ "saleToList": {
45389
+ "type": "integer"
45390
+ }
45391
+ },
45392
+ "required": [
45393
+ "pricePerSqft",
45394
+ "daysToSell",
45395
+ "saleToList"
45396
+ ],
45397
+ "type": "object"
45398
+ }
45399
+ },
45400
+ "required": [
45401
+ "count",
45402
+ "medianSoldPrice",
45403
+ "medianPricePerSqft",
45404
+ "medianDaysToSell",
45405
+ "medianSaleToListRatio",
45406
+ "samples"
45407
+ ],
45408
+ "type": "object"
45409
+ },
45410
+ "SaleMedia": {
45411
+ "description": "Listing photos found on the open web and stored by a partner app: links to images hosted by the source (no image bytes are stored here), plus where they came from. Present only while a non-expired `found` record exists for THIS listing (a relist gets its own), so it is `null` for most listings. Not MLS data and not necessarily the listing broker's photos: attribute them to `source.host` and link to `source.pageUrl`; they can stop resolving at any time.",
45412
+ "nullable": true,
45413
+ "properties": {
45414
+ "foundAt": {
45415
+ "description": "When the photos were found (ISO-8601)",
45416
+ "type": "string"
45417
+ },
45418
+ "photos": {
45419
+ "items": {
45420
+ "properties": {
45421
+ "bytes": {
45422
+ "type": "number"
45423
+ },
45424
+ "height": {
45425
+ "type": "number"
45426
+ },
45427
+ "url": {
45428
+ "description": "https URL of the image",
45429
+ "type": "string"
45430
+ },
45431
+ "width": {
45432
+ "type": "number"
45433
+ }
45434
+ },
45435
+ "required": [
45436
+ "url",
45437
+ "width",
45438
+ "height"
45439
+ ],
45440
+ "type": "object"
45441
+ },
45442
+ "type": "array"
45443
+ },
45444
+ "source": {
45445
+ "properties": {
45446
+ "host": {
45447
+ "description": "Host the photos came from",
45448
+ "type": "string"
45449
+ },
45450
+ "pageUrl": {
45451
+ "description": "Page the photos were read from",
45452
+ "type": "string"
45453
+ }
45454
+ },
45455
+ "required": [
45456
+ "host",
45457
+ "pageUrl"
45458
+ ],
45459
+ "type": "object"
45460
+ }
45461
+ },
45462
+ "required": [
45463
+ "photos",
45464
+ "source",
45465
+ "foundAt"
45466
+ ],
45467
+ "type": "object"
45468
+ },
45469
+ "SaleMediaSummary": {
45470
+ "description": "The first listing photo found on the open web, how many were found, and where from. Present on a list or map row only while a non-expired `found` record exists for THIS listing, otherwise the key is absent. Same caveats as `SaleMedia`: third-party links, attribute to `source.host`, they can stop resolving.",
45471
+ "properties": {
45472
+ "count": {
45473
+ "description": "How many photos exist for this listing (the full list is on `GET /v1/sales/{id}`)",
45474
+ "type": "integer"
45475
+ },
45476
+ "cover": {
45477
+ "properties": {
45478
+ "height": {
45479
+ "type": "number"
45480
+ },
45481
+ "url": {
45482
+ "description": "https URL of the cover image",
45483
+ "type": "string"
45484
+ },
45485
+ "width": {
45486
+ "type": "number"
45487
+ }
45488
+ },
45489
+ "required": [
45490
+ "url",
45491
+ "width",
45492
+ "height"
45493
+ ],
45494
+ "type": "object"
45495
+ },
45496
+ "source": {
45497
+ "properties": {
45498
+ "host": {
45499
+ "description": "Host the photos came from",
45500
+ "type": "string"
45501
+ },
45502
+ "pageUrl": {
45503
+ "description": "Page the photos were read from",
45504
+ "type": "string"
45505
+ }
45506
+ },
45507
+ "required": [
45508
+ "host",
45509
+ "pageUrl"
45510
+ ],
45511
+ "type": "object"
45512
+ }
45513
+ },
45514
+ "required": [
45515
+ "cover",
45516
+ "count",
45517
+ "source"
45518
+ ],
45519
+ "type": "object"
45520
+ },
45033
45521
  "SaleMiddleSchoolFilterValue": {
45034
45522
  "anyOf": [
45035
45523
  {
@@ -45300,6 +45788,9 @@
45300
45788
  "nullable": true,
45301
45789
  "type": "string"
45302
45790
  },
45791
+ "media": {
45792
+ "$ref": "#/components/schemas/SaleMediaSummary"
45793
+ },
45303
45794
  "mlsDaysOnMarket": {
45304
45795
  "description": "Days on market as the MLS states it for this listing. Distinct from `daysOnMarket`, which is only filled on some sold rows.",
45305
45796
  "nullable": true,
@@ -47408,7 +47899,7 @@
47408
47899
  "info": {
47409
47900
  "description": "ModelMatch API — mortgage and real-estate market data.\n\n## Bulk delivery limits\n\nThe `POST /{entity}/bulk-delivery` endpoints export a full result set to\nS3 as NDJSON, JSON, CSV, or Parquet.\n\n- **Up to 5,000 rows per delivery: no entitlement required.** Available to\n every authenticated caller.\n- **Above 5,000 rows: requires the entity's `bulk-delivery.{entity}`\n entitlement** (e.g. `bulk-delivery.loans`). The grant's scope sets your\n row ceiling and may also restrict which rows and fields you receive.\n\nA delivery that would exceed the limit available to you is rejected with\n`403 entitlement_missing`, reporting the matched row count and the ceiling\nthat applied. To stay under the limit, pass `limit` — the job then delivers\n(and bills for) only the first `limit` rows of a broader query.\n\n**Need a higher limit?** Email support@modelmatch.com to request the\nentitlement. Limits are raised per organization and per entity.\n\nBulk delivery is billed at 1 credit per delivered row whether or not\nan entitlement is held.\n\nInstead of a download, a delivery can be sent to a push target configured\non your workspace: pass `destination: { type: \"push-target\", targetId }`.\nThe same limits and billing apply.",
47410
47901
  "title": "ModelMatch API",
47411
- "version": "3.151.0"
47902
+ "version": "3.155.0"
47412
47903
  },
47413
47904
  "openapi": "3.1.0",
47414
47905
  "paths": {
@@ -58480,16 +58971,125 @@
58480
58971
  "description": "Search timed out or the cluster is overloaded — retry after `Retry-After` seconds."
58481
58972
  }
58482
58973
  },
58483
- "summary": "Combined production of a company's hires and exits",
58974
+ "summary": "Combined production of a company's hires and exits",
58975
+ "tags": [
58976
+ "Companies"
58977
+ ]
58978
+ }
58979
+ },
58980
+ "/v1/companies/{nmlsId}/retention": {
58981
+ "get": {
58982
+ "description": "How well a company keeps its borrowers when they refinance: kept (refinanced again by ANY LO at the company) vs lost to other companies, with the capturing companies and LOs, timing, the trend, a verdict, and per-LO retention for the company's own loan officers. Precomputed weekly — `computedAt` says when. 404 means not computed (no loans since 2017, or not reached yet), never zero retention.",
58983
+ "operationId": "companyRetention",
58984
+ "parameters": [
58985
+ {
58986
+ "description": "Company NMLS ID",
58987
+ "in": "path",
58988
+ "name": "nmlsId",
58989
+ "required": true,
58990
+ "schema": {
58991
+ "description": "Company NMLS ID",
58992
+ "type": "string"
58993
+ }
58994
+ },
58995
+ {
58996
+ "description": "`last12Months` (the trailing 12 months to the computation date, with the 12 months before as `previous`) or `allTime` (2017-01-01 on). Default `last12Months`.",
58997
+ "in": "query",
58998
+ "name": "window",
58999
+ "required": false,
59000
+ "schema": {
59001
+ "default": "last12Months",
59002
+ "description": "`last12Months` (the trailing 12 months to the computation date, with the 12 months before as `previous`) or `allTime` (2017-01-01 on). Default `last12Months`.",
59003
+ "enum": [
59004
+ "last12Months",
59005
+ "allTime"
59006
+ ],
59007
+ "type": "string"
59008
+ }
59009
+ }
59010
+ ],
59011
+ "responses": {
59012
+ "200": {
59013
+ "content": {
59014
+ "application/json": {
59015
+ "schema": {
59016
+ "$ref": "#/components/schemas/CompanyRetentionSnapshot"
59017
+ }
59018
+ }
59019
+ },
59020
+ "description": "The stored snapshot"
59021
+ },
59022
+ "400": {
59023
+ "content": {
59024
+ "application/json": {
59025
+ "schema": {
59026
+ "$ref": "#/components/schemas/ErrorResponse"
59027
+ }
59028
+ }
59029
+ },
59030
+ "description": "Validation error"
59031
+ },
59032
+ "401": {
59033
+ "content": {
59034
+ "application/json": {
59035
+ "schema": {
59036
+ "$ref": "#/components/schemas/ErrorResponse"
59037
+ }
59038
+ }
59039
+ },
59040
+ "description": "Unauthorized"
59041
+ },
59042
+ "403": {
59043
+ "content": {
59044
+ "application/json": {
59045
+ "schema": {
59046
+ "$ref": "#/components/schemas/ErrorResponse"
59047
+ }
59048
+ }
59049
+ },
59050
+ "description": "Forbidden (authenticated, but missing required context — e.g. no active organization)"
59051
+ },
59052
+ "404": {
59053
+ "content": {
59054
+ "application/json": {
59055
+ "schema": {
59056
+ "$ref": "#/components/schemas/ErrorResponse"
59057
+ }
59058
+ }
59059
+ },
59060
+ "description": "Not found"
59061
+ },
59062
+ "413": {
59063
+ "content": {
59064
+ "application/json": {
59065
+ "schema": {
59066
+ "$ref": "#/components/schemas/PayloadTooLarge"
59067
+ }
59068
+ }
59069
+ },
59070
+ "description": "Response payload too large — detail endpoint capped to fit Lambda response limits"
59071
+ },
59072
+ "503": {
59073
+ "content": {
59074
+ "application/json": {
59075
+ "schema": {
59076
+ "$ref": "#/components/schemas/SearchUnavailable"
59077
+ }
59078
+ }
59079
+ },
59080
+ "description": "Search timed out or the cluster is overloaded — retry after `Retry-After` seconds."
59081
+ }
59082
+ },
59083
+ "summary": "Company borrower retention (weekly snapshot)",
58484
59084
  "tags": [
58485
59085
  "Companies"
58486
59086
  ]
58487
59087
  }
58488
59088
  },
58489
- "/v1/companies/{nmlsId}/retention": {
59089
+ "/v1/companies/{nmlsId}/retention/active-listings": {
58490
59090
  "get": {
58491
- "description": "How well a company keeps its borrowers when they refinance: kept (refinanced again by ANY LO at the company) vs lost to other companies, with the capturing companies and LOs, timing, the trend, a verdict, and per-LO retention for the company's own loan officers. Precomputed weekly — `computedAt` says when. 404 means not computed (no loans since 2017, or not reached yet), never zero retention.",
58492
- "operationId": "companyRetention",
59091
+ "description": "The company's retained borrowers (their latest loan is still the company's) whose home is listed for sale right now, each with the company loan officer who wrote that loan — only LOs the company employed on the loan, not brokers' LOs on loans it only funded. Newest listing first; filter to one LO with `originator`. \"Listed now\" is the LO Borrower Retention tab's rule: an active MLS listing event in the last 90 days, list price at least $20k, not under contract. Checked weekly with the retention snapshot — `computedAt` says when. 404 means not computed for this company yet.",
59092
+ "operationId": "companyRetentionActiveListings",
58493
59093
  "parameters": [
58494
59094
  {
58495
59095
  "description": "Company NMLS ID",
@@ -58502,19 +59102,52 @@
58502
59102
  }
58503
59103
  },
58504
59104
  {
58505
- "description": "`last12Months` (the trailing 12 months to the computation date, with the 12 months before as `previous`) or `allTime` (2017-01-01 on). Default `last12Months`.",
59105
+ "description": "`company` (default): loans written at the company. `team`: the company's CURRENT loan officers' borrowers — loans they wrote at the company or at a previous employer (`writtenAt`), e.g. a recruit's book.",
58506
59106
  "in": "query",
58507
- "name": "window",
59107
+ "name": "view",
58508
59108
  "required": false,
58509
59109
  "schema": {
58510
- "default": "last12Months",
58511
- "description": "`last12Months` (the trailing 12 months to the computation date, with the 12 months before as `previous`) or `allTime` (2017-01-01 on). Default `last12Months`.",
59110
+ "description": "`company` (default): loans written at the company. `team`: the company's CURRENT loan officers' borrowers — loans they wrote at the company or at a previous employer (`writtenAt`), e.g. a recruit's book.",
58512
59111
  "enum": [
58513
- "last12Months",
58514
- "allTime"
59112
+ "company",
59113
+ "team"
58515
59114
  ],
58516
59115
  "type": "string"
58517
59116
  }
59117
+ },
59118
+ {
59119
+ "description": "Only rows whose loan was written by this LO (NMLS id) — e.g. one of `activeListings.topOriginators`.",
59120
+ "in": "query",
59121
+ "name": "originator",
59122
+ "required": false,
59123
+ "schema": {
59124
+ "description": "Only rows whose loan was written by this LO (NMLS id) — e.g. one of `activeListings.topOriginators`.",
59125
+ "pattern": "^\\d+$",
59126
+ "type": "string"
59127
+ }
59128
+ },
59129
+ {
59130
+ "description": "Page size (1-100, default 25).",
59131
+ "in": "query",
59132
+ "name": "size",
59133
+ "required": false,
59134
+ "schema": {
59135
+ "description": "Page size (1-100, default 25).",
59136
+ "example": 25,
59137
+ "maximum": 100,
59138
+ "minimum": 1,
59139
+ "type": "integer"
59140
+ }
59141
+ },
59142
+ {
59143
+ "description": "Opaque cursor from the previous page's `cursor`.",
59144
+ "in": "query",
59145
+ "name": "cursor",
59146
+ "required": false,
59147
+ "schema": {
59148
+ "description": "Opaque cursor from the previous page's `cursor`.",
59149
+ "type": "string"
59150
+ }
58518
59151
  }
58519
59152
  ],
58520
59153
  "responses": {
@@ -58522,11 +59155,11 @@
58522
59155
  "content": {
58523
59156
  "application/json": {
58524
59157
  "schema": {
58525
- "$ref": "#/components/schemas/CompanyRetentionSnapshot"
59158
+ "$ref": "#/components/schemas/CompanyActiveListingsResponse"
58526
59159
  }
58527
59160
  }
58528
59161
  },
58529
- "description": "The stored snapshot"
59162
+ "description": "One page of listing rows"
58530
59163
  },
58531
59164
  "400": {
58532
59165
  "content": {
@@ -58589,16 +59222,16 @@
58589
59222
  "description": "Search timed out or the cluster is overloaded — retry after `Retry-After` seconds."
58590
59223
  }
58591
59224
  },
58592
- "summary": "Company borrower retention (weekly snapshot)",
59225
+ "summary": "Retained borrowers listed for sale now (weekly)",
58593
59226
  "tags": [
58594
59227
  "Companies"
58595
59228
  ]
58596
59229
  }
58597
59230
  },
58598
- "/v1/companies/{nmlsId}/retention/active-listings": {
59231
+ "/v1/companies/{nmlsId}/retention/captured": {
58599
59232
  "get": {
58600
- "description": "The company's retained borrowers (their latest loan is still the company's) whose home is listed for sale right now, each with the company loan officer who wrote that loan — only LOs the company employed on the loan, not brokers' LOs on loans it only funded. Newest listing first; filter to one LO with `originator`. \"Listed now\" is the LO Borrower Retention tab's rule: an active MLS listing event in the last 90 days, list price at least $20k, not under contract. Checked weekly with the retention snapshot — `computedAt` says when. 404 means not computed for this company yet.",
58601
- "operationId": "companyRetentionActiveListings",
59233
+ "description": "The loss rows (the LO report's `churnedLoans` shape) one capturing loan officer took from the company's borrowers in a stored snapshot's `period`, newest first, paged. Read live from that LO's parcels, so `total` matches the snapshot's count for the LO (give or take loans recorded since `computedAt`). 404 when the snapshot has not been computed.",
59234
+ "operationId": "companyRetentionCaptured",
58602
59235
  "parameters": [
58603
59236
  {
58604
59237
  "description": "Company NMLS ID",
@@ -58611,51 +59244,67 @@
58611
59244
  }
58612
59245
  },
58613
59246
  {
58614
- "description": "`company` (default): loans written at the company. `team`: the company's CURRENT loan officers' borrowers — loans they wrote at the company or at a previous employer (`writtenAt`), e.g. a recruit's book.",
59247
+ "description": "The snapshot window whose `period` to use: `last12Months` (default) or `allTime`.",
58615
59248
  "in": "query",
58616
- "name": "view",
59249
+ "name": "window",
58617
59250
  "required": false,
58618
59251
  "schema": {
58619
- "description": "`company` (default): loans written at the company. `team`: the company's CURRENT loan officers' borrowers — loans they wrote at the company or at a previous employer (`writtenAt`), e.g. a recruit's book.",
59252
+ "default": "last12Months",
59253
+ "description": "The snapshot window whose `period` to use: `last12Months` (default) or `allTime`.",
58620
59254
  "enum": [
58621
- "company",
58622
- "team"
59255
+ "last12Months",
59256
+ "allTime"
58623
59257
  ],
58624
59258
  "type": "string"
58625
59259
  }
58626
59260
  },
58627
59261
  {
58628
- "description": "Only rows whose loan was written by this LO (NMLS id) — e.g. one of `activeListings.topOriginators`.",
59262
+ "description": "The capturing loan officer (a snapshot `capturingOriginators[].nmlsId`).",
58629
59263
  "in": "query",
58630
- "name": "originator",
58631
- "required": false,
59264
+ "name": "capturingLoNmlsId",
59265
+ "required": true,
58632
59266
  "schema": {
58633
- "description": "Only rows whose loan was written by this LO (NMLS id) — e.g. one of `activeListings.topOriginators`.",
59267
+ "description": "The capturing loan officer (a snapshot `capturingOriginators[].nmlsId`).",
58634
59268
  "pattern": "^\\d+$",
58635
59269
  "type": "string"
58636
59270
  }
58637
59271
  },
58638
59272
  {
58639
- "description": "Page size (1-100, default 25).",
59273
+ "description": "Only refinances or only second liens. Default both.",
58640
59274
  "in": "query",
58641
- "name": "size",
59275
+ "name": "kind",
58642
59276
  "required": false,
58643
59277
  "schema": {
58644
- "description": "Page size (1-100, default 25).",
58645
- "example": 25,
58646
- "maximum": 100,
59278
+ "description": "Only refinances or only second liens. Default both.",
59279
+ "enum": [
59280
+ "refi",
59281
+ "second"
59282
+ ],
59283
+ "type": "string"
59284
+ }
59285
+ },
59286
+ {
59287
+ "description": "Rows per page (default 100, at most 500).",
59288
+ "in": "query",
59289
+ "name": "limit",
59290
+ "required": false,
59291
+ "schema": {
59292
+ "description": "Rows per page (default 100, at most 500).",
59293
+ "maximum": 500,
58647
59294
  "minimum": 1,
58648
59295
  "type": "integer"
58649
59296
  }
58650
59297
  },
58651
59298
  {
58652
- "description": "Opaque cursor from the previous page's `cursor`.",
59299
+ "description": "Rows to skip (newest first).",
58653
59300
  "in": "query",
58654
- "name": "cursor",
59301
+ "name": "offset",
58655
59302
  "required": false,
58656
59303
  "schema": {
58657
- "description": "Opaque cursor from the previous page's `cursor`.",
58658
- "type": "string"
59304
+ "description": "Rows to skip (newest first).",
59305
+ "minimum": 0,
59306
+ "nullable": true,
59307
+ "type": "integer"
58659
59308
  }
58660
59309
  }
58661
59310
  ],
@@ -58664,11 +59313,11 @@
58664
59313
  "content": {
58665
59314
  "application/json": {
58666
59315
  "schema": {
58667
- "$ref": "#/components/schemas/CompanyActiveListingsResponse"
59316
+ "$ref": "#/components/schemas/OriginatorRetentionCaptured"
58668
59317
  }
58669
59318
  }
58670
59319
  },
58671
- "description": "One page of listing rows"
59320
+ "description": "The capturer's loss rows"
58672
59321
  },
58673
59322
  "400": {
58674
59323
  "content": {
@@ -58731,16 +59380,16 @@
58731
59380
  "description": "Search timed out or the cluster is overloaded — retry after `Retry-After` seconds."
58732
59381
  }
58733
59382
  },
58734
- "summary": "Retained borrowers listed for sale now (weekly)",
59383
+ "summary": "Loans one LO captured from this company",
58735
59384
  "tags": [
58736
59385
  "Companies"
58737
59386
  ]
58738
59387
  }
58739
59388
  },
58740
- "/v1/companies/{nmlsId}/retention/captured": {
59389
+ "/v1/companies/{nmlsId}/retention/likely-to-sell": {
58741
59390
  "get": {
58742
- "description": "The loss rows (the LO report's `churnedLoans` shape) one capturing loan officer took from the company's borrowers in a stored snapshot's `period`, newest first, paged. Read live from that LO's parcels, so `total` matches the snapshot's count for the LO (give or take loans recorded since `computedAt`). 404 when the snapshot has not been computed.",
58743
- "operationId": "companyRetentionCaptured",
59391
+ "description": "The company's retained borrowers (their latest loan is still the company's) whose home looks likely to be listed for sale soon, each with the company loan officer who wrote that loan — only LOs the company employed on the loan, not brokers' LOs on loans it only funded. Each row carries a likely-to-list score from 0 to 100: a priority / likelihood ranking, not a probability. Highest score first; filter to one LO with `originator`. \"Likely to list\" is the LO Borrower Retention tab's rule: a score of 90 or more, and not listed for sale or under contract now (those are in `active-listings`). Checked weekly with the retention snapshot — `computedAt` says when. 404 means not computed for this company yet.",
59392
+ "operationId": "companyRetentionLikelyToSell",
58744
59393
  "parameters": [
58745
59394
  {
58746
59395
  "description": "Company NMLS ID",
@@ -58753,67 +59402,51 @@
58753
59402
  }
58754
59403
  },
58755
59404
  {
58756
- "description": "The snapshot window whose `period` to use: `last12Months` (default) or `allTime`.",
59405
+ "description": "`company` (default): loans written at the company. `team`: the company's CURRENT loan officers' borrowers — loans they wrote at the company or at a previous employer (`writtenAt`), e.g. a recruit's book.",
58757
59406
  "in": "query",
58758
- "name": "window",
59407
+ "name": "view",
58759
59408
  "required": false,
58760
59409
  "schema": {
58761
- "default": "last12Months",
58762
- "description": "The snapshot window whose `period` to use: `last12Months` (default) or `allTime`.",
59410
+ "description": "`company` (default): loans written at the company. `team`: the company's CURRENT loan officers' borrowers — loans they wrote at the company or at a previous employer (`writtenAt`), e.g. a recruit's book.",
58763
59411
  "enum": [
58764
- "last12Months",
58765
- "allTime"
59412
+ "company",
59413
+ "team"
58766
59414
  ],
58767
59415
  "type": "string"
58768
59416
  }
58769
59417
  },
58770
59418
  {
58771
- "description": "The capturing loan officer (a snapshot `capturingOriginators[].nmlsId`).",
58772
- "in": "query",
58773
- "name": "capturingLoNmlsId",
58774
- "required": true,
58775
- "schema": {
58776
- "description": "The capturing loan officer (a snapshot `capturingOriginators[].nmlsId`).",
58777
- "pattern": "^\\d+$",
58778
- "type": "string"
58779
- }
58780
- },
58781
- {
58782
- "description": "Only refinances or only second liens. Default both.",
59419
+ "description": "Only rows whose loan was written by this LO (NMLS id) — e.g. one of `likelyToSell.topOriginators`.",
58783
59420
  "in": "query",
58784
- "name": "kind",
59421
+ "name": "originator",
58785
59422
  "required": false,
58786
59423
  "schema": {
58787
- "description": "Only refinances or only second liens. Default both.",
58788
- "enum": [
58789
- "refi",
58790
- "second"
58791
- ],
59424
+ "description": "Only rows whose loan was written by this LO (NMLS id) — e.g. one of `likelyToSell.topOriginators`.",
59425
+ "pattern": "^\\d+$",
58792
59426
  "type": "string"
58793
59427
  }
58794
59428
  },
58795
59429
  {
58796
- "description": "Rows per page (default 100, at most 500).",
59430
+ "description": "Page size (1-100, default 25).",
58797
59431
  "in": "query",
58798
- "name": "limit",
59432
+ "name": "size",
58799
59433
  "required": false,
58800
59434
  "schema": {
58801
- "description": "Rows per page (default 100, at most 500).",
58802
- "maximum": 500,
59435
+ "description": "Page size (1-100, default 25).",
59436
+ "example": 25,
59437
+ "maximum": 100,
58803
59438
  "minimum": 1,
58804
59439
  "type": "integer"
58805
59440
  }
58806
59441
  },
58807
59442
  {
58808
- "description": "Rows to skip (newest first).",
59443
+ "description": "Opaque cursor from the previous page's `cursor`.",
58809
59444
  "in": "query",
58810
- "name": "offset",
59445
+ "name": "cursor",
58811
59446
  "required": false,
58812
59447
  "schema": {
58813
- "description": "Rows to skip (newest first).",
58814
- "minimum": 0,
58815
- "nullable": true,
58816
- "type": "integer"
59448
+ "description": "Opaque cursor from the previous page's `cursor`.",
59449
+ "type": "string"
58817
59450
  }
58818
59451
  }
58819
59452
  ],
@@ -58822,11 +59455,11 @@
58822
59455
  "content": {
58823
59456
  "application/json": {
58824
59457
  "schema": {
58825
- "$ref": "#/components/schemas/OriginatorRetentionCaptured"
59458
+ "$ref": "#/components/schemas/CompanyLikelyToSellResponse"
58826
59459
  }
58827
59460
  }
58828
59461
  },
58829
- "description": "The capturer's loss rows"
59462
+ "description": "One page of likely-to-list rows"
58830
59463
  },
58831
59464
  "400": {
58832
59465
  "content": {
@@ -58889,7 +59522,7 @@
58889
59522
  "description": "Search timed out or the cluster is overloaded — retry after `Retry-After` seconds."
58890
59523
  }
58891
59524
  },
58892
- "summary": "Loans one LO captured from this company",
59525
+ "summary": "Retained borrowers likely to list their home (weekly)",
58893
59526
  "tags": [
58894
59527
  "Companies"
58895
59528
  ]
@@ -84358,6 +84991,97 @@
84358
84991
  ]
84359
84992
  }
84360
84993
  },
84994
+ "/v1/sales/analytics/market-stats": {
84995
+ "post": {
84996
+ "description": "Median sold price, price per sqft, days to sell and sale-to-list ratio over the closed sales in `period` (default `last12Months`), plus active inventory, median list price and the share of active listings with a price cut. Requires a geography (`zipCode`, `city`, `county`, `fips`, `geoPoint` or `geoBounds`). Rentals and prices under $25,000 are excluded, and active listings not touched within `activeWithinDays` are dropped. Medians are approximate and each carries the sample size it is computed from (`sold.samples`). **Property type:** the listing property-type field is populated only on recent rows, so a `propertyType` filter (and the rental exclusion by type) is reliable for recent months only; the price floor is what keeps rentals out of older periods. Billed as one analytics call.",
84997
+ "operationId": "salesMarketStats",
84998
+ "requestBody": {
84999
+ "content": {
85000
+ "application/json": {
85001
+ "schema": {
85002
+ "$ref": "#/components/schemas/SaleMarketStatsRequest"
85003
+ }
85004
+ }
85005
+ }
85006
+ },
85007
+ "responses": {
85008
+ "200": {
85009
+ "content": {
85010
+ "application/json": {
85011
+ "schema": {
85012
+ "$ref": "#/components/schemas/SaleMarketStatsResponse"
85013
+ }
85014
+ }
85015
+ },
85016
+ "description": "Sold and active market figures"
85017
+ },
85018
+ "400": {
85019
+ "content": {
85020
+ "application/json": {
85021
+ "schema": {
85022
+ "$ref": "#/components/schemas/ErrorResponse"
85023
+ }
85024
+ }
85025
+ },
85026
+ "description": "Validation error. Includes unresolvable location filters: a `city`/`county`/`state`/`zip` value that does not match a recognized location returns 400 rather than an empty result set. Resolve the name with `instantSearch` (use an id from its `results.locations[]`) or `suggestLocations` (use the `id` of a `source: \"dictionary\"` result), then pass that id back as the filter value."
85027
+ },
85028
+ "401": {
85029
+ "content": {
85030
+ "application/json": {
85031
+ "schema": {
85032
+ "$ref": "#/components/schemas/ErrorResponse"
85033
+ }
85034
+ }
85035
+ },
85036
+ "description": "Unauthorized"
85037
+ },
85038
+ "403": {
85039
+ "content": {
85040
+ "application/json": {
85041
+ "schema": {
85042
+ "$ref": "#/components/schemas/ErrorResponse"
85043
+ }
85044
+ }
85045
+ },
85046
+ "description": "Forbidden (authenticated, but missing required context — e.g. no active organization)"
85047
+ },
85048
+ "404": {
85049
+ "content": {
85050
+ "application/json": {
85051
+ "schema": {
85052
+ "$ref": "#/components/schemas/ErrorResponse"
85053
+ }
85054
+ }
85055
+ },
85056
+ "description": "Not found"
85057
+ },
85058
+ "413": {
85059
+ "content": {
85060
+ "application/json": {
85061
+ "schema": {
85062
+ "$ref": "#/components/schemas/PayloadTooLarge"
85063
+ }
85064
+ }
85065
+ },
85066
+ "description": "Response payload too large — detail endpoint capped to fit Lambda response limits"
85067
+ },
85068
+ "503": {
85069
+ "content": {
85070
+ "application/json": {
85071
+ "schema": {
85072
+ "$ref": "#/components/schemas/SearchUnavailable"
85073
+ }
85074
+ }
85075
+ },
85076
+ "description": "Search timed out or the cluster is overloaded — retry after `Retry-After` seconds."
85077
+ }
85078
+ },
85079
+ "summary": "Neighborhood market stats for a ZIP, city, county or area",
85080
+ "tags": [
85081
+ "Sales"
85082
+ ]
85083
+ }
85084
+ },
84361
85085
  "/v1/sales/analytics/summary": {
84362
85086
  "post": {
84363
85087
  "operationId": "salesAnalyticsSummary",