Skip to content
Support

Paging and incremental sync

Owner, AdminLast checked 25 November 20263 min readArticle ID: developers-pagination
On this page

Page through lists newest first, or use sync mode with updated_since and a cursor to keep your own copy of the data up to date.

Every list (/customers, /contacts, /jobs, /visits, /invoices, /estimates, /payments, /credit-notes) has two modes.

CompareOffset mode (default)Sync mode
Use it toShow or browse a page of recordsKeep a copy of the data up to date
Turned on byno updated_since and no cursorupdated_since or cursor
Ordernewest firstoldest change first
Pagingpage and per_pagecursor
metapage, per_page, totalper_page, has_more, next_cursor

per_page is 1 to 100 (25 by default). Filters such as job_id, customer_id, invoice_id and status work in both modes.

Page through records in offset mode

GET /api/v1/invoices?status=paid&page=2&per_page=50

If records are created while you page, a later page can repeat or skip one. That's what sync mode is for.

Incremental sync: what's updated since a date

For an incremental sync of only what changed, use sync mode: call a list with updated_since.

GET /api/v1/invoices?updated_since=2026-11-01T00:00:00Z
  • updated_since is an ISO 8601 date or timestamp. A bare date means midnight UTC.
  • Rows come oldest change first.
  • Pass meta.next_cursor back as cursor to carry on after the last row. Don't build or change a cursor yourself.
  • has_more: false means you're caught up.

Keep polling with the cursor

  1. First run: call with updated_since (use 1970-01-01 for everything) and page with cursor until has_more is false. Store the last next_cursor.
  2. Later: call with cursor=<stored>. You get only what changed since. If nothing did, data is empty and you get the same cursor back.
let cursor = await loadCursor(); // null the first time
for (;;) {
  const qs = cursor ? `cursor=${cursor}` : "updated_since=1970-01-01";
  const res = await api(`/invoices?${qs}&per_page=100`);
  for (const invoice of res.data) await upsert(invoice); // idempotent by id
  cursor = res.meta.next_cursor ?? cursor;
  await saveCursor(cursor);
  if (!res.meta.has_more) break;
}

A change appears in sync mode a few seconds after it's saved: rows are listed once they're at least 5 seconds old. Upsert by id, because a row can come back again if it changes again.

Conditional requests

Every GET that returns 200 carries an ETag header (and Cache-Control: private, no-cache). Keep the tag with the copy you saved, and send it back as If-None-Match the next time you ask for the same thing:

  • If nothing changed, you get 304 Not Modified with no body. Keep using your copy.
  • If anything changed, you get a normal 200 with the new body and a new ETag.
GET /api/v1/job-lookups
Authorization: Bearer <token>
If-None-Match: "1c1f0c9d6f4b2a8e9d3c7b5a4e2f1d0c"

HTTP/1.1 304 Not Modified
ETag: "1c1f0c9d6f4b2a8e9d3c7b5a4e2f1d0c"
  • A tag belongs to one URL and query string: another page, filter or cursor is a different response with its own tag. Tags are also per organisation.
  • A 304 counts towards the rate limits like any request. It saves the download, not the call.
  • Only reads are tagged. Writes, errors and the token endpoint never carry an ETag, and If-None-Match has no effect on them.

Which records are listed

  • Customers, contacts, jobs, visits, invoices and estimates: archived records are left out.
  • Payments: voided payments are included, with voided_at set.
  • Credit notes: archived credit notes are included, with archived_at set, because their credit still applies.

In this section