---
title: "Keeping in Sync · COUNT Partner API"
description: "Keep an external copy of a COUNT workspace up to date: an initial load, a 15-minute or on-demand poll with updatedSince on each list endpoint, deletions from…"
canonical: "https://developers.getcount.com/guides/keeping-in-sync"
source: "https://developers.getcount.com/guides/keeping-in-sync"
---
Guides

# Keeping in Sync

Keep an external copy of a COUNT workspace current: load it once, then pull only what changed every few minutes or whenever a user asks — including what was deleted.

The pieces

Every list endpoint takes `updatedSince` and returns the records created or changed since then, with a `nextUpdatedSince` cursor. `includeDeleted=true` brings back deleted records with `isDeleted: true`, and [GET /partners/deleted-records](https://developers.getcount.com/reference/deleted-records) lists the records removed outright. Webhooks tell you when to poll early.

## Step 1 — Initial load

Note the time before you start, then read every list endpoint you need with `updatedSince` set to an early date (for example `2000-01-01T00:00:00Z`). Paging by cursor is safe while the workspace keeps changing: a record edited during the load moves to the end of the walk instead of shifting the pages. Store the final `nextUpdatedSince` of each endpoint, and start the deleted-records cursor at the time you noted.

## Step 2 — Poll for changes

Every 15 minutes, or when a user presses a “sync now” button, call each list endpoint with its stored cursor as `updatedSince`. The rows come back oldest change first with `nextUpdatedSince` and `hasMore` beside them. While `hasMore` is true, call again with `nextUpdatedSince`; when it is false, store `nextUpdatedSince` for the next poll. An empty page still returns a cursor — keep it.

A poll of vendors

```json
GET /partners/vendors?updatedSince=2026-11-18T09:00:00Z&includeDeleted=true

{
  "page": 1,
  "limit": 50,
  "totalRecords": 2,
  "vendors": [
    { "id": "d4e5f6a7-…", "name": "Office Depot", "isDeleted": false, "updatedAt": "2026-11-18T09:02:11.000Z" },
    { "id": "a1b2c3d4-…", "name": "Old Supplier", "isDeleted": true, "updatedAt": "2026-11-18T09:15:40.000Z" }
  ],
  "nextUpdatedSince": "cursor_eyJ1cGRhdGVkQXQiOiIyMDI2LTExLTE4VDA5OjE1OjQwLjAwMDAwMFoi…",
  "hasMore": false
}
```

`updatedSince` cannot be combined with `page` above 1 or a sort parameter — the cursor sets the order. The chart of accounts returns a flat list of changed accounts in this mode, each naming its parent in `parentAccountUuid`.

## Step 3 — Apply deletions

Send `includeDeleted=true` on resources that support it (vendors, customers, products, people, taxes, projects, project tasks, tasks, time entries, recurring invoice templates, the chart of accounts, transactions, invoices, and bills) and remove the rows that come back with `isDeleted: true`.

Records removed outright — tags, tag groups, journal entry lines, expense receipts, customer contacts, addresses and notes, budgets, and any other hard delete — are listed by [GET /partners/deleted-records](https://developers.getcount.com/reference/deleted-records), with its own cursor. Editing a journal entry replaces its lines, so the old line ids show up there and the new lines on the journal entries list. The feed keeps 90 days: a cursor older than that returns 410, and the fix is another initial load.

Poll one resource and the deletions

```javascript
// One cursor per list endpoint, plus one for the deleted-records feed.
// Store them durably — they are where the next poll resumes.
async function syncResource({ path, rowsKey, cursorStore }) {
  let updatedSince = await cursorStore.get(path);
  let hasMore = true;

  while (hasMore) {
    // signedGet is illustrative — see Authentication & signing for HMAC headers.
    const response = await signedGet(
      `${baseUrl}${path}?updatedSince=${encodeURIComponent(updatedSince)}&limit=100`
    );
    const page = response.data ?? response;
    for (const record of page[rowsKey]) {
      if (record.isDeleted) await localStore.remove(record.id);
      else await localStore.upsert(record.id, record); // upsert by id: a record can appear twice
    }
    updatedSince = page.nextUpdatedSince;
    hasMore = page.hasMore;
    await cursorStore.set(path, updatedSince);
  }
}

async function syncDeletions({ cursorStore }) {
  let updatedSince = await cursorStore.get('/partners/deleted-records');
  let hasMore = true;

  while (hasMore) {
    const response = await signedGet(
      `${baseUrl}/partners/deleted-records?updatedSince=${encodeURIComponent(updatedSince)}`
    );
    for (const deletedRecord of response.data.deletedRecords) {
      await localStore.remove(deletedRecord.id);
    }
    updatedSince = response.data.nextUpdatedSince;
    hasMore = response.data.hasMore;
    await cursorStore.set('/partners/deleted-records', updatedSince);
  }
}
```

## Step 4 — Poll early on webhooks

Webhooks cover customers, vendors, transactions, invoices, and bills (`*.created`, `*.updated`, `*.deleted`). Treat a delivery as a signal to run that resource’s poll now rather than as the change itself — the poll is what keeps the cursor moving, and it picks up anything a missed delivery would have carried. See [Webhooks](https://developers.getcount.com/reference/webhooks).

## Duplicates and ordering

A record changed again while you are paging can come back on a later page, and a cursor you retry returns the same rows. Upsert by `id` and let the newest `updatedAt` win.

Transactions, invoices, and bills also accept the older `updatedFrom` and `updatedTo` range filter, which pages by `page`. Prefer `updatedSince` for syncing; the two cannot be sent together.

## Through MCP

The MCP list tools take the same `updatedSince` and `includeDeleted` under `query`, and `COUNT_list_deleted_records` reads the deletion feed.

## Rate limits

A poll costs one request per resource when nothing changed. Polling a dozen resources every 15 minutes stays far inside the limit of 100 requests per minute per user of each app; back off on 429 and honour Retry-After. See [Errors & troubleshooting](https://developers.getcount.com/getting-started/errors).
