Skip to main content

sync_history

Creates, updates, deletes, gets or lists a sync_history resource.

Overview​

Namesync_history
TypeResource
Idfivetran.connections.sync_history

Fields​

The following fields are returned by SELECT queries:

NameDatatypeDescription
sync_idstringThe unique identifier of the sync.
endstringThe UTC timestamp of when the sync finished, in ISO 8601 format. Null if the sync is still in progress.
reasonstringThe failure reason if the sync did not complete successfully. Omitted if the sync completed without errors.
stagesobjectThe data volume processed in each stage of the sync pipeline.
startstringThe UTC timestamp of when the sync started, in ISO 8601 format. Null if the sync has not started yet.
statusstringThe outcome of the sync. Possible values: COMPLETED, FAILURE, CANCELED, INCOMPLETE, RESCHEDULED, PAUSED.

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
listselectconnection_idduration, start_time, end_time, cursor, limitReturns a list of sync history records for the specified connection. The maximum time window is 7 days.

Parameters​

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
connection_idstringThe unique identifier of the connection. Retrieve it from the id field in the [List All Connections](https:​//fivetran.com/docs/rest-api/api-reference/connections/list-connections) response, or from the id field returned when you [Create a Connection](https:​//fivetran.com/docs/rest-api/api-reference/connections/create-connection).
cursorstringPaging cursor, [read more about pagination](https:​//fivetran.com/docs/rest-api/pagination)
durationinteger (int32)Deprecated. Use start_time and end_time instead.
end_timestringThe end of the time range for which to retrieve sync history, in ISO 8601 format (for example, 2026-01-01T01:00:00Z). If omitted, defaults to one hour after start_time. Must be after start_time.
limitinteger (int32)Number of records to fetch per page. Accepts a number in the range 1..1000; the default value is 100.
start_timestringThe start of the time range for which to retrieve sync history, in ISO 8601 format (for example, 2026-01-01T00:00:00Z). If omitted, defaults to one hour before end_time. The maximum allowed range between start_time and end_time is 7 days.

SELECT examples​

Returns a list of sync history records for the specified connection. The maximum time window is 7 days.

SELECT
sync_id,
"end",
reason,
stages,
"start",
status
FROM fivetran.connections.sync_history
WHERE connection_id = '{{ connection_id }}' -- required
AND duration = '{{ duration }}'
AND start_time = '{{ start_time }}'
AND end_time = '{{ end_time }}'
AND "limit" = '{{ limit }}'
;