Skip to content
Display settings
Reading preferences

Saved only in this browser.

Menu navigation
Services
EnterpriseGrowthCoffee BreakAll categoriesRequest a free consultation

Incremental Sync for Third-Party APIs: A Go/No-Go Guide to Cursors, Deletes and Backfills

Executive brief

For teams evaluating integration-consulting-services

Use this guide to frame business fit, implementation effort, delivery risk, operating impact, and expected value before choosing a path.

  • Clarifies the decision, constraints, and practical outcomes.
  • Connects the topic to relevant CISIN expertise and delivery options.
  • Helps decision makers compare technology, operational, and adoption tradeoffs.
View related serviceRequest a free consultation
Incremental Sync for Third-Party APIs: Go/No-Go Guide
Incremental Sync for Third-Party APIs: Go/No-Go Guide

A third-party API sync rarely fails loudly. It fails by being quietly, plausibly wrong: a customer record that was deleted at the source is still active in your system, a page of updates was skipped after a retry, or a cursor moved forward before the data behind it was safely stored. Dashboards stay green because requests succeed. The damage shows up weeks later, in a finance report, a support escalation, or an audit.

The direct answer: an incremental sync is not a series of API calls. It is a piece of durable state, a cursor plus a mirrored copy plus a way to prove the two still agree. It is correct only when five things hold together: a trustworthy baseline, a cursor that advances only after the data behind it is durably stored, a deliberate way to learn about deletions, a defined response when the source invalidates your cursor, and a periodic reconciliation that does not depend on the cursor being right.

This guide is written for the Head of Integration Engineering, or the VP of Engineering or platform lead who owns the outcome. It sits alongside our guides on webhooks, polling and change data capture and on bulk and batch API partial failure, but it answers a different question: once you have chosen how to detect change, how do you keep a long-lived copy of someone else's data correct? The Sync Integrity Ladder described below is a proposed design for you to adapt and test, not a certified standard.

Key Takeaways

  1. Treat sync as state, not traffic. A cursor is a promise about what you have already stored. Advance it only after the page is durably committed.
  2. Deletes are the most common silent gap. Some APIs return deletion markers, some do not. Confirm which yours does, and add reconciliation for the rest.
  3. An invalidated cursor is a normal event. Plan a controlled full resync, not an alert nobody owns.
  4. Backfill and incremental sync must be sequenced. Capture the incremental starting point before the backfill begins, then replay idempotently.
  5. Go/no-go means all controls pass. The checklist in this article is not a score. One failing control is a no-go for the stream it covers.
  6. Cursors, mirrors and identifiers are data you own. They need tenant scoping, retention limits and a named privacy owner.

Why Incremental Sync Fails Quietly

Most integration failures announce themselves with an error rate. Sync failures usually do not, because the failure is an absence: a record you never received, a change you never applied, a deletion you never learned about. There is no failed request to alert on.

The root cause is that two systems now hold the same fact, and the only thing keeping them aligned is your cursor. Every cursor type carries assumptions about the source system, and those assumptions break in predictable ways:

  1. Time-based watermarks assume records become visible in timestamp order. Commit lag and replication delay break that assumption. A record stamped earlier can appear after you have already moved past its timestamp.
  2. Offset pagination assumes the collection does not change while you read it. Inserts and deletes between pages shift the offsets, so you skip or duplicate records.
  3. Opaque sync tokens assume the server will honor them indefinitely. Servers expire and invalidate them.
  4. Webhook-triggered refetch assumes every notification arrives. Missed deliveries leave no trace.

Vendor documentation is explicit about some of this. Google's guide to synchronizing Google Calendar resources describes an initial full sync followed by incremental syncs with a stored sync token, notes that incremental results include deleted entries so clients can remove them, and states that when the server invalidates a token it responds with a 410 that should trigger a full wipe of the client's store and a new full sync. Microsoft's Microsoft Graph delta query overview describes following next links until a delta link is returned, represents removed items with an @removed annotation, and warns that a single entity can appear more than once in a response. These are two well-documented examples of a general pattern: the vendor tells you how its change tracking behaves, and your job is to design for exactly that behavior, not for a generic idea of pagination.

