Connecting Salesforce

Before You Connect

Salesforce requires a Connected App in your Salesforce org. This is a one-time setup that takes about five minutes. You'll need:

  • System Administrator access in Salesforce (to create the Connected App)
  • Admin or Owner role in TrailSpark

Unlike HubSpot, the Salesforce connection uses a per-workspace Client ID — you enter your Connected App's Consumer Key directly in TrailSpark. The connection uses secure OAuth, so no Client Secret is needed.

Create a Connected App in Salesforce

  1. In Salesforce Setup, search for App Manager and click New Connected App
  2. Fill in the basic fields:
FieldValue
Connected App NameTrailSpark Integration
API NameAuto-fills
Contact EmailYour admin email
  1. Check Enable OAuth Settings
  2. Set the Callback URL to:
https://[your-subdomain].trailspark.ai/api/oauth/callback/salesforce
  1. Add these OAuth Scopes:

    • Access and manage your data (api)
    • Perform requests on your behalf at any time (refresh_token, offline_access)
  2. Check Require Proof Key for Code Exchange (PKCE)

  3. Click Save, then click Manage Consumer Details

  4. Copy the Consumer Key — this is your Client ID

With PKCE enabled, only the Consumer Key is required. No Client Secret is needed.

Connect in TrailSpark

  1. Go to Settings > CRM Integration
  2. Click Connect Salesforce on the Salesforce card
  3. On the Salesforce Configuration page:
    • Toggle Sandbox Environment if connecting to a Salesforce sandbox (leave off for production)
    • Paste your Client ID (the Consumer Key from your Connected App)
  4. Click Connect to Salesforce
  5. Complete the Salesforce OAuth login and approve the requested permissions

Once authorized, the Connect tab shows a Salesforce Connected status. Click Test Connection to verify the integration is live.

The Sandbox Environment toggle must match your Salesforce org. Production credentials will not work against a sandbox, and vice versa.

After Connecting

TrailSpark fetches your Salesforce field schema automatically on connect. Open the Field Mapping tab to map Account and Lead fields to TrailSpark's scoring fields.

If your Salesforce schema changes (new custom fields, renamed properties), click Refresh Fields on the Connect tab to pull the updated schema.

Switching Environments

To move from sandbox to production (or vice versa):

  1. Click Disconnect on the Connect tab
  2. Navigate to Settings > CRM Integration and click Connect Salesforce (or go directly to Settings > Integrations > Salesforce) — both paths open the Salesforce Configuration page
  3. Toggle Sandbox Environment to the correct position
  4. Enter your Client ID and click Connect to Salesforce

Troubleshooting

"Invalid Client ID" error

  • Confirm the Consumer Key was copied in full — it is a long string
  • New Connected Apps may take a few minutes to propagate in Salesforce
  • Verify the callback URL in your Connected App matches exactly: https://[your-subdomain].trailspark.ai/api/oauth/callback/salesforce

Authorization fails

  • Confirm you are logging into the correct Salesforce org (production vs. sandbox)
  • Verify your Salesforce user has API access enabled
  • Check that the Connected App is active in Salesforce App Manager

Persistent token errors

OAuth tokens refresh automatically. If you see repeated token errors, the refresh token may have been revoked in Salesforce. Disconnect and reconnect to issue a new token.

Next Steps