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
- After the webhook trigger in your Make.com scenario, add a Filter:
- Condition:
eventequalsflow_completed
- Condition:
- Click "+" and search for Salesforce.
- Select Create a Record.
- Connect your Salesforce account (Make.com handles the OAuth flow).
- 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}} |
{{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:
- Before the "Create a Record" module, add Salesforce → Search Records.
- Search for Leads where Email equals
{{data.response_variables.email}}. - 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
- Click Run once in Make.com.
- Trigger a test event in InstantDM (complete a lead capture flow or click Send Test Webhook).
- Check Salesforce - a new Lead should appear.
- 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
- Add a Filter step.
- Set:
eventexactly matchesflow_completed.
Step 3: Add Salesforce Action
- Add Salesforce → Create Record.
- Connect your Salesforce account.
- Select record type: Lead.
- Map fields:
| Salesforce Field | Zapier Mapping |
|---|---|
| Last Name | Data Response Variables Full Name |
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
- Test the Zap with sample data.
- Verify the Lead appears in Salesforce.
- 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
- In Salesforce Setup, go to App Manager → New Connected App.
- Enable OAuth Settings.
- Set the callback URL to
https://login.salesforce.com/services/oauth2/callback. - Select OAuth scopes:
api,refresh_token. - 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
- Deploy your webhook receiver to a public URL.
- In InstantDM Settings → API, paste the URL (e.g.,
https://your-server.com/instantdm-webhook). - 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
- Go to Setup → Object Manager → Lead → Fields & Relationships.
- Click New.
- Select the field type (Text, Email, Phone, etc.).
- Set the Field Label and Field Name.
- 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
- Go to Setup → Lead Assignment Rules.
- Create a rule that assigns Instagram leads to a specific user or queue.
- Set the criteria: Lead Source equals "Instagram DM".
Salesforce Flow (Recommended)
- Go to Setup → Flows → New Flow.
- Select Record-Triggered Flow.
- Set the object to Lead and trigger on Create.
- Add conditions: Lead Source equals "Instagram DM".
- Add actions: send email, create task, update fields, etc.
Example: Auto-Create a Follow-Up Task
In a Salesforce Flow:
- Trigger: Lead is created, Lead Source = "Instagram DM".
- 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
- Subject:
Testing Your Integration
- Trigger a test event - complete a lead capture flow on Instagram or click Send Test Webhook in InstantDM.
- Check Salesforce - search for the new Lead by email or name.
- Verify field mapping - ensure all fields populated correctly.
- Check automations - verify that assignment rules, flows, or tasks triggered as expected.
- 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
- Connect to Zoho CRM if you use Zoho instead of Salesforce.
- Set up Pipedrive CRM for a simpler CRM option.
- Read the Make.com guide for more automation scenarios.
- Build a Custom AI Agent to qualify leads before they reach Salesforce.
- Explore the full API docs at instantdm.com/instagram-api-docs.