Integration Guide

How to Connect InstantDM with Salesforce CRM (Step-by-Step Guide)

Learn how to connect InstantDM with Salesforce to automatically create leads and contacts from Instagram DMs. Step-by-step guide for syncing Instagram lead data to Salesforce using webhooks and automation platforms.

Meta Business Partner
30,000+ creators
$9.99/mo flat

Connecting InstantDM to Salesforce lets you automatically create Leads or Contacts in Salesforce whenever someone interacts with your Instagram DM automations. When a user completes a lead capture flow, answers questions, or comments a trigger keyword, the data flows straight into Salesforce - no manual entry, no copy-pasting.

This guide covers three integration methods: direct API, Make.com, and Zapier. Pick the one that fits your stack.


Why Connect InstantDM to Salesforce?

  • Auto-create Leads from Instagram DM flows with name, email, phone, and custom fields
  • Eliminate manual data entry - leads appear in Salesforce within seconds of the Instagram interaction
  • Track lead source - tag every lead with "Instagram DM" so your sales team knows where they came from
  • Trigger Salesforce automations - use Salesforce Flow or Process Builder to assign leads, send emails, or create tasks automatically
  • Full funnel visibility - see Instagram leads alongside every other channel in your Salesforce pipeline

Common Use Cases

  • Create a Salesforce Lead when someone completes a DM lead capture flow
  • Update an existing Contact when they interact with a new Instagram campaign
  • Log Instagram DM conversations as Activities on a Lead or Contact
  • Trigger a Salesforce Flow to assign the lead to a sales rep
  • Sync flow response data to custom Salesforce fields

What You'll Need

Requirement Details
InstantDM account Trendsetter, Trendsetter Pro, or any Multi plan (API access required)
Salesforce account Any edition with API access (Professional+ or Developer)
InstantDM API key Found at Settings → API in your InstantDM dashboard
Automation platform (optional) Make.com, Zapier, n8n, or Pipedream for no-code setup

Note: Salesforce Professional Edition requires an API add-on. Enterprise, Unlimited, and Developer editions include API access by default.


Method 1: Via Make.com (Recommended for Most Users)

This is the easiest approach - no Salesforce API coding required.

Step 1: Set Up the Make.com Webhook

Follow Steps 1-4 in the Make.com integration guide to create a webhook scenario that receives InstantDM events.

Step 2: Add a Salesforce Module

  1. After the webhook trigger in your Make.com scenario, add a Filter:
    • Condition: event equals flow_completed
  2. Click "+" and search for Salesforce.
  3. Select Create a Record.
  4. Connect your Salesforce account (Make.com handles the OAuth flow).
  5. Set the record type to Lead.

Step 3: Map InstantDM Fields to Salesforce

Salesforce Field Make.com Mapping
Last Name {{data.response_variables.full_name}}
Email {{data.response_variables.email}}
Phone {{data.response_variables.phone}}
Lead Source Instagram DM (static text)
Description Completed "{{data.flow_name}}" flow. Interest: {{data.response_variables.interest}}. Instagram: @{{data.username}}
Company Instagram Lead (static text, required field)

Tip: Salesforce requires the Last Name and Company fields for Leads. If your flow doesn't collect a company name, use a static placeholder like "Instagram Lead".

Step 4: Handle Duplicates (Optional)

To avoid creating duplicate leads:

  1. Before the "Create a Record" module, add Salesforce → Search Records.
  2. Search for Leads where Email equals {{data.response_variables.email}}.
  3. Add a Router with two branches:
    • Branch 1 (exists): Update the existing Lead with new data.
    • Branch 2 (new): Create a new Lead.

Step 5: Activate and Test

  1. Click Run once in Make.com.
  2. Trigger a test event in InstantDM (complete a lead capture flow or click Send Test Webhook).
  3. Check Salesforce - a new Lead should appear.
  4. Activate the scenario for production.

Method 2: Via Zapier

