Weld Connect API Guide

This documentation will walk you through the process of creating an ELT sync so that you can have data syncing to your chosen data warehouse or database.

Step 1: Create a Connection

To allow users to create an ELT sync and start syncing their data, the first step is to create a Connection.

Action:
Navigate to the Creating a Connection guide to learn how to create a connection.


Step 2: Get ELT Settings

Some syncs require special configuration to work properly. For example, when connecting with Facebook Ads, you need to specify which ad accounts should be synced.

How to Get ELT Settings:

  1. Make a GET request to:
GET https://connect.weld.app/connections/:id/settings

Replace the :id with the Connection id obtained from Step 1.

Understanding the Response

The API returns a response in JSON Schema format:

JSON Schema is a standard way to describe what a piece of JSON data should look like. It helps both humans and programs understand and validate the structure of the data.

Here's what it can define:

  • Which fields are required
    (e.g., name must be included)
  • What type of data each field should have
    (e.g., age should be a number, email should be a string)
  • Rules for the values
    (e.g., a number must be between 1 and 100, a string must match an email pattern)
  • Dropdown options
    (e.g., status can only be one of: "active", "inactive", or "pending")

In short, JSON Schema acts like a blueprint for the expected data format—helping you ensure that the data sent to or received from an API is valid and consistent.

Example JSON Schema

{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "type": "object",
  "required": ["ad_accounts"],
  "properties": {
    "ad_accounts": {
      "type": "array",
      "title": "Ad accounts",
      "items": {
        "oneOf": [
          {
            "const": "123456",
            "title": "Name of account"
          },
          {
            "const": "789012",
            "title": "Another account"
          }
        ]
      },
      "minItems": 1,
      "uniqueItems": true
    }
  }
}

This schema example shows:

  • Required ad_accounts array field
  • Each account must have a specific id as shown under the anyOf options

Step 3: Create the ELT Sync

Once you have:

  1. A valid connection ID
  2. The required ELT settings determined

You can create the sync. The following example will create an ELT sync with a specific sync interval and destination schema name:

POST https://connect.weld.app/elt_syncs

Example Payload

{
  "connection_id": "qviPHo5AukUjFf",
  "destination_schema_name": "my_schema_name",
  "elt_settings": {
    "ad_accounts": ["123456"]
  },
  "sync_interval": "*/10 * * * *"
}

Identifier casing (Snowflake)

For a Snowflake data warehouse you can also send identifier_casing to control the casing of the schema, table and column names the sync creates. See identifier casing for what it does and why it is fixed once the sync exists.

ValueResult
"UPPERCASE"Names are created in upper case, so they can be queried without double quotes.
nullNo casing is applied to this sync, even if the data warehouse defaults to one.
omittedThe data warehouse's default_identifier_casing is used.
{
  "connection_id": "qviPHo5AukUjFf",
  "destination_schema_name": "my_schema_name",
  "identifier_casing": "UPPERCASE",
  "sync_interval": "*/10 * * * *"
}

Read the current default, and whether your data warehouse supports the setting at all, from GET /data_warehouse:

{
  "default_identifier_casing": "UPPERCASE",
  "supports_identifier_casing": true
}

PATCH /data_warehouse changes the default for syncs created afterwards. Sending identifier_casing for a data warehouse whose supports_identifier_casing is false is rejected.


Step 4: Get Available Streams

After creating the sync, you need to discover what data streams are available for your connector. After getting the available streams, you can add them to the ELT sync.

How to Get Available Streams:

Call the following endpoint:

GET https://connect.weld.app/elt_syncs/:id/available_source_streams

Replace the :id with the Connection id obtained from Step 1.

The response will include information about all available data streams for this connection.


Step 5: Adding Streams to the ELT Sync

By adding streams, you define the tables that will be synced.

POST https://connect.weld.app/elt_syncs/:id/source_streams

Replace the :id with the ELT sync id obtained from Step 3.

Example Payload

{
  "source_streams": [
    {
      "name": "label",
      "full_sync_at_midnight": true
    }
  ]
}

Step 6: Starting the Sync schedule

The final step is to enable the ELT sync to start the sync schedule.

POST https://connect.weld.app/elt_syncs/:id/enable

Replace the :id with the ELT sync id obtained from Step 3.

Was this page helpful?