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

info
For production use cases, RudderStack recommends using a service access token instead of personal access token.

Authentication

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

Authorization: Bearer <SERVICE_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 service access token must have the relevant permissions to authenticate the API and run this endpoint.

Path parameters

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

Request body

syncType
Required
String
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 service access token must have the relevant permissions to authenticate the API and 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 service access token must have the relevant permissions to authenticate the API and 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 cancel a sync for a Reverse ETL connection using the below endpoint:

POST
/retl-connections/{connectionId}/stop
info
Your service access token must have the relevant permissions to authenticate the API and 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

Which permissions should I assign to the service access token for using the Reverse ETL Connections API?

For a workspace-level service access token, you should set the following permissions for the token to use the relevant Connection API endpoints:

EndpointRequired permissions
/startEditor, Admin
/syncsViewer, Editor, Admin
/syncs/{syncId}Viewer, Editor, Admin
/stopEditor, Admin


Questions? Contact us by email or on Slack