Skip to Content
API ReferenceListingsEndpoints

Listings

Everything under /api/listings is served by src/routes/listings.ts. Every route uses passthrough auth (middleware.jwt.passthrough): a guest with no token is allowed, a valid token makes the request a user, and an invalid token is a 401. Guest responses are scrubbed; restricted listings are removed at the exits listed in its enforcement register. Terms are defined in the Glossary.

This page is the operation index. The summary table carries each endpoint’s auth, caching, side effects and error statuses; the mechanisms, parameters and rationale are on the deep pages, and the full parameter contract is in Swagger (/swagger).

Search & Count pipeline · Detail, Similar & History · NLP, Featured & Misc · Scrubbing · Workflows W1 (search) and W2 (history)

Operations

Every route is passthrough auth; no role is required. “Cached / header” names the response cache header the handler writes; “none” means no Cache-Control.

Method & pathCached / headerSide effectsErrorsDeep dive
GET / POST /api/listings/searchnonenone400 (unknown key, radius without lat/long, bad map); relayed upstream statusSearch
GET /api/listings/count@cached("listings:count") → Cache-Control: private, max-agenone400 (validation; fields/sortBy/resultsPerPage/pageNum/listings and raw.* are not allowed on this schema); relayed upstream statusCount
POST /api/listings/countnone (array body written directly)noneas GET /count, per array itemCount
GET /api/listings/{mlsNumber}nonedetached FUB “Viewed Property” event for a signed-in non-Agent when BOSS_ENABLED400 (validation); settings.hide_unavailable_listings_http_code (default 410) for restricted / hidden / entire-listing-N; relayed upstream 404Detail
GET /api/listings/{mlsNumber}/similarnonenone400 (validation); relayed upstream statusSimilar
GET /api/listings/historynonenone400 (validation); relayed upstream statusHistory
POST /api/listings/nlpnonenone400 (validation); relayed upstream statusNLP
GET /api/listings/featured/{slug}@cached("favorites:featuredListings") by slug, skipped with lat/long; header: nonenone400 (bad slug format); 404 when the slug is not mapped; relayed upstream statusFeatured
GET /api/listings/locations (deprecated)@cached("listings:autosuggest:locations") → Cache-Controlnone400 (validation); relayed upstream statusLocations
GET /api/listings/lastUpdatedOn (Not in OSS)@cached("listings:lastUpdatedOn") → Cache-Controlnonenone produced by the route (no validation, no upstream call); only the generic 500 for an unexpected errorlastUpdatedOn

GET /api/listings/lastUpdatedOn and its service method are in @oss-remove regions, so they are absent from the open-source export.

Route order

@koa/router matches in registration order, so the declaration order in src/routes/listings.ts decides which handler a path reaches:

  • search, count, locations, nlp, lastUpdatedOn, featured/{slug} and history are all declared before the parametric /{mlsNumber}, which would otherwise match them as an MLS number.
  • /{mlsNumber}/similar is declared before /featured/{slug}, so GET /api/listings/featured/similar reaches the similar handler with mlsNumber = "featured", not the featured handler.

Behavioral notes

The behaviour that used to be listed here now lives with its mechanism:

  • Search filters, status vocabularies, aggregates, queries[], repeated values, the identity fields added to fields / clusterFields → Search & Count.
  • Single availability and the 410, similar, cross-board history, and the event-selector callers that reach RepliersListings.single directly → Detail, Similar & History.
  • NLP, featured, locations and the synthetic lastUpdatedOn → NLP, Featured & Misc.

Verified against portal-backend 997ae3e, 2026-10-20.

Last updated on