Cursor types compared

Cursor approachDeletes visible?Resumable after crash?Typical silent failureCompensating control you need
Server-issued sync or delta tokenOften yes, per vendor docsYes, if you persist the token safelyToken invalidated; stale mirror keptControlled full resync path
Updated-since timestamp watermarkUsually noYesLate-visible records skipped; deletes never seenOverlap window, version-guarded upserts, ID reconciliation
Offset or page-number pagingNoPoorlySkipped or duplicated records during writesPrefer cursors; if unavoidable, snapshot and reconcile
Webhook-triggered refetchDepends on event types sentDepends on your receiverMissed notification leaves no traceScheduled reconciliation sweep

The table is a starting point. Always confirm each row against the specific vendor's current documentation, because behavior varies by endpoint, not just by vendor.

How Most Teams Approach It, and Why That Breaks

The typical first implementation is sensible and quick: a scheduled job calls the list endpoint with an updated-since parameter, loops over pages, upserts records, and saves the latest timestamp it saw. It works in staging, passes a demo, and ships. Over the following months four weaknesses surface.

  1. The cursor is saved before the work is durable. The job stores the new timestamp at the end of a page loop, or worse, at the start of the run. A crash between storing the cursor and committing the data means the next run starts after records that were never saved.
  2. There is no concept of a baseline. Nobody can say what the mirror looked like when the sync began, so there is no way to tell whether it is complete today.
  3. Deletes are an afterthought. The team assumes the API would have returned them. Some APIs do, with markers. Many list endpoints simply stop returning the record.
  4. One job, many tenants. A single cursor or a single error path covers every customer, so one tenant's revoked credential or malformed record stalls or corrupts the stream for all.

None of these is an exotic bug. They are default outcomes of treating sync as a loop instead of as a protocol with state. For related background on why ordering assumptions fail, see our guide to out-of-order events in enterprise integrations. For the pressure that rate limits add to full resyncs, see API rate limiting in enterprise integrations.

A Proposed Design: The Sync Integrity Ladder

The following is a proposed design, a mental map we suggest you adapt, not an established proprietary method or a certification. Each rung depends on the one below it. If a lower rung is missing, the rungs above it give false comfort.

RungQuestion it answersMinimum evidence
1. BaselineWhat did the source look like when we started?A completed full read with a recorded start point (token, watermark, or snapshot marker)
2. CursorWhere exactly are we, and who holds the right to move it?A tenant-scoped, per-stream cursor with a lease or ownership claim
3. Atomic checkpointIs the cursor ever ahead of the data?Data upsert and cursor advance in one transaction
4. DeletesHow do we learn that something is gone?Documented deletion signal, or scheduled ID reconciliation
5. InvalidationWhat happens when the source says our cursor is no longer valid?A rehearsed shadow rebuild and swap
6. Reconciliation and ownershipHow do we prove the mirror still matches, and who answers when it does not?Scheduled comparison independent of the cursor, plus a named owner per stream

Rung 1 to 3: baseline, cursor, atomic checkpoint

Capture the incremental starting point before the baseline read begins, or use the token the API hands back at the end of the full read. Google's guide notes that a sync token appears only on the last page of a paginated full sync and that changes arriving during pagination are not missed because the needed information is encoded in the page token. Where an API offers no such token, record a high-watermark minus a safety overlap before the backfill starts, then replay that overlap with idempotent upserts once the backfill finishes.

The checkpoint rule is simple: the cursor is a statement about stored data, so it must change in the same atomic operation as the data. An acknowledgment from the source API is not an acknowledgment that your copy is durable. Only your own commit is. If your sync also publishes downstream events, write them to an outbox table in the same transaction, so deduplication, recording and scheduling of downstream work succeed or fail together.

Two workers must never advance the same stream at once. Claim the stream with a lease, and make the cursor update conditional on both the lease epoch and the expected prior cursor. Reading the cursor, comparing it in application code, and then writing it is not compare-and-swap. The condition has to be enforced by the target store in the write itself. The following is illustrative SQL in a PostgreSQL style, not an official API contract:

-- 1) Claim the stream (tenant-scoped; uses the database clock) UPDATE sync_state SET lease_owner = :worker,     lease_expires_at = now() + interval '5 minutes',     lease_epoch = lease_epoch + 1 WHERE tenant_id = :tenant AND stream = :stream   AND (lease_owner IS NULL OR lease_expires_at < now()) RETURNING lease_epoch, committed_cursor;  -- 2) Per page, ONE transaction: data, outbox, cursor BEGIN;   INSERT INTO mirror (tenant_id, stream, source_id, source_version, payload, is_deleted)   VALUES (:tenant, :stream, :id, :version, :payload, :deleted)   ON CONFLICT (tenant_id, stream, source_id) DO UPDATE     SET source_version = EXCLUDED.source_version,         payload = EXCLUDED.payload,         is_deleted = EXCLUDED.is_deleted     WHERE mirror.source_version <= EXCLUDED.source_version;    INSERT INTO outbox (tenant_id, stream, source_id, source_version)   VALUES (:tenant, :stream, :id, :version)   ON CONFLICT DO NOTHING;    UPDATE sync_state   SET committed_cursor = :next_cursor   WHERE tenant_id = :tenant AND stream = :stream     AND lease_epoch = :epoch     AND committed_cursor = :expected_cursor;   -- rowcount = 0 means the lease was lost or the cursor moved: ROLLBACK COMMIT;

Notes on the sketch: the version guard only works if the source exposes a monotonic version or reliable modified marker, so confirm that first. Where it does not, fall back to ordering by the cursor and rely on reconciliation. The conditional update is a target-side mutation inside one database. If your mirror lives in a store that cannot make that guarantee, you must disclose and test the serialization and conflict limits instead of assuming them.

Rung 4: deletes

Do not infer deletion from a missing record unless the API documents that semantics. Microsoft Graph, for example, returns a removed marker with an id and reason, and notes that resources deleted before the initial delta query are not returned. Google's sync results include deleted entries. Many other list endpoints give you nothing. For those, choose one of three honest options: use a vendor deletion feed if one exists, run scheduled ID enumeration and diff it against the mirror, or accept and document a bounded staleness window for deleted records. Choose deliberately, and write the choice down.

Rung 5: invalidation

An invalid cursor is a routine state. The documented recovery for a server-invalidated token in the Google example is a full wipe and resync. In production, wiping a live mirror is itself risky, so rebuild into a shadow copy, validate counts and spot checks, then swap. That keeps downstream consumers reading a complete copy while the rebuild runs. Rehearse it on a realistic data volume before you need it, including how long it takes and how many API calls it consumes against your quota.

Why This Fails in the Real World

These scenarios are composites of failure patterns common to integration programs, described here as illustrative examples, not as accounts of a specific client. In each, capable engineers followed reasonable practice. The gap was in the system, not the people.

Scenario 1: the deleted customers that never left

A team mirrors an external CRM's accounts using an updated-since watermark. The sync is reliable for creates and updates. Months later, a data steward notices that accounts closed at the source still appear in a regional sales report. The list endpoint never returned deletion markers, and nobody had asked. Each page-level metric was healthy: requests succeeded, record counts grew, lag was low. The missing control was not code but a question at design time: how will we learn about deletes? Once that is unanswered, even a perfect cursor cannot help.

Scenario 2: the expired token treated as an outage

A nightly job fails after a long maintenance freeze with an invalid-cursor response. The runbook says to retry. Retries fail identically. An engineer clears the cursor and restarts, which triggers a full read that exhausts the daily quota for every tenant sharing the application credentials, delaying unrelated integrations. The vendor behavior was documented. The team's process treated it as an incident to improvise through, not as an expected state with a rehearsed, quota-aware, tenant-by-tenant rebuild.

Scenario 3: the cursor that got ahead of the data

A worker stores the new cursor at the start of each run to avoid reprocessing. A deployment kills the process mid-run. The next run starts from the stored cursor, and a batch of changes is never applied. No error occurs anywhere. Without a reconciliation sweep independent of the cursor, this gap stays invisible until someone notices a number that does not match.