Step 1: Set Up the Zapier Webhook

Follow the Zapier integration guide to create a Zap with a webhook trigger receiving InstantDM events.

Step 2: Add a Filter Step

  1. Add a Filter step.
  2. Set: event exactly matches flow_completed.

Step 3: Add Salesforce Action

  1. Add Salesforce → Create Record.
  2. Connect your Salesforce account.
  3. Select record type: Lead.
  4. Map fields:
Salesforce Field Zapier Mapping
Last Name Data Response Variables Full Name
Email Data Response Variables Email
Phone Data Response Variables Phone
Lead Source Instagram DM
Description Completed flow. Instagram: @username
Company Instagram Lead

Step 4: Test and Activate

  1. Test the Zap with sample data.
  2. Verify the Lead appears in Salesforce.
  3. Turn the Zap on.

Method 3: Direct API Integration

For developers who want a direct connection without a middleware platform.

Step 1: Create a Salesforce Connected App

  1. In Salesforce Setup, go to App Manager → New Connected App.
  2. Enable OAuth Settings.
  3. Set the callback URL to https://login.salesforce.com/services/oauth2/callback.
  4. Select OAuth scopes: api, refresh_token.
  5. Save and note the Consumer Key and Consumer Secret.

Step 2: Get an Access Token

curl -X POST https://login.salesforce.com/services/oauth2/token \
  -d "grant_type=password" \
  -d "client_id=YOUR_CONSUMER_KEY" \
  -d "client_secret=YOUR_CONSUMER_SECRET" \
  -d "username=YOUR_SALESFORCE_USERNAME" \
  -d "password=YOUR_SALESFORCE_PASSWORD_AND_TOKEN"

Save the access_token and instance_url from the response.

Step 3: Build a Webhook Receiver

Create an endpoint that receives InstantDM webhooks and creates Salesforce Leads:

// Node.js / Express example
const express = require('express');
const app = express();
app.use(express.json());

const SF_INSTANCE_URL = 'https://yourinstance.salesforce.com';
const SF_ACCESS_TOKEN = process.env.SF_ACCESS_TOKEN;

app.post('/instantdm-webhook', async (req, res) => {
  const { event, data } = req.body;
  
  if (event !== 'flow_completed') {
    return res.status(200).json({ status: 'skipped' });
  }
  
  const lead = {
    LastName: data.response_variables.full_name || data.username,
    Email: data.response_variables.email,
    Phone: data.response_variables.phone,
    LeadSource: 'Instagram DM',
    Company: 'Instagram Lead',
    Description: `Completed "${data.flow_name}" flow. Interest: ${data.response_variables.interest || 'N/A'}. Instagram: @${data.username}`,
  };
  
  try {
    const response = await fetch(
      `${SF_INSTANCE_URL}/services/data/v59.0/sobjects/Lead/`,
      {
        method: 'POST',
        headers: {
          'Authorization': `Bearer ${SF_ACCESS_TOKEN}`,
          'Content-Type': 'application/json',
        },
        body: JSON.stringify(lead),
      }
    );
    
    const result = await response.json();
    
    if (result.success) {
      console.log(`Lead created: ${result.id}`);
      res.status(200).json({ status: 'created', id: result.id });
    } else {
      console.error('Salesforce error:', result);
      res.status(500).json({ status: 'error', errors: result });
    }
  } catch (error) {
    console.error('Request failed:', error);
    res.status(500).json({ status: 'error', message: error.message });
  }
});

app.listen(3000);

