Learn how to migrate from the traditional sync-based approach to listening for changes with the new data-changed webhook.
Current Approach | New Approach |
---|---|
Your backend fetches data based on our periodic sync-finished webhook (no matter if something changed) | Kombo notifies you of data changes via a webhook, and you fetch data only when needed |
This happens on a schedule (e.g. every 5 min) | We notify you as soon as changes happen (within seconds) |
Always fetching all data or deltas based on time range | Fetch only if the change affects the models you care about + all data once every 7 days |
data-changed
events from Kombo. The webhook’s payload will contain a list of changed_models, such as employees, groups, etc.
See Syncing Data for a full example and implementation tips.
Simplified approach
To make things simple, you can, whenever you receive a new data-changed webhook, pull the models you’re interested in, independent of the models we’re telling you changed.
Recommended approach
You can also listen to the data models we’re telling you that changed and pull data based on the models. For that please look into the list of models that can appear.
last_fetched_from_kombo_at
in your database and update it after each successful fetch. Use the Kombo sync start time for this value (not the end time). This ensures you don’t fetch overlapping data and that you fetch all relevant data again with the next fetch.
Behavior | Legacy Sync | New Webhook-Based |
---|---|---|
Data freshness | Scheduled intervals (e.g. max every 5-10 min, but usually every 3h) | Near real-time |
Sync triggers | Always run | Run only when data actually changed |
Volume of requests | Higher, predictable | Lower, event-driven |
Implementation | Based on sync-finished or cron | data-changed and cron (weekly) |