Why intelligent teams still fail

  1. Ownership is split. Application teams own the feature, a platform team owns the pipeline, and nobody owns the claim that the mirror is complete.
  2. Success metrics measure traffic, not correctness. Request success rate and latency cannot see a skipped page. For a related view, see our guide on measuring completed operations in integration SLOs.
  3. The vendor contract is read once. Token lifetimes, deletion semantics and consistency delays change by endpoint and over time, and Microsoft's own documentation notes replication delays for recently changed users. Without a periodic review, assumptions drift.
  4. Failure paths are never rehearsed. Teams test the happy path against a small sandbox and meet invalidation, quota pressure and large backfills for the first time in production.

The Go/No-Go Control Checklist

This checklist is a decision artifact, not a scorecard. All controls must pass for a stream to be a go. Do not add the results up or average them: a stream with nine passes and one failure on deletes is a no-go for the claim that its mirror is complete. Passing the checklist also does not certify production readiness. It tells you which known gaps are closed.

#ControlGo whenNo-go signal
1Vendor contract recordedCursor type, token lifetime, deletion semantics and consistency delay are written down per endpoint and linked to the vendor documentationBehavior assumed from similar APIs
2Baseline start pointIncremental starting point is captured before or with the full readBackfill then incremental begins from "now"
3Atomic checkpointData, outbox and cursor commit in one transaction; cursor update is conditional on lease epoch and prior cursorCursor saved at run start, run end, or via read-compare-then-write
4Tenant-scoped stateCursor, lease, idempotency keys and quarantine are keyed by tenant and streamShared cursor or shared error path across tenants
5Delete strategyDocumented deletion signal, or scheduled ID reconciliation with a stated staleness boundDeletes assumed to arrive
6Invalidation rehearsalShadow rebuild and swap rehearsed with measured duration and API-call costRecovery is "clear the cursor and rerun"
7Terminal failure statesRevoked credentials, poison records and permanent errors move the stream to a named state with a notified ownerInfinite retry or silent skip
8Uncertain input handlingTruncated pages, missing cursors, unknown fields and unparseable records are quarantined and marked, never treated as successUnknown treated as empty or as success
9Independent reconciliationScheduled comparison (counts, ID sets, sampled field checks) that does not rely on the cursorOnly the cursor proves completeness
10Privacy and ownershipMirror, quarantine, logs and reconciliation sets have a named owner, retention limits and deletion propagationRaw payloads and IDs retained indefinitely with no owner

If your stream also writes back to the source system, add the controls in the next section before declaring a go.

Write-Back, Uncertain Input, and Who Owns the Data

Many syncs are two-way. Once your system mutates the source, the stakes change: a wrong read is a stale view, while a wrong write is a changed record in someone else's system of record.

Never blindly retry an ambiguous write

A timeout on a write means you do not know whether it happened. For consequential mutations such as changing an account owner, applying a credit or closing a record, do not simply retry. First reconcile: read the authoritative state at the source and determine whether the operation took effect. Bind a durable, tenant-scoped operation identity to an immutable, approved payload hash. Reject any later request that reuses that identity with a different payload. Atomically claim the operation so that two workers cannot execute it concurrently. Keep a legitimate later operation distinct from a retry by giving it a new identity. An unknown result is exactly that: completion could not be confirmed. It is neither success nor verified failure, and your status model should have a distinct state for it. Our guide to reconciling unknown-outcome operations after an outage goes deeper on this.

Echo suppression and conflict rules

Your own writes come back through the change feed. Without a rule, you apply your own change as if it were new, or two systems overwrite each other in a loop. Decide up front which system wins per field, how you recognize your own writes (an operation identity carried in the payload, where the API supports it), and what happens when both sides changed the same field. If the source API does not support a conditional update such as an ETag or version precondition, say so explicitly and treat the conflict window as a documented limitation.

Verified acknowledgment, terminal failure, and uncertain input

  1. Verified acknowledgment: a page is acknowledged when your commit succeeds, not when the source returns it.
  2. Terminal failure: define which conditions end retries (revoked authorization, permanently rejected record, deprecated endpoint) and route them to a named state with an owner, not to a retry loop.
  3. Uncertain input: a response with a missing cursor, a duplicate-looking page, an unexpected shape or an unknown field is not an empty result. Quarantine it, mark the stream degraded, and hold the checkpoint. Treating uncertainty as "nothing changed" is how silent gaps start. See our guide on third-party API schema drift for the contract side.

