The contract
| Parameter | Type | Default | Constraints |
|---|---|---|---|
page | integer | 1 | ≥ 1 |
limit | integer | 20 | 1–100 |
pagination object:
| Field | Meaning |
|---|---|
page | The page you requested (echoed back, never re-numbered) |
limit | The page size that was applied (may be clamped to 100) |
total | Total active records matching the query |
totalPages | Math.ceil(total / limit) — convenience field |
Iterating to completion
Sorting and filtering
Most list endpoints acceptsort, order, and resource-specific filter parameters. They compose with pagination:
| Parameter | Type | Notes |
|---|---|---|
sort | string | Field to sort by — varies per resource (see the endpoint page) |
order | asc or desc | Default desc |
Things to know
- Pagination is stable under steady traffic but not snapshot-isolated — a record created between page 2 and page 3 will shift everything. If you need a consistent snapshot, paginate by sorting on a stable cursor (e.g.
createdAt asc) and remember the last seen value rather than re-usingpage. limitis hard-capped at 100. Requestinglimit=500is silently clamped to100.page=0is treated aspage=1rather than returning an error.- Soft-deleted records are excluded.
totalreflects only active rows. - The
paginationenvelope is consistent across every list endpoint. Integrators can write a single pagination helper and reuse it everywhere.
Performance tips
- Use
limit=100for bulk reads — fewer round-trips, same rate-limit cost (one request per page). - Filter aggressively in the query rather than client-side — every list endpoint supports the obvious filters (status, date range, type) and applies them at the database level.
- For very large exports (>10k records), prefer the dedicated export endpoints (e.g.
GET /api/v1/farms/{id}/reports/accounting-export) when available — they return the full dataset in a single call with a higher rate-limit budget.