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:
- 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": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"required": ["ad_accounts"],
"properties": {
"ad_accounts": {
"type": "array",
"title": "Ad accounts",
"anyOf": [
{
"const": "123456",
"title": "Name of account"
}
]
}
}
}
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:
- A valid connection ID
- 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": {
"account": ["123456"]
},
"sync_interval": "*/10 * * * *"
}
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/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 Stream
The final step is to start the ELT sync so that Weld begins migrating your data.
POST https://connect.weld.app/elt_syncs/:id/start
Replace the :id
with the ELT sync id
obtained from Step 3.