Skip to content
Developers
OpenAPI

Pagination

API v1 Last updated 2026-09-30 View as Markdown

#Pagination

Only GET /api/v1/events paginates — every other endpoint returns a single object or a small, already-bounded list (a race's or event's own results).

#Parameters

Query param Default Range Invalid value
page 1 ≥ 1 400 API_PARAM_INVALID, params.name: "page"
pageSize 20 1–100 400 API_PARAM_INVALID, params.name: "pageSize"
curl -s "https://sail-club-server.cloud.run/api/v1/events?page=2&pageSize=50" \
  -H "Authorization: Bearer $TOKEN"

#Response envelope

{
  "items": [ { "id": "…", "name": "…", "startDate": "2026-10-11T09:00:00Z", "…": "…" } ],
  "nextPage": 3,
  "totalItems": 128
}

nextPage is null on the last page — loop while it isn't:

let page = 1;
const all = [];
while (page !== null) {
  const res = await fetch(`https://sail-club-server.cloud.run/api/v1/events?page=${page}&pageSize=100`, {
    headers: { Authorization: `Bearer ${token}` },
  });
  const body = await res.json();
  all.push(...body.items);
  page = body.nextPage;
}

Sort order is fixed: newest startDate first (events with no start date sort last), ties broken by id — so paging through the whole list twice in a row returns items in the same relative order even if a new event was added in between (it appears wherever its date puts it, without reshuffling the rest).

At most 1000 events are reachable through paging for one club (an internal index cap on our side) — a club running more than that should talk to us; this hasn't come up in practice.