ClientCasa
API

Pagination

How list endpoints page through results — offset-based with a hard cap.

All list endpoints (GET /api/v1/<resource>) accept two query parameters:

ParameterTypeDefaultMax
pageinteger ≥ 11
pageSizeinteger ≥ 125100

Requesting pageSize=999 returns 400 invalid_request. Use multiple pages.

Response shape

{
  "data": [ /* array of resources */ ],
  "pagination": {
    "page": 2,
    "pageSize": 25,
    "total": 73,
    "totalPages": 3,
    "hasMore": true
  }
}

hasMore is true when page < totalPages. Loop until hasMore: false:

let page = 1
const all = []
while (true) {
  const res = await fetch(`/api/v1/clients?page=${page}&pageSize=100`, {
    headers: { 'x-api-key': key },
  }).then((r) => r.json())
  all.push(...res.data)
  if (!res.pagination.hasMore) break
  page++
}

Filtering

Most list endpoints accept resource-specific filters (e.g., ?clientId=<id>, ?status=active). See the individual resource pages for the supported filters.

On this page