Salesforce Integration
Connect Ledly to your Salesforce org to automatically sync leads. This guide walks you through creating a Connected App and authorizing Ledly.
Prerequisites
- Salesforce Administrator access
- Access to Salesforce Setup
Step 1: Create a Connected App
- Log in to your Salesforce org
- Click the gear icon → Setup
- In the Quick Find box, search for App Manager
- Click New Connected App (top right)
Basic Information
| Field | Value |
|---|---|
| Connected App Name | Ledly Integration |
| API Name | Ledly_Integration (auto-fills) |
| Contact Email | Your admin email |
API (Enable OAuth Settings)
-
Check Enable OAuth Settings
-
Set Callback URL to:
https://api.ledly.io/api/salesforce/callback -
Selected OAuth Scopes - Add these:
Access and manage your data (api)Perform requests on your behalf at any time (refresh_token, offline_access)Access your basic information (id, profile, email, address, phone)
-
Leave other settings as default
-
Click Save
After saving, changes can take up to 10 minutes to take effect in Salesforce.
Step 2: Get Your Credentials
- After saving, click Continue
- On the Connected App detail page, click Manage Consumer Details
- You may need to verify your identity (email code or authenticator)
- Copy these values:
- Consumer Key (this is your Client ID)
- Consumer Secret (this is your Client Secret)
Security Note: Keep these credentials secure. Never share them via email or chat.
Step 3: Configure Connected App Policies
- Go back to App Manager
- Find your
Ledly Integrationapp - Click the dropdown arrow → Manage
- Click Edit Policies
Recommended OAuth Policies
| Setting | Recommended Value |
|---|---|
| Permitted Users | All users may self-authorize |
| IP Relaxation | Relax IP restrictions |
| Refresh Token Policy | Refresh token is valid until revoked |
- Click Save
Step 4: Enter Credentials in Ledly
- Log in to Ledly at app.ledly.io
- Go to Settings → CRM Integration
- Select your environment (Production or Sandbox)
- Enter your Client ID (Consumer Key)
- Enter your Client Secret (Consumer Secret)
- Click Save Credentials
- Click Connect with Salesforce
- Log in to Salesforce when prompted and approve access
Once connected, you’ll see the connection status on the CRM settings page.
Step 5: Map Fields to Salesforce
After connecting, configure how Ledly fields map to your Salesforce fields.
- Go to Settings → CRM Integration → Field Mapping
- For each Ledly field, select the corresponding Salesforce field
- Click Save Mapping
Standard Field Mappings
| Ledly Field | Salesforce Lead Field |
|---|---|
email | Email |
first_name | FirstName |
last_name | LastName |
phone | Phone |
Custom Field Mappings
Map Ledly fields (including custom fields) to your Salesforce custom fields:
| Ledly Field | Salesforce Field |
|---|---|
program_code | Program_Interest__c |
start_date | Preferred_Start_Date__c |
| Custom fields | Your custom __c fields |
Field mapping must be configured before leads will sync to Salesforce. Unmapped fields will not be sent.
Field Transformations
Use transformations to combine multiple Ledly fields into a single Salesforce field. This is especially useful for click IDs, since a lead will only have one (gclid OR fbclid OR msclkid, not all).
Combining Click IDs
Since Salesforce may only have one Click_ID__c field, use a transformation to merge all click ID fields:
| Transformation | Description | Example Output |
|---|---|---|
click_ids_to_one | First non-empty click ID with prefix | gclid:abc123 |
click_ids_value_only | First non-empty click ID (value only) | abc123 |
Configuration:
{
"internal_field": null,
"external_field": "Click_ID__c",
"transformation_rule": "click_ids_to_one"
}This will check gclid, fbclid, msclkid, ttclid, li_fat_id, and click_id in order, and use the first non-empty value.
Other Available Transformations
| Transformation | Source Fields | Example Output |
|---|---|---|
full_name | first_name + last_name | John Doe |
full_address | street, city, state, zip | 123 Main St, Austin, TX 78701 |
utm_summary | All UTM fields | google / cpc / spring-2025 |
To see all available transformations via API: GET /api/field-mapping-templates/transformations
For detailed mapping options, see the Field Mapping Guide.
Troubleshooting
”Invalid Client ID” Error
- Double-check the Consumer Key was copied correctly
- Wait 10 minutes after creating the Connected App (Salesforce propagation delay)
- Ensure there are no extra spaces in the credentials
”Redirect URI Mismatch” Error
- Verify the Callback URL in your Connected App matches exactly:
https://api.ledly.io/api/salesforce/callback - Check for trailing slashes or http vs https
”User Not Authorized” Error
- If using “Admin approved users”, ensure your profile/permission set is assigned
- Try switching to “All users may self-authorize” temporarily for testing
Token Refresh Failures
- Ensure “Refresh token is valid until revoked” is set in policies
- Check that the
refresh_tokenOAuth scope is included
Security Best Practices
- Rotate credentials periodically - Generate new Consumer Secret every 6-12 months
- Use least privilege - Only grant the OAuth scopes Ledly needs
- Monitor access - Review Connected App usage in Salesforce Setup → Security → Connected Apps OAuth Usage
- Revoke if compromised - If credentials are exposed, immediately revoke in Salesforce and generate new ones
Revoking Access
In Ledly
- Go to Settings → CRM Integration
- Click Disconnect
In Salesforce
- Setup → App Manager → Find
Ledly Integration - Click dropdown → Manage
- Click Edit Policies
- Under OAuth Policies, click Revoke All Tokens
Or to remove completely:
- Setup → App Manager → Find
Ledly Integration - Click dropdown → Delete
Support
If you encounter issues:
- Email: [email protected]
- Include your Salesforce org ID (Setup → Company Information)
- Do NOT send credentials via email