Skip to content

Pagination Filtering Sorting Standard

Purpose

This standard defines collection response behavior for future Algosure API contracts.

Pagination

Rule Requirement
Paginate growing collections Any growing list, search, or activity feed must paginate.
Stable ordering Pages require deterministic ordering.
Server limits APIs enforce safe maximum page size.
Metadata Responses include page metadata and navigation links where applicable.
Mobile defaults Default page sizes should support mobile performance.

Collection Envelope

{
  "data": [],
  "meta": {
    "correlationId": "cor_123",
    "page": {
      "size": 25,
      "hasNext": true,
      "nextCursor": "cursor_abc"
    }
  },
  "links": {
    "next": "/future/path?cursor=cursor_abc"
  }
}

Filtering

  • Filters must be allowlisted in future endpoint specs.
  • Filters use domain language.
  • Tenant filtering is implicit and enforced server-side.
  • Unauthorized fields cannot be used as filters.
  • Organization filters must match authorized organization context.

Sorting

  • Sort fields must be allowlisted.
  • Default sort must be specified.
  • Equal values need stable secondary ordering where required.
  • Sorting must not reveal unauthorized records or hidden fields.

Search Boundary

Search APIs may use search indexes, but search indexes are read models. Source fact correction must happen in the owning Domain module.