How to Set a Start Time for Daily Syncs Using the REST API
Question
How can I configure my connection to sync data at a specific time using the REST API?
Environment
Fivetran REST API
Answer
You can configure your connection to sync data at a specific time only when your connection's sync frequency is set to 24 hours. For connections that sync every 24 hours, the default start time is midnight in your destination's time zone.
To set a sync start time using the REST API, you must set the sync_frequency parameter to 1440 (24 hours expressed in minutes) and the daily_sync_time parameter to the time you want your sync to start.
Example
Suppose you want to set the start time for connection connection_id_1 to 03:00. If your connection's sync frequency is already set to 24 hours, send the following request:
PATCH https://api.fivetran.com/v1/connections/connection_id_1
{
"daily_sync_time": "03:00"
}
If you need to set both the sync frequency and the sync start time, send the following request:
PATCH https://api.fivetran.com/v1/connections/connection_id_1
{
"sync_frequency": 1440,
"daily_sync_time": "03:00"
}