Skip to main content

How it works

All list endpoints use cursor-based pagination. Each response includes pagination metadata:
{
  "data": [...],
  "pagination": {
    "cursor": "eyJpZCI6IjEyMyJ9",
    "hasMore": true,
    "total": 487
  }
}

Requesting pages

Pass the cursor from the previous response to fetch the next page:
# First page (default: 50 items)
curl ".../brands?limit=20"

# Next page
curl ".../brands?limit=20&cursor=eyJpZCI6IjEyMyJ9"

Parameters

ParameterTypeDefaultDescription
limitinteger50Items per page (max 100)
cursorstringCursor from previous response

Iterating through all pages

async function fetchAllBrands(workspaceId) {
  let cursor = null;
  const allBrands = [];

  do {
    const url = new URL(`.../brands`);
    url.searchParams.set('limit', '100');
    if (cursor) url.searchParams.set('cursor', cursor);

    const response = await fetch(url, { headers: { Authorization: `Bearer ${apiKey}` } });
    const { data, pagination } = await response.json();

    allBrands.push(...data);
    cursor = pagination.hasMore ? pagination.cursor : null;
  } while (cursor);

  return allBrands;
}