Pagination
Iterate over list responses using limit and offset
All list endpoints in the RevKeen API use offset-based pagination via limit and offset query parameters. Responses are wrapped in a data array alongside a pagination block describing the current window.
If you are migrating from a cursor-based API, think of offset as the zero-based index of the first item you want back and limit as the page size.
Request parameters
| Parameter | Type | Default | Max | Description |
|---|---|---|---|---|
limit | integer | 25 | 100 | Number of items to return. Values above the max are clamped. |
offset | integer | 0 | — | Zero-based index of the first item to return. |
List endpoints may also expose resource-specific filters (for example status, search, or created_after). See each endpoint's reference for the full parameter list.
Response shape
{
"data": [
{ "id": "cus_01HT...", "name": "Acme Clinic", "email": "ops@acme.example" },
{ "id": "cus_01HT...", "name": "Riverside Dental", "email": "admin@rsd.example" }
],
"pagination": {
"limit": 25,
"offset": 0,
"total": 312,
"hasMore": true
}
}| Field | Type | Description |
|---|---|---|
data | array | Current page of items. |
pagination.limit | integer | Echo of the requested limit after clamping. |
pagination.offset | integer | Echo of the requested offset. |
pagination.total | integer | Total items matching the filter, across all pages. |
pagination.hasMore | boolean | true when offset + data.length < total. |
Iteration pattern
Continue fetching until pagination.hasMore is false. Advance offset by the page size, not by data.length — the latter drifts on the last page.
# Page 1
curl "https://staging-api.revkeen.com/v2/customers?limit=100&offset=0" \
-H "x-api-key: $REVKEEN_API_KEY"
# Page 2
curl "https://staging-api.revkeen.com/v2/customers?limit=100&offset=100" \
-H "x-api-key: $REVKEEN_API_KEY"import { RevKeen } from "@revkeen/sdk";
const client = new RevKeen({ apiKey: process.env.REVKEEN_API_KEY! });
// Manual iteration
for (let offset = 0; ; offset += 100) {
const page = await client.customers.list({ limit: 100, offset });
for (const customer of page.data) {
// …
}
if (!page.pagination.hasMore) break;
}
// SDK helper — automatic pagination
for await (const customer of client.customers.listAutoPaging({ limit: 100 })) {
// …
}import revkeen "github.com/RevKeen/sdk-go"
iter := client.Customers.List(ctx, &revkeen.CustomerListParams{Limit: 100})
for iter.Next() {
customer := iter.Current()
// …
}
if err := iter.Err(); err != nil {
return err
}use RevKeen\RevKeenClient;
$client = new RevKeenClient(['api_key' => getenv('REVKEEN_API_KEY')]);
foreach ($client->customers->autoPagingList(['limit' => 100]) as $customer) {
// …
}Choosing a page size
- Default (
limit=25) is tuned for interactive UIs. limit=100is the right choice for batch workloads and exports.- For end-user-facing lists, page from the server rather than fetching all pages and slicing client-side — latency and memory both scale linearly.
Stability across pages
Items are ordered by createdAt DESC, id DESC unless a list endpoint documents otherwise. If new items are created while you are iterating, an item may appear on a later page than expected. For strict one-shot snapshots, filter by a fixed created_before timestamp.