Skip to content
Quenza
MCPNew: use this help center in Claude, ChatGPT or CursorConnect →

Pagination

1 min read

Page through long lists of clients, members or tasks in the Quenza API with offset and limit, and follow the next link until the last page.

List clients, List members and List tasks return their records in pages. You choose the page with two query parameters:

  • limit: how many records you get, from 1 to 100. The default is 20. A larger number counts as 100.
  • offset: how many records to skip from the start. The default is 0.

So ?limit=50&offset=100 returns records 101 to 150.

Every list answers with the same three parts:

{
"data": [ ... ],
"meta": { "limit": 50, "offset": 100, "total": 212 },
"links": {
"next": "https://developers.quenza.com/v1/clients?limit=50&offset=150",
"prev": "https://developers.quenza.com/v1/clients?limit=50&offset=50"
}
}
  • data holds the records of this page.
  • meta.total is the number of records in all pages together.
  • links.next is the full URL of the next page, or null on the last page. links.prev is the page before, or null on the first page.

Follow links.next until it is null. This reads all clients of the workspace, 100 at a time:

async function allClients() {
const clients = [];
let url = 'https://developers.quenza.com/v1/clients?limit=100';
while (url) {
const response = await fetch(url, {
headers: { Authorization: `Bearer ${process.env.QUENZA_API_TOKEN}`, Accept: 'application/json' },
});
if (!response.ok) throw new Error(`Quenza API error ${response.status}`);
const { data, links } = await response.json();
clients.push(...data);
url = links.next;
}
return clients;
}

Clients and members come sorted by last name, then first name. Tasks come newest first. When someone adds a client while you page through the list, the records after it move one place; read the whole list again if you need an exact copy.

Enlarged screenshot from this article