Pagination
List endpoints are page-based. The audit export is cursor-based so you can resume a long export without losing ordering.
Page-based lists
Pass page (1-based) and page_size query parameters. Responses include a pagination object:
{
"data": [{ "id": "item_1" }],
"pagination": { "page": 1, "pageSize": 20, "total": 57, "totalPages": 3 }
}
Iterate until page >= totalPages:
let page = 1;
let totalPages = 1;
do {
const result = await fabhub.listItems({ page, pageSize: 100 });
// handle result.data
totalPages = result.pagination.totalPages;
page += 1;
} while (page <= totalPages);
Use a bounded page_size (the API caps it) and prefer search filters over scanning every page.
Cursor-based export (audit events)
GET /v1/audit/events returns a cursor instead of page counts:
{
"data": [{ "id": "evt_1" }],
"pagination": { "hasMore": true, "nextCursor": { "createdAt": "2026-06-19T14:02:00Z", "id": "evt_1" } }
}
Resume by passing the cursor back as cursor_created_at and cursor_id (with the SDK, listAuditEvents):
let cursor = undefined;
do {
const page = await fabhub.listAuditEvents({
limit: 200,
cursorCreatedAt: cursor?.createdAt,
cursorId: cursor?.id,
});
// handle page.data
cursor = page.pagination.nextCursor ?? undefined;
} while (cursor);