HubSpot Integration

Connect Ledly to HubSpot to automatically sync leads as Contacts. This guide walks you through creating a developer app and authorizing Ledly.

HubSpot uses Contacts (not Leads) with a lifecyclestage property set to lead to represent leads.

Prerequisites

  • HubSpot account with Admin access
  • Access to HubSpot Developer Portal
  • Ledly Education or Enterprise plan

Step 1: Create a HubSpot Developer App

  1. Go to the HubSpot Developer Portal
  2. Click Manage apps in the top navigation
  3. Click Create app

App Info

FieldValue
Public app nameLedly Integration
DescriptionSyncs leads between Ledly and HubSpot
LogoOptional

Auth Settings

  1. Click the Auth tab

  2. Set Redirect URL to:

    https://api.ledly.io/api/hubspot/callback
  3. Under Scopes, add the following:

    • crm.objects.contacts.read
    • crm.objects.contacts.write
    • crm.schemas.contacts.read
    • crm.schemas.contacts.write
  4. Click Save


Step 2: Get Your Credentials

  1. On your app page, click the Auth tab
  2. Copy these values:
    • Client ID
    • Client Secret
🚫

Security Note: Keep these credentials secure. Never share them via email or chat.


Step 3: Create the Ledly Custom Property

Before connecting, create a custom property in HubSpot to track Ledly lead IDs:

  1. In HubSpot, go to Settings (gear icon)
  2. Navigate to Properties under Data Management
  3. Select Contact properties
  4. Click Create property
FieldValue
Object typeContact
GroupContact information
LabelLedly ID
Internal nameledly_id
Field typeSingle-line text
  1. Click Create
⚠️

The ledly_id property is required for bidirectional sync. Ledly uses this to identify which contacts originated from or are linked to Ledly.


Step 4: Enter Credentials in Ledly

  1. Log in to Ledly at app.ledly.io
  2. Go to Settings -> CRM Integration
  3. Select HubSpot as your CRM
  4. Enter your Client ID
  5. Enter your Client Secret
  6. Click Save Credentials
  7. Click Connect with HubSpot
  8. Log in to HubSpot when prompted and approve access

Once connected, you’ll see the connection status and your HubSpot portal ID on the CRM settings page.


Step 5: Map Fields to HubSpot

After connecting, configure how Ledly fields map to your HubSpot Contact properties.

  1. Go to Settings -> CRM Integration -> Field Mapping
  2. For each Ledly field, select the corresponding HubSpot property
  3. Click Save Mapping

Standard Field Mappings

Ledly FieldHubSpot Contact PropertyNotes
emailemailRequired, unique identifier
first_namefirstname
last_namelastname
phonephone
companycompany
job_titlejobtitle
ledly_idledly_idCustom property for sync

Lifecycle Stage Mapping

Ledly automatically sets the lifecyclestage property based on lead status:

Ledly StatusHubSpot Lifecycle Stage
newlead
contactedlead
qualifiedmarketingqualifiedlead
convertedsalesqualifiedlead

Custom Field Mappings

Map Ledly custom fields to your HubSpot custom properties:

Ledly FieldHubSpot Property
program_codeprogram_interest
start_datepreferred_start_date
utm_sourcehs_analytics_source
⚠️

Field mapping must be configured before leads will sync to HubSpot. Unmapped fields will not be sent.

For detailed mapping options, see the Field Mapping Guide.


Bidirectional Sync

Ledly supports bidirectional sync with HubSpot, keeping data consistent across both platforms.

Ledly to HubSpot

When a lead is created or updated in Ledly:

  1. Ledly checks if a Contact with matching email exists in HubSpot
  2. If found, the existing Contact is updated
  3. If not found, a new Contact is created with lifecyclestage=lead
  4. The ledly_id property is set for tracking

HubSpot to Ledly

When a Contact is updated in HubSpot:

  1. HubSpot sends a webhook notification to Ledly
  2. Ledly matches the Contact by ledly_id or email
  3. Mapped fields are updated in Ledly
  4. Conflict resolution uses “last write wins” by default

