How to Set up Connections Programmatically
Use Case
You want to programmatically create connections at scale without using the Fivetran dashboard.
The following are the most common use cases:
- Powered by Fivetran
- Enterprise: Different Business Units
Recommendations
Our REST API is a crucial aspect of limiting manual work for setting up dozens or hundreds of connections.
Before you begin, make sure you have a group and destination set up and a Scoped API key. See REST API Quickstart Guide for the full prerequisite sequence and how to find your group_id and connector service identifier.
Once your group and destination are ready, you can begin creating connections using Connection Management.
Process
Find the connector type you want to sync. Use
GET /v1/metadata/connectorsto look up the internalserviceidentifier for your connector, then review its config fields in the Connection Config reference.In the request body of the Create a Connection endpoint, replace the
configfield with the specific connection’s config from Step 1.Change the payload parameters in the request body to the
serviceandgroup_id.Send a
POSTrequest to the Create a Connection endpoint.Validate that the new connection has been created successfully. Check that you've received the correct HTTP 201 response from Fivetran’s REST API.
(Optional) Send a
PATCHrequest to the Update a Connection endpoint to make additional changes to any of the following:- Sync frequency
- Daily sync time
- Schedule type (auto or manual)
- Authentication
- Config parameters
Repeat Steps 1 through 5 to set up additional sources.
Considerations
Our REST API is available only for Free, Standard, Enterprise, and Business Critical accounts.
Powered by Fivetran customers can leverage this process programmatically to implement a smooth customer onboarding process for all of your SaaS applications or databases. See our Powered by Fivetran Quickstart Guide and Powered by Fivetran Detailed Guide for details.