Loaders API

Loaders are inbound ELT (Extract, Load, Transform) configurations that pull data from external SaaS tools and databases into your data warehouse (Source). They complement Sources by bringing data into the warehouse, while Sources provide read access from the warehouse.

Endpoints

MethodPathDescription
GET/api/v1/workspaces/{id}/loadersList all loaders
POST/api/v1/workspaces/{id}/loadersCreate a loader
GET/api/v1/workspaces/{id}/loaders/{loaderId}Get a loader
PUT/api/v1/workspaces/{id}/loaders/{loaderId}Update a loader
DELETE/api/v1/workspaces/{id}/loaders/{loaderId}Delete a loader
POST/api/v1/workspaces/{id}/loaders/{loaderId}/triggerTrigger a sync run
GET/api/v1/workspaces/{id}/loaders/{loaderId}/runsList loader runs
GET/api/v1/workspaces/{id}/loaders/{loaderId}/runs/{runId}Get a loader run
GET/api/v1/workspaces/{id}/loader-typesList available loader types

List Loaders

GET /api/v1/workspaces/{id}/loaders

Returns all loaders in the workspace.

Response

[
  {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "workspace_id": "660e8400-e29b-41d4-a716-446655440000",
    "source_id": "770e8400-e29b-41d4-a716-446655440000",
    "name": "Salesforce CRM Loader",
    "loader_type": "salesforce",
    "config": {
      "instance_url": "https://mycompany.salesforce.com"
    },
    "target_schema": "SALESFORCE_RAW",
    "selected_streams": [
      {"name": "Contact", "sync_mode": "incremental"},
      {"name": "Account", "sync_mode": "full_refresh"}
    ],
    "sync_mode": "incremental",
    "schedule": "0 */6 * * *",
    "status": "active",
    "status_error": "",
    "created_by": "880e8400-e29b-41d4-a716-446655440000",
    "created_at": "2024-01-15T09:30:00Z",
    "updated_at": "2024-01-15T09:30:00Z",
    "last_run_at": "2024-01-15T15:00:00Z",
    "last_run_id": "990e8400-e29b-41d4-a716-446655440000"
  }
]

Example

curl -X GET https://your-instance.signalsmith.io/api/v1/workspaces/{id}/loaders \
  -H "Authorization: Bearer <token>" \
  -H "X-Workspace-ID: <workspace-id>"

Create Loader

POST /api/v1/workspaces/{id}/loaders

Creates a new loader to pull data from an external source into a warehouse.

Request Body

FieldTypeRequiredDescription
namestringYesDisplay name
loader_typestringYesLoader connector type
source_idstring (UUID)YesTarget warehouse source to load data into
configobjectYesConnection configuration (varies by loader type)
target_schemastringYesSchema in the warehouse to write tables to
selected_streamsarrayYesStreams/objects to sync
sync_modestringYesfull_refresh or incremental
schedulestringNoCron expression for scheduling

Supported Loader Types

TypeDescription
salesforceSalesforce CRM objects
hubspotHubSpot CRM objects
stripeStripe payment data
shopifyShopify e-commerce data
ga4Google Analytics 4
facebook_adsFacebook Ads campaigns and performance
google_adsGoogle Ads campaigns and performance
linkedin_adsLinkedIn Ads campaigns
klaviyoKlaviyo email marketing
mailchimpMailchimp email marketing
postgresqlPostgreSQL database
mysqlMySQL database
rest_apiCustom REST API
google_sheetsGoogle Sheets
s3Amazon S3 files

Example

curl -X POST https://your-instance.signalsmith.io/api/v1/workspaces/{id}/loaders \
  -H "Authorization: Bearer <token>" \
  -H "X-Workspace-ID: <workspace-id>" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Salesforce CRM Loader",
    "loader_type": "salesforce",
    "source_id": "770e8400-e29b-41d4-a716-446655440000",
    "config": {
      "instance_url": "https://mycompany.salesforce.com"
    },
    "target_schema": "SALESFORCE_RAW",
    "selected_streams": [
      {"name": "Contact", "sync_mode": "incremental"},
      {"name": "Account", "sync_mode": "full_refresh"}
    ],
    "sync_mode": "incremental",
    "schedule": "0 */6 * * *"
  }'

Get Loader

GET /api/v1/workspaces/{id}/loaders/{loaderId}

Returns a single loader by ID.


Update Loader

PUT /api/v1/workspaces/{id}/loaders/{loaderId}

Updates an existing loader configuration.


Delete Loader

DELETE /api/v1/workspaces/{id}/loaders/{loaderId}

Deletes a loader.

Response

{
  "status": "deleted"
}

Trigger Sync Run

POST /api/v1/workspaces/{id}/loaders/{loaderId}/trigger

Manually triggers a loader sync run.

Response

Returns the created loader run object with status 201 Created.

Example

curl -X POST https://your-instance.signalsmith.io/api/v1/workspaces/{id}/loaders/{loaderId}/trigger \
  -H "Authorization: Bearer <token>" \
  -H "X-Workspace-ID: <workspace-id>"

List Loader Runs

GET /api/v1/workspaces/{id}/loaders/{loaderId}/runs

Returns the execution history for a loader.

Response

[
  {
    "id": "aae8400-e29b-41d4-a716-446655440000",
    "loader_id": "550e8400-e29b-41d4-a716-446655440000",
    "workspace_id": "660e8400-e29b-41d4-a716-446655440000",
    "status": "completed",
    "started_at": "2024-01-15T15:00:00Z",
    "completed_at": "2024-01-15T15:05:30Z",
    "rows_loaded": 15420,
    "streams_total": 2,
    "streams_failed": 0,
    "error_message": "",
    "triggered_by": "880e8400-e29b-41d4-a716-446655440000",
    "created_at": "2024-01-15T15:00:00Z"
  }
]

Loader Run Statuses

StatusDescription
pendingRun is queued
runningRun is in progress
completedRun finished successfully
failedRun failed with an error
cancelledRun was cancelled

Get Loader Run

GET /api/v1/workspaces/{id}/loaders/{loaderId}/runs/{runId}

Returns details of a specific loader run.


List Loader Types

GET /api/v1/workspaces/{id}/loader-types

Returns the list of available loader connector types with their configuration schemas and available streams.


Loader Object

FieldTypeDescription
idstring (UUID)Unique identifier
workspace_idstring (UUID)Owning workspace
source_idstring (UUID)Target warehouse source
namestringDisplay name
loader_typestringConnector type
configobjectConnection configuration
target_schemastringWarehouse schema to write to
selected_streamsarrayStreams/objects to sync
sync_modestringfull_refresh or incremental
schedulestringCron expression
statusstringdraft, active, paused, or error
status_errorstringError message when status is error
created_bystring (UUID)Account that created the loader
created_atstring (ISO 8601)Creation timestamp
updated_atstring (ISO 8601)Last update timestamp
last_run_atstring (ISO 8601) or nullLast run time
last_run_idstring (UUID) or nullID of the most recent run

Loader Run Object

FieldTypeDescription
idstring (UUID)Unique identifier
loader_idstring (UUID)Parent loader
workspace_idstring (UUID)Owning workspace
statusstringpending, running, completed, failed, or cancelled
started_atstring (ISO 8601)Run start time
completed_atstring (ISO 8601) or nullRun completion time
rows_loadedintegerTotal rows loaded
streams_totalintegerTotal streams processed
streams_failedintegerNumber of failed streams
error_messagestringError details (if failed)
triggered_bystring (UUID) or nullAccount that triggered the run
job_idstring or nullExternal job identifier
created_atstring (ISO 8601)Record creation time