How to Set a Connection's Sync Frequency Using the REST API
Question
How can I set or change a connection's sync frequency using the Fivetran REST API?
Environment
REST API
Answer
By default, Fivetran syncs your data from your source to your destination every six hours. To change your connection's sync frequency using the Fivetran REST API, specify your chosen time interval between syncs in minutes as a value of the sync_frequency parameter in the Update a Connection endpoint request.
We support the following sync intervals (in minutes):
- 1
- 5
- 15
- 30
- 60 (1 hour)
- 120 (2 hours)
- 180 (3 hours)
- 360 (6 hours) - default value
- 480 (8 hours)
- 720 (12 hours)
- 1440 (24 hours)
You can't schedule syncs to run less frequently than once every 24 hours.
Example
To set a custom frequency for connection connection_id_1 to sync every hour (60 minutes), send the following request:
PATCH https://api.fivetran.com/v1/connections/connection_id_1
{
"sync_frequency": 60
}
Trigger syncs manually using the REST API
To avoid scheduled syncs, you can use the REST API to configure your connection so that syncs only run when you trigger them manually. To learn how, see How to Trigger Syncs Manually.
You can configure your connection to run syncs manually only by using the REST API. You cannot configure manual syncs in Fivetran.
Set a sync start time
You can configure your connection to sync data at a specific time only when your connection's sync frequency is set to 24 hours. The default sync start time for connections set to sync every 24 hours is midnight. You can set a custom sync time in Fivetran or by using the Fivetran REST API. For more information, see the following resources: