Pausing and Resuming Connections Using the REST API
Use this tutorial to pause a connection, keep it paused for a defined window, and then resume it with a credential health check.
Pausing a connection stops all scheduled syncs without deleting the connection or its schema. This is useful for:
- Business-hours syncing: Pause a connection outside working hours to reduce load on the source system.
- Cost control: Avoid syncing during peak billing windows for metered sources.
- Upstream maintenance windows: Prevent failed syncs while the source database, API, or warehouse is under maintenance.
Prerequisites
- A scoped API key and secret
- The ID of the connection you want to pause
jqinstalled
Endpoints used in this workflow
This workflow uses PATCH /v1/connections/{connectionId} (Update a Connection) and POST /v1/connections/{connectionId}/test (Run Connection Setup Tests).
How to Pause and Resume Connections Using the REST API
Run the following commands in the given order:
Set your environment variables
Set your environment variables
export FIVETRAN_API_KEY="<your_api_key>"
export FIVETRAN_API_SECRET="<your_api_secret>"
export FIVETRAN_BASE_URL="https://api.fivetran.com/v1"
export FIVETRAN_AUTH_HEADER=$(printf "%s" "$FIVETRAN_API_KEY:$FIVETRAN_API_SECRET" | base64 | tr -d '\n')
# The ID of the connection you want to pause and resume.
export CONNECTION_ID="<your_connection_id>"
Pause connection
Use the Update a Connection endpoint to pause a connection.
Setting paused to true stops all scheduled syncs for the connection immediately. Any sync currently in progress finishes before the pause takes effect.
PAUSE_RESPONSE=$(curl --silent --show-error \
--request PATCH \
--url "$FIVETRAN_BASE_URL/connections/$CONNECTION_ID" \
--header "Accept: application/json" \
--header "Authorization: Basic $FIVETRAN_AUTH_HEADER" \
--header "Content-Type: application/json" \
--data '{"paused": true}')
echo "$PAUSE_RESPONSE" | jq
A successful response returns the updated connection object. Confirm the connection is paused by checking the paused field in the response:
echo "$PAUSE_RESPONSE" | jq '.data.paused'
# Expected output: true
Run setup tests
Before resuming, use the Run Connection Setup Tests endpoint to verify that the source is still reachable. This is especially important after a maintenance window, where credentials or network routes may have changed.
TEST_RESPONSE=$(curl --silent --show-error \
--request POST \
--url "$FIVETRAN_BASE_URL/connections/$CONNECTION_ID/test" \
--header "Accept: application/json" \
--header "Authorization: Basic $FIVETRAN_AUTH_HEADER" \
--header "Content-Type: application/json")
echo "$TEST_RESPONSE" | jq '.data.setup_tests'
Each entry in the setup_tests array has a status field. A value of PASSED means the test succeeded.
If any test returns FAILED, do not resume the connection. Review the message field for details and resolve the source connectivity issue before proceeding to the next step.
Resume connection
Once setup tests pass, use the Update a Connection endpoint to resume the connection.
RESUME_RESPONSE=$(curl --silent --show-error \
--request PATCH \
--url "$FIVETRAN_BASE_URL/connections/$CONNECTION_ID" \
--header "Accept: application/json" \
--header "Authorization: Basic $FIVETRAN_AUTH_HEADER" \
--header "Content-Type: application/json" \
--data '{"paused": false}')
echo "$RESUME_RESPONSE" | jq
Confirm the connection is no longer paused by checking the paused field in the response:
echo "$RESUME_RESPONSE" | jq '.data.paused'
# Expected output: false
Notes
- Pausing a connection doesn't delete its schema, sync history, or configuration. All data synced before the pause remains in the destination.
- A paused connection doesn't count toward any sync-frequency billing unless a sync is actively running at the moment it is paused.
- If you need to pause and resume connections on a schedule automatically, combine this workflow with a cron job or an orchestration tool that calls these endpoints at the appropriate times.
- To check the current pause state of a connection without modifying it, use the Retrieve Connection Details endpoint and inspect the
pausedfield in the response.