Step 4: Configure InstantDM Webhook

  1. Deploy your webhook receiver to a public URL.
  2. In InstantDM Settings → API, paste the URL (e.g., https://your-server.com/instantdm-webhook).
  3. Select events and save.

Mapping Custom Fields

If you have custom fields in Salesforce, map them using the API name (ending in __c):

Custom Salesforce Field API Name InstantDM Source
Instagram Username Instagram_Username__c data.username
Instagram User ID Instagram_User_ID__c data.instagram_user_id
Flow Name Flow_Name__c data.flow_name
Interest Interest__c data.response_variables.interest
Campaign Source Campaign_Source__c Static: Instagram DM

Creating Custom Fields in Salesforce

  1. Go to Setup → Object Manager → Lead → Fields & Relationships.
  2. Click New.
  3. Select the field type (Text, Email, Phone, etc.).
  4. Set the Field Label and Field Name.
  5. Set field-level security and add to page layouts.

Triggering Salesforce Automations

Once leads are created, use Salesforce's built-in automation to take further action:

Lead Assignment Rules

  1. Go to Setup → Lead Assignment Rules.
  2. Create a rule that assigns Instagram leads to a specific user or queue.
  3. Set the criteria: Lead Source equals "Instagram DM".

Salesforce Flow (Recommended)

  1. Go to Setup → Flows → New Flow.
  2. Select Record-Triggered Flow.
  3. Set the object to Lead and trigger on Create.
  4. Add conditions: Lead Source equals "Instagram DM".
  5. Add actions: send email, create task, update fields, etc.

Example: Auto-Create a Follow-Up Task

In a Salesforce Flow:

  1. Trigger: Lead is created, Lead Source = "Instagram DM".
  2. Action: Create a Task:
    • Subject: Follow up with Instagram lead: @{!$Record.Instagram_Username__c}
    • Due Date: {!$Flow.CurrentDate} + 1 (next business day)
    • Assigned To: Lead Owner
    • Priority: High

Testing Your Integration

  1. Trigger a test event - complete a lead capture flow on Instagram or click Send Test Webhook in InstantDM.
  2. Check Salesforce - search for the new Lead by email or name.
  3. Verify field mapping - ensure all fields populated correctly.
  4. Check automations - verify that assignment rules, flows, or tasks triggered as expected.
  5. Test duplicate handling - trigger the same lead again and confirm it updates rather than duplicates (if you set up dedup logic).

Troubleshooting

Issue Solution
Lead not appearing in Salesforce Check the Make.com/Zapier execution log for errors. Verify the Salesforce connection is authorized.
"Required field missing" error Salesforce Leads require Last Name and Company. Ensure these are mapped (use static values if needed).
Duplicate leads being created Add a search/lookup step before creating to check if the email already exists.
Salesforce API returning 401 Your access token may have expired. Re-authenticate the Salesforce connection in your automation platform.
Custom fields not showing Use the API name (ending in __c) when mapping custom fields. Check field-level security permissions.
Lead Source not populating Ensure "Instagram DM" is added as a picklist value in the Lead Source field in Salesforce Setup.
Make.com/Zapier can't find Salesforce fields Refresh the field list in the Salesforce module. New custom fields may take a moment to appear.

Frequently Asked Questions

Can I create Contacts instead of Leads in Salesforce?

Yes. In Make.com or Zapier, select "Contact" instead of "Lead" as the record type. The field mapping is similar - Contacts require Last Name but not Company. Use Contacts if your workflow skips the lead qualification stage.

How do I add Instagram leads to a specific Salesforce Campaign?

After creating the Lead, add a second action: Salesforce → Create a Record with record type Campaign Member. Set the Campaign ID and Lead ID. This associates the lead with your Instagram campaign for reporting.

Can I sync data back from Salesforce to InstantDM?

Yes. Use Salesforce's Outbound Messages or Platform Events to trigger a webhook when a Lead status changes. Route that webhook through Make.com/Zapier to call the InstantDM API and send a follow-up DM.

Does this work with Salesforce Lightning and Classic?

Yes. The API and automation platform integrations work with both Salesforce Lightning and Classic. The setup steps for custom fields and flows may look slightly different in Classic, but the functionality is the same.


What's Next

Ready to Automate Your Instagram DMs?

Join 30,000+ creators and brands using InstantDM today.

Start Your Free Trial

No credit card required. Setup in under 15 minutes.