Tutorial: Managing Connection using Fivetran REST API
This guide explains how to manage a single connection through its entire lifecycle using the Fivetran REST API. It covers creation, connectivity checks, optional certificate and SSH fingerprint approval, schema management, scheduling and triggering syncs, ongoing monitoring, and eventual deletion.
How to create a connection
Use case: Create a connection to your data source: a SaaS application, database, file, or event-capturing service.
- Call the Create a Connection endpoint with
service
,group_id
, optionalpaused
, and any connection-specificconfig
. On this endpoint's documentation page, you can choose the connector type (service
in the request payload) and the language of your choice to review the request payload as well as the response. The response returns the connectionid
, an array ofsetup_tests
, and default scheduling info.
You cannot deploy a Connector SDK connection through the Fivetran REST API. You can only deploy it by using the fivetran deploy
command in your CLI (command-line interface).
How to verify connectivity and re-run tests
Use case: After rotating credentials or changing firewall rules, re-run tests to confirm the connection is still healthy.
- Inspect the initial
setup_tests
to confirm host and credential checks. - Call the Run Connection Setup Tests endpoint whenever you modify network or credentials to ensure the connection still works.
How to approve certificates or fingerprints
Use case: Necessary when connecting to databases with self-signed certificates or verifying the identity of an SSH host.
This is only required for source connections based on the following databases:
- Trust a TLS certificate by calling the Approve a Certificate for the Connection endpoint. For more details on TLS certificates, see the Certificate Verification documentation section.
- Approve SSH fingerprints by calling the Approve a Fingerprint for the Connection endpoint using the failing test’s
hash
andpublic_key
.
How to manage connection schema before syncing
Use case: Only sync required tables, avoiding PII or large audit logs, and reduce network traffic.
- Reload schema configuration by calling the Reload a Connection Schema Config endpoint.
- Set
"exclude_mode": "EXCLUDE"
so nothing syncs until explicitly enabled. - Enable or disable tables, or columns by calling the Update a Connection Schema Config endpoint for granular control.
- (For database connectors with multiple schemas) Enable or disable schemas by calling the Update a Connection Database Schema Config endpoint.
How to enable and schedule syncs
Use case: Adjust sync frequency to balance freshness with API costs, or run a historical reload when initial data was incomplete.
- Unpause and configure sync schedule by calling the Update a Connection endpoint:
paused
— start or stop the connectionsync_frequency
- Set the sync frequency interval in minutes. For example,1440
runs a sync every 24 hours.daily_sync_time
- Set the daily sync start time. For example,14:00
. Applicable only whensync_frequency
is1440
.schedule_type
- Set the sync scheduling type. Specifyingauto
means syncs run at the definedfrequency_sync
, andmanual
means you trigger your syncs on demand.is_historical_sync
- Set totrue
to make the next sync a historical re-sync. The value resets tofalse
after the run, and next syncs are incremental.name
- Rename the connection.group_id
- Move data to a different destination group.config
- Update credentials or connector-specific settings.
- Trigger syncs on demand:
- Run an incremental sync by calling the Sync Connection Data endpoint.
- Run a historical re-sync by calling the Re-sync Connection Data (Historical Sync) endpoint.
See the How to Trigger Syncs Manually tutorial to learn more about manual sync triggering.
How to maintain connection
Use case: Maintain connections by updating its parameters and re-running setup tests.
- Update credentials, schedule, or other parameters through repeated calls to the Update a Connection endpoint.
- Re-run setup tests by calling the Run Connection Setup Tests endpoint) after infrastructure changes.
How to remove connection
Use case: Remove connection for deprecated data sources.
Remove the connection permanently by calling the Delete a Connection endpoint when it’s no longer required.