Skip to content

Filtering and sorting

List endpoints share a small set of query conventions. The API reference is authoritative per endpoint — this page is what holds across them.

GET /api/expenses?page=2&pageSize=50
Parameter Default Range
page 1 ≥ 1
pageSize 20 1–100

Paginated endpoints return the page alongside its totals, so you can size the pager without walking the collection:

{
"expenses": [],
"page": 2,
"pageSize": 50,
"total": 412,
"totalPages": 9
}

GET /api/properties, GET /api/units, and GET /api/tenants support opt-in pagination during the compatibility rollout. Supply either page or pageSize to receive a bounded page with the metadata above. The omitted counterpart defaults to page=1 or pageSize=20; pageSize cannot exceed 100.

GET /api/properties?page=1&pageSize=20&sortBy=name&sortDirection=asc
GET /api/units?page=1&expiresInDays=90&sortBy=leaseExpiresInDays
GET /api/tenants?page=2&includeInactive=false

Omitting both page parameters preserves the legacy complete collection response without pagination metadata. New integrations should always request explicit pages; there is no unbounded pageSize value. The default will change only in a separately announced coordinated or versioned rollout.

The collection keys remain properties, units, and tenants. noteSummaries only covers records on the returned page; clients that do not show note previews can add includeNoteSummaries=false to skip them and receive an empty array. Property and unit requests can add includeSummary=true to receive a summary over all filtered records, independent of the page. Property summaries include totalUnits, occupiedUnits, and overduePostedRentCents; unit summaries include overduePostedRentCents. Summary calculation and aggregate sorting/filtering require work across matching records.

expiresInDays is an inclusive unit filter (0–3650), evaluated against the API’s current calendar date. It includes active leases already past their end date, and excludes units without a current lease and leases with no end date. Expiry sorting uses days remaining, with expired and unleased units at zero and month-to-month leases after dated leases in ascending order.

An empty result has total=0 and totalPages=1. An out-of-range page returns an empty collection, preserves the requested page, and reports the actual totals. Clients can return to totalPages after a deletion makes their current page empty.

Every sort ends with a unique ID tie-breaker. Nullable sort fields follow PostgreSQL’s ordering: nulls last ascending and first descending. Offset pagination gives stable navigation for an unchanged dataset; it does not provide a snapshot across concurrent creates, updates, or deletions. Complete-collection clients should iterate pages and restart if they require a consistent view after changes: a page whose total differs from the first page’s, or fewer unique IDs than total, means the collection changed while it was being read.

Other bounded collections, such as notes on one entity and the units of one property, return the whole set without pagination metadata. Consult each endpoint’s reference.

Where sorting is supported it is two parameters, and sortBy is a fixed enum rather than an arbitrary field name:

GET /api/vendors?sortBy=name&sortDirection=asc
GET /api/work-orders?sortBy=priority&sortDirection=desc

sortDirection is asc or desc. The allowed sortBy values differ per endpoint and are listed on its reference page.

Calendar dates are YYYY-MM-DD. Range filters come in *After / *Before pairs and are inclusive:

GET /api/vendors?createdAfter=2026-01-01&createdBefore=2026-03-31

Reporting endpoints instead take an explicit startDate and endDate.

Filters are exact-match on an id or an enum, and combine with AND:

GET /api/work-orders?status=open&priority=emergency&propertyId=9c4e…

Free-text search, where an endpoint supports it, is a separate search parameter. For search that spans resource types, use GET /api/search rather than filtering each list.