Pagination & filtering
How list endpoints page and filter — the common conventions, and where to find the exact parameters for each endpoint.
List endpoints return pages of results, not everything at once. The gateway passes paging and filter parameters straight through to the capability, so the exact names and limits are defined per endpoint — check the API Explorer for the one you're calling. Most follow the same conventions below.
Common conventions
| Parameter | Purpose | Example |
|---|---|---|
limit | How many items to return. | ?limit=50 |
offset | How many items to skip (offset paging). | ?offset=100 |
order | Sort field and direction, as field.direction. | ?order=created_at.desc |
List
curl "https://api.revenexx.com/v1/products?limit=50&order=created_at.desc" \
-H "X-Revenexx-Tenant: <TENANT_SLUG>" \
-H "X-Revenexx-Api-Key: rvxk_..."
A typical page response carries the items plus the paging echo:
Page
{
"items": [ /* ... */ ],
"total": 248,
"limit": 50,
"offset": 0
}
Paging through everything
Increase offset by limit until a page returns fewer items than you asked for:
Paginate
async function* pages(path, limit = 100) {
for (let offset = 0; ; offset += limit) {
const res = await fetch(`${path}?limit=${limit}&offset=${offset}`, { headers })
const { items } = await res.json()
yield* items
if (items.length < limit) return
}
}
Field names, the default and maximum
limit, the sortable fields, and the exact response shape are defined by each capability. The API Explorer shows the authoritative parameters and schema for every endpoint your tenant exposes.