There are a few methods involved in syncing data with Merge:
Merge recommends syncing data in the following way:
Create a set of functions in your backend that are responsible for syncing data
These functions should utilize the
modified_aftertimestamp filter that is available on all Merge list endpoints.
This critical filter enables you to only pull data that has been changed (or created) since your last sync.
For example, you can ask for
modified_after=2021-03-30T20:44:18.662942Z, and only pull items that are new / different.
To do this, you need to store the time you last began a fetch to Merge's API for the linked account and endpoint.
Sync periodically (aka polling)
Configure your backend to call your sync functions periodically, such as every 24 hours.
Sync when Merge emits a Sync Notification Webhook
Merge offers a variety of webhooks for real-time events.
To be alerted to when Merge may have data updates, configure Merge to notify you via webhook when Merge has completed syncing with a third-party platform for a linked account.
Whenever you receive a Sync Notification Webhook, initiate the logic you configured in Step 1.
We recommend using a combination of our "First Sync Notification" and "Any Sync Notification" webhooks to help you manage your sync activities at scale.
Learn how to configure Merge Webhooks in our guide.
id. For example, if you are querying for candidates and also want details about associated applications you can
expand=applications, and Merge will return the actual application objects instead of just the
application_ids. This way, you don't make multiple pulls for what is ultimately related information.
sync-statusto set up a trigger so you don't make any API calls before the sync is finished.