Sync Frequency

DirectionTriggerLatency
Ledly -> HubSpotImmediate on save< 5 seconds
HubSpot -> LedlyWebhook< 10 seconds
Full syncScheduledEvery 4 hours

Status Tracking

Ledly tracks the sync status for each lead:

StatusDescription
syncedSuccessfully synced to HubSpot
pendingQueued for sync
failedSync failed (see error details)
not_mappedNo field mapping configured

View sync status in Ledly:

  1. Go to Leads -> Select a lead
  2. Click the CRM Sync tab
  3. View sync history and any error messages

Webhook Configuration

For real-time updates from HubSpot to Ledly, configure webhooks:

Step 1: Create a Webhook Subscription

  1. In the HubSpot Developer Portal, go to your app
  2. Click the Webhooks tab
  3. Set Target URL to:
    https://api.ledly.io/api/hubspot/webhook

Step 2: Subscribe to Events

Add subscriptions for these events:

ObjectEvent Type
contactcontact.creation
contactcontact.propertyChange
contactcontact.deletion

Step 3: Verify in Ledly

  1. Go to Settings -> CRM Integration -> Webhooks
  2. Confirm the webhook status shows Active
  3. Test by updating a contact in HubSpot

Ledly automatically verifies webhook signatures using your Client Secret to ensure requests are authentic.


Rate Limits

HubSpot enforces API rate limits that Ledly respects:

Limit TypeValue
Standard100 requests per 10 seconds
Daily250,000 requests per day
Burst150 requests per 10 seconds (temporary)
⚠️

If you have a high volume of leads, consider upgrading your HubSpot plan for higher API limits.

Token Expiration

  • Access tokens expire after 6 hours
  • Ledly automatically refreshes tokens before expiration
  • Refresh tokens do not expire unless revoked

Troubleshooting

”Invalid Client ID” Error

  • Double-check the Client ID was copied correctly from the Developer Portal
  • Ensure there are no extra spaces in the credentials
  • Verify your app is published (not in draft mode)

“Redirect URI Mismatch” Error

  • Verify the Redirect URL in your app matches exactly:
    https://api.ledly.io/api/hubspot/callback
  • Check for trailing slashes or http vs https

”Scope Not Authorized” Error

  • Ensure all required scopes are added to your app
  • Re-authorize the connection in Ledly to grant new scopes

Contacts Not Syncing

  1. Check that field mapping is configured
  2. Verify the ledly_id custom property exists in HubSpot
  3. Check the lead’s CRM Sync tab for error details
  4. Ensure HubSpot API limits haven’t been exceeded

Duplicate Contacts Created

  • Ledly uses email as the unique identifier
  • Ensure email addresses are valid and not empty
  • Check HubSpot’s duplicate management settings

Webhook Events Not Received

  1. Verify the webhook URL is correct
  2. Check that webhook subscriptions are active in HubSpot
  3. Ensure your app has the required scopes
  4. Check the Webhooks tab in Ledly for delivery logs

Security Best Practices

  1. Rotate credentials periodically - Generate a new Client Secret every 6-12 months
  2. Use least privilege - Only grant the OAuth scopes Ledly needs
  3. Monitor access - Review connected apps in HubSpot Settings -> Integrations
  4. Revoke if compromised - If credentials are exposed, immediately regenerate the Client Secret

Revoking Access

In Ledly

  1. Go to Settings -> CRM Integration
  2. Click Disconnect

In HubSpot

  1. Go to Settings -> Integrations -> Connected Apps
  2. Find Ledly Integration
  3. Click Uninstall

Or to remove the developer app completely:

  1. Go to the HubSpot Developer Portal
  2. Click Manage apps
  3. Find your app and click Delete

Support

If you encounter issues:

  • Email: [email protected]
  • Include your HubSpot portal ID (Settings -> Account Defaults)
  • Do NOT send credentials via email