Tours & Events
Conventions

Pagination

Page + limit pagination shape used by all list endpoints

List endpoints use offset pagination with page and limit query parameters.

Request

ParameterTypeDefaultDescription
pageinteger11-based page number.
limitinteger10Items per page. Most endpoints cap at 100.
GET /api/events?page=2&limit=25
Authorization: Bearer tke_live_...

Response envelope

{
  "data": [
    /* ... resources ... */
  ],
  "total": 248,
  "page": 2,
  "limit": 25,
  "totalPages": 10
}
FieldTypeDescription
dataarrayThe page of resources.
totalintegerTotal matching records across all pages.
pageintegerThe page that was returned.
limitintegerThe page size that was applied.
totalPagesintegerceil(total / limit).

Walking all pages

async function* allEvents(client) {
  let page = 1;
  while (true) {
    const res = await client.get(`/events?page=${page}&limit=100`);
    yield* res.data;
    if (page >= res.totalPages) return;
    page += 1;
  }
}

For very large result sets, prefer narrower filters (status, tourId, date ranges) over walking every page — server-side filters are always cheaper.

Sorting

Sorting is endpoint-specific. Where supported, list endpoints accept sortBy and sortDir=asc|desc. See the individual endpoint docs.

On this page