Privacy ownership

A synced mirror is a copy of someone's data, often personal data, living in your estate. Identifiers can be sensitive on their own: an email address used as a record key is personal data even if no other field is stored. That applies to reconciliation ID sets, quarantine tables and logs. Assign a named owner for each, set retention limits, and make sure source-side deletions and subject-rights requests propagate to the mirror and its derived stores. Standards and regulations apply to specific data and contexts, so the legal obligations that govern your streams depend on your jurisdiction, contracts and data types, and your counsel and privacy lead should confirm them. Our guide to privacy governance for integration event logs covers replay and idempotency stores in detail.

Not sure your mirror still matches the source?

Silent drift costs more to find later than to test now. A short architecture review can show which streams are missing deletes, rebuild paths or reconciliation.

Talk to CIS engineers about an integration sync review.

Request Free Consultation

Trade-Offs, Costs and a Lower-Risk Rollout

Every control above costs something. Naming the costs makes the decision easier to defend.

ControlWhat it costsWhat it buysWhen to relax it
Atomic checkpoint with outboxExtra tables and write amplificationNo cursor-ahead-of-data gapsRarely; this is the foundation
Overlap window on watermarksRe-reading recent data; more quota useTolerance for late-visible recordsWhen the vendor provides a true change token
ID reconciliation sweepsAPI calls proportional to collection size; retained identifier setsDetection of missed deletes and driftLow-value or easily rebuilt data; use sampling
Shadow rebuildTemporary double storage; engineering effortSafe recovery without serving partial dataSmall collections where a short rebuild is acceptable
Per-tenant isolation of stateMore operational objects to monitorFailure containment and correct quotasSingle-tenant internal integrations

Illustrative scenario for sizing a sweep (not a benchmark): suppose a tenant's collection holds 2,000,000 records and the API returns 200 IDs per call. A full ID enumeration is about 10,000 calls. Whether that is cheap or expensive depends entirely on your quota and rate limits, which is why you should measure your own vendor's limits before choosing a sweep frequency. Partitioning by a stable attribute, such as a creation-date range, lets you sweep a rotating slice each day instead of everything at once.

A lower-risk rollout order

  1. Inventory streams and fill in control 1 of the checklist for each, from vendor documentation. Rank streams by consequence of being wrong, not by volume.
  2. Fix the checkpoint first. Make the cursor advance atomic and tenant-scoped before adding anything else.
  3. Add reconciliation in read-only mode. Run it and report drift for a period without auto-correcting, so you learn the real size of the problem.
  4. Rehearse invalidation on one low-risk tenant and record duration and call cost.
  5. Turn on repair only for streams whose reconciliation results you trust, with a human approval step for consequential data.
  6. Run a failure drill for the whole path. The ten integration failure drills are a useful structure.

A note on staying current

Vendors extend change-tracking features, shorten token lifetimes and adjust deletion behavior over time, so the checklist includes a recorded vendor contract and a periodic review. Treat the documented behavior of any API as a dated observation: write down when you verified it, and re-verify on a schedule and whenever the vendor announces a change. The control structure in this guide stays stable even as individual APIs evolve.

If you want a second pair of eyes, our integration consulting services and enterprise integration and API practice can walk through your streams against this checklist. Any such review should be scoped to your systems, your vendors' current documentation and your own measurements.

Conclusion: Five Decisions to Make This Quarter

An incremental sync is correct only if you can show it is, so the useful question to ask your team is not "is the job running?" but "how would we know if it were wrong?" Five concrete actions follow from this guide:

  1. Write the vendor contract down. For each stream, record cursor type, token lifetime, deletion semantics and consistency delay, with the date you verified them.
  2. Make the checkpoint atomic and tenant-scoped. Data, outbox and cursor commit together, and the cursor update is conditional in the target store, not checked in application code.
  3. Decide how deletes are learned. Choose a vendor signal, a reconciliation sweep or a documented staleness bound, and name the owner.
  4. Rehearse invalidation and unknown outcomes. Run a shadow rebuild once, and confirm that ambiguous write timeouts are reconciled against authoritative state before any retry.
  5. Assign privacy and stream ownership. Every mirror, quarantine table and identifier set gets an owner, retention limit and deletion path.

