API Configuration

You can manage your HubSpot connector programmatically using the Weld REST API. This page covers the key operations specific to HubSpot.

Authentication

All API requests require an API key passed via the x-api-key header. You can create API keys in Settings → API Keys inside the Weld app.

curl https://connect.weld.app/connections \
  --header 'x-api-key: YOUR_API_KEY'

Integration ID

When creating connections or syncs for HubSpot, use the following integration ID:

ParameterValue
integration_idhubspot-v2

Create a Connection

To connect HubSpot via the API, create a connection bridge session:

curl https://connect.weld.app/connection_bridges \
  --request POST \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: YOUR_API_KEY' \
  --data '{
  "integration_id": "hubspot-v2",
  "label": "hubspot-production",
  "redirect_uri": "https://yourapp.com/callback"
}'

The user will be redirected to HubSpot's OAuth flow to authorize access. Once complete, the connection is available for creating syncs.

Create an ELT Sync

Once a connection exists, create a sync to start loading HubSpot data:

curl https://connect.weld.app/elt_syncs \
  --request POST \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: YOUR_API_KEY' \
  --data '{
  "connection_id": "YOUR_CONNECTION_ID",
  "destination_schema_name": "hubspot",
  "sync_interval": "0 */6 * * *"
}'

Available Streams

After creating the sync, list the available streams to choose which HubSpot objects to sync:

curl https://connect.weld.app/elt_syncs/YOUR_SYNC_ID/available_source_streams \
  --header 'x-api-key: YOUR_API_KEY'

Then add the streams you want:

curl https://connect.weld.app/elt_syncs/YOUR_SYNC_ID/source_streams \
  --request POST \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: YOUR_API_KEY' \
  --data '{
  "source_streams": [
    { "name": "contacts" },
    { "name": "companies" },
    { "name": "deals" }
  ]
}'

Manage Syncs

OperationMethodEndpoint
List syncsGET/elt_syncs
Get sync detailsGET/elt_syncs/{id}
Update syncPOST/elt_syncs/{id}
Enable syncPOST/elt_syncs/{id}/enable
Disable syncPOST/elt_syncs/{id}/disable
Get sync statusGET/elt_syncs/{id}/status
Delete syncDELETE/elt_syncs/{id}

Manage Streams

OperationMethodEndpoint
List available streamsGET/elt_syncs/{id}/available_source_streams
Add streamsPOST/elt_syncs/{id}/source_streams
Trigger stream runPOST/elt_streams/{id}/request_run
Request full refreshPOST/elt_streams/{id}/request_full_refresh

Rate Limits

HubSpot applies global rate limits across your account. Weld will automatically throttle API calls when you reach 80% of your HubSpot rate limit to avoid maxing out limits for other integrations.

Was this page helpful?