Skip to content
RUBI

Pagination

Interviews, traders, trades, webhook deliveries and integration runs use page based pagination and return the total count.

API keys, webhook endpoints, the webhook event catalog and integrations return the full collection as { data: [...] }, without pagination metadata.

Parameters#

ParameterDefaultRules
page11 based page number.
limit25Items per page, maximum 100.

Response#

json
{
  "data": [ { "id": "..." } ],
  "meta": { "page": 2, "limit": 25, "total": 137 }
}

GET /v1/interviews also returns kpis next to data and meta, computed over your whole organization.

Iterating all pages#

typescript
async function* all<T>(path: string) {
  for (let page = 1; ; page++) {
    const res = await fetch(`https://api.rubikyt.com${path}?page=${page}&limit=100`, {
      headers: { Authorization: `Bearer ${process.env.RUBI_API_KEY}` },
    });
    if (!res.ok) throw new Error(`Rubi API request failed: ${res.status}`);
    const body = (await res.json()) as { data: T[]; meta: { page: number; limit: number; total: number } };
    yield* body.data;
    if (page * body.meta.limit >= body.meta.total) return;
  }
}