Treat the go/no-go table as all-required: a stream with an open control is a no-go for the claim that its copy is complete, until the control is closed or the risk is explicitly accepted by its owner.

About CIS: Cyber Infrastructure (CIS) is an AI-enabled software development and IT services company founded in 2003, with more than 1,000 in-house professionals serving clients across the USA, EMEA and Australia. CIS states that its delivery processes are CMMI Level 5-appraised, ISO 27001 certified and SOC 2-aligned; buyers should request current certificates and audit reports to confirm scope for their own engagement. This article was reviewed by the CIS Expert Team.

Frequently Asked Questions

What is incremental sync with a third-party API?

Incremental sync keeps a local copy of a vendor's data current by reading only what changed since the last successful read, instead of re-reading everything. It usually starts with a full baseline read, then uses a cursor such as a server-issued token or a timestamp watermark to fetch changes. The copy and the cursor together form state that must be protected and verified.

Why is my incremental sync missing deleted records?

Many list endpoints simply stop returning a deleted record, and a timestamp watermark cannot see a record that no longer exists. Some APIs provide explicit deletion signals: Google Calendar's incremental sync includes deleted entries, and Microsoft Graph delta query returns removed items with an @removed annotation. If your API provides neither, run scheduled ID reconciliation or document a bounded staleness window.

What should I do when a sync token is invalidated?

  1. Treat it as an expected state, not an incident to improvise through.
  2. Follow the vendor's documented recovery. For Google Calendar, a 410 response means wipe the store and run a full sync.
  3. In production, rebuild into a shadow copy, validate it, then swap, so consumers never read a partial mirror.
  4. Check your API quota first, and stagger rebuilds across tenants.

How do I run a backfill and incremental sync together safely?

Capture the incremental starting point before the backfill begins, or use the token the API returns at the end of the full read. Where no token exists, record a high-watermark minus a safety overlap and replay the overlap with idempotent, version-guarded upserts once the backfill completes. Run backfill into a shadow table if consumers read the live mirror.

Is a timestamp watermark good enough?

It can be, if you add controls. Timestamps assume records become visible in order, which commit lag and replication delay can break. Use an overlap window sized from your own measurements of vendor lag, version-guarded upserts, a compound cursor where the API supports it, and independent reconciliation for deletes.

Can I safely retry a timed-out write-back to the source system?

Not blindly. A timeout means the outcome is unknown. Read the authoritative state at the source first to determine whether the operation took effect. Use a durable, tenant-scoped operation identity bound to an immutable approved payload hash, reject reuse of that identity with a different payload, and atomically claim the operation so concurrent workers cannot run it twice. Record the unknown state distinctly until reconciled.

How often should I reconcile a synced mirror?

It depends on the consequence of being wrong, your vendor's quota and the size of the collection. Start in read-only mode to measure real drift, then set frequency by stream risk. Rotating partitions, such as date ranges, lets you cover the whole collection over several runs instead of one expensive sweep. Treat reconciliation identifier sets as potentially sensitive data with retention limits.

Is your synced data as complete as your dashboards suggest?

Green request metrics cannot see a skipped page, a missed delete or a cursor that moved too early. An integration sync review maps each stream against the go/no-go controls in this guide and shows what to fix first.

Ask CIS engineers to review your incremental sync design.

Request Free Consultation
Related service

This article is most relevant for technology and digital-transformation leaders who need to roll out a practical technology solution. Use the related CISIN path to compare delivery options, implementation fit, risk, and practical next steps.

Explore related serviceRequest a free consultation
Editorial review

Reviewed for technology and business decision makers

This guide is reviewed for clarity, technical and operational relevance, service alignment, and a useful next step.

Review statusreviewed by the Experts team
SEO verificationVerified by the CIS SEO Team
Reviewed2026-12-04
FocusIntegration-consulting-services

Validate legal, security, data, budget, and operational requirements with the relevant stakeholders before rollout.