Reverse ETL Connections API

Programmatically run syncs for a Reverse ETL connection.

The Reverse ETL Connections API lets you programmatically run syncs for your Reverse ETL connections.

You can use this API to:

  • Trigger a new sync for a particular connection.
  • Get details of all syncs for a connection.
  • Stop a running sync for a connection.

Prerequisites

  • Get the connection ID for which you want to start/stop syncs from the RudderStack dashboard.
  • Generate a personal access token in the RudderStack dashboard. Note that your personal access token should have the following permissions to use the associated API endpoints:
EndpointRequired permissions
/startRead-Write, Admin
/syncsRead-Only, Read-Write, Admin
/syncs/{syncId}Read-Only, Read-Write, Admin
/stopRead-Write, Admin

Authentication

The Reverse ETL Connections API uses Bearer authentication in the following format:

Authorization: Bearer <PERSONAL_ACCESS_TOKEN>

Base URL

Use the base URL for your API requests depending on your region:

Start sync

You can start a new sync for a Reverse ETL connection using the below endpoint:

POST
/retl-connections/{connectionId}/start
info
Your personal access token must have Read-Write or Admin permissions for authenticating the API to run this endpoint.

Path parameters

connectionId
Required
String
Connection ID for which RudderStack starts a new sync

Request body

syncType
Required
Object
Specify the scope of sync. It can be one of the following:

  • incremental: RudderStack syncs only the newly added data in the warehouse since the last sync.
  • full: RudderStack syncs all the data irrespective of whether it was synced to the destination previously.

Example request

Example response

{
   “syncId”: “<sync_id>"
}

Response codes

CodeDescription
200Sync started for Reverse ETL connection.

RudderStack also returns a unique ID for the newly created sync.
404Reverse ETL connection was not found for the specified connection ID.
409A Reverse ETL sync is already running for the specified connection ID.

Get sync details

Use the following endpoints to get details of all syncs or an individual sync for a particular Reverse ETL connection. You can also filter the results by sync status, start time, and limit the number of results per page.

All syncs

GET
/retl-connections/{connectionId}/syncs
info
Your personal access token must have Read-Only, Read-Write or Admin permissions for authenticating the API to run this endpoint.

Path parameters

connectionId
Required
String
Connection ID for which RudderStack fetches the syncs details.

Query parameters

status
Optional
String
Filter syncs by status. It accepts one of the following values - running, succeeded, and failed.
started_after
Optional
String (datetime)
Filter syncs started after the specified time (in UTC).
started_before
Optional
String (datetime)
Filter syncs started before the specified time (in UTC).
per_page
Optional
Integer
Limit the number of results shown in the page.
page
Optional
Integer
Show a particular page in the results.


Example request

Example response

{
  "syncs": [{
    "id": "<sync_id>",
    "status": "running",
    "startedAt": "2024-04-20T05:41:18.871Z",
    "finishedAt": "2024-04-20T05:41:18.871Z",
    "error": "<string>",
    "metrics": {
      "succeeded": {
        "total": 0
      },
      "failed": {
        "total": 0
      },
      "changed": {
        "total": 0
      },
      "total": 0
    }
  }],
  "paging": {
    "total": 200,
    "next": "/<collection path>?page=2"
  }
}

Response codes

CodeDescription
200List of all Reverse ETL syncs for the specified connection ID.
404Reverse ETL connection was not found for the specified connection ID.

Individual sync

GET
/retl-connections/{connectionId}/syncs/{syncId}
info
Your personal access token must have Read-Only, Read-Write or Admin permissions for authenticating the API to run this endpoint.

Path parameters

connectionId
Required
String
Connection ID for which RudderStack fetches the syncs details.
syncId
Required
String
ID for a particular Reverse ETL sync.

info
You can find the sync ID from the /start endpoint response.

Example request

Example response

{
  "id": "<sync_id>",
  "status": "running",
  "startedAt": "2024-04-20T05:58:14.778Z",
  "finishedAt": "2024-04-20T05:58:14.778Z",
  "error": "<string>",
  "metrics": {
    "succeeded": {
      "total": 0
    },
    "failed": {
      "total": 0
    },
    "changed": {
      "total": 0
    },
    "total": 0
  }
}

Response codes

CodeDescription
200Sync details for the specified connection ID and sync ID.
404Reverse ETL connection was not found for the specified connection ID.

Cancel sync

You can start a new sync for a Reverse ETL connection using the below endpoint:

POST
/retl-connections/{connectionId}/stop
info
Your personal access token must have Read-Write or Admin permissions for authenticating the API to run this endpoint.

Path parameters

connectionId
Required
String
Connection ID for which RudderStack starts a new sync

Example request

Example response

CodeResponseDescription
204Stop was requested.RudderStack has successfully sent a cancellation request to stop the Reverse ETL connection sync.
404-Reverse ETL connection was not found for the specified connection ID.

FAQ

Where can I find the connection ID for a Reverse ETL connection?

Go to the Settings tab of the connection to get the Connection ID for a particular Reverse ETL connection:

connection ID for Reverse ETL

How to generate a personal access token to use the Reverse ETL Connections API?

To generate your personal access token, go to Settings > Your Profile > Account tab. Scroll down to Personal access tokens and click Generate new token.

New personal access token in RudderStack dashboard

Enter the token name and choose Admin role from the dropdown:

New personal access token in RudderStack dashboard

Your personal access token should have the following permissions to use the associated endpoints:

EndpointRequired permissions
/startRead-Write, Admin
/syncsRead-Only, Read-Write, Admin
/syncs/{syncId}Read-Only, Read-Write, Admin
/stopRead-Write, Admin

Questions? Contact us by email or on Slack