sync_history
Creates, updates, deletes, gets or lists a sync_history resource.
Overview
| Name | sync_history |
| Type | Resource |
| Id | fivetran.connections.sync_history |
Fields
The following fields are returned by SELECT queries:
- list
| Name | Datatype | Description |
|---|---|---|
sync_id | string | The unique identifier of the sync. |
end | string | The UTC timestamp of when the sync finished, in ISO 8601 format. Null if the sync is still in progress. |
reason | string | The failure reason if the sync did not complete successfully. Omitted if the sync completed without errors. |
stages | object | The data volume processed in each stage of the sync pipeline. |
start | string | The UTC timestamp of when the sync started, in ISO 8601 format. Null if the sync has not started yet. |
status | string | The outcome of the sync. Possible values: COMPLETED, FAILURE, CANCELED, INCOMPLETE, RESCHEDULED, PAUSED. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list | select | connection_id | duration, start_time, end_time, cursor, limit | Returns 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.
| Name | Datatype | Description |
|---|---|---|
connection_id | string | The 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). |
cursor | string | Paging cursor, [read more about pagination](https://fivetran.com/docs/rest-api/pagination) |
duration | integer (int32) | Deprecated. Use start_time and end_time instead. |
end_time | string | The 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. |
limit | integer (int32) | Number of records to fetch per page. Accepts a number in the range 1..1000; the default value is 100. |
start_time | string | The 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
- list
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 }}'
;