Skip to content
Developers
Menu

API

Pagination

Walk long credential lists with cursor pagination: page size, next_cursor and the end of the list.

Updated

On this page

GET /api/v1/credentials uses cursor pagination. Results are ordered newest first, and each page continues exactly where the previous one ended, even while new credentials are being issued.

Parameters

ParameterDefaultMaximumDescription
limit50100Credentials per page, from 1 to 100.
cursornoneThe next_cursor value from the previous response.

Reading a page

Each response contains data (the page) and next_cursor:

  • When more credentials exist, next_cursor is an opaque string. Pass it unchanged as cursor to get the next page.
  • On the last page, next_cursor is null.

Treat the cursor as opaque: do not build or edit it. Keep the same filters (status, record_type, issued_after, issued_before) on every page of one walk. An invalid cursor returns 400; restart from the first page.

Example: fetch every page

async function listAllCredentials(apiKey) {
  const all = [];
  let cursor = null;
  do {
    const url = new URL("https://app.arrota.com/api/v1/credentials");
    url.searchParams.set("limit", "100");
    if (cursor) url.searchParams.set("cursor", cursor);
    const response = await fetch(url, { headers: { Authorization: `Bearer ${apiKey}` } });
    if (!response.ok) throw new Error(`Arrota API ${response.status}`);
    const page = await response.json();
    all.push(...page.data);
    cursor = page.next_cursor;
  } while (cursor);
  return all;
}

Every page counts towards your rate limit. For large walks, use limit=100.

Using Arrota rather than building on it? The Help Center covers product workflows.