Skip to content

CRM Integration

Connect your CRM system (Salesforce, HubSpot, or Microsoft Dynamics 365) to sync contact information and conversation data. The platform can create leads, update contacts, and add conversation notes in your CRM.

What is CRM Integration?

CRM integration allows you to:

  • Automatic Lead Creation: New clients are immediately synced as leads/contacts in your CRM
  • Contact Updates: Client information updates are synced to your CRM on a configurable schedule
  • Conversation Notes: Conversation summaries and notes are added as activities in your CRM
  • Bidirectional Sync: Keep your CRM and platform in sync automatically
  • Multi-CRM Support: Connect to multiple CRMs simultaneously (Salesforce, HubSpot, Dynamics)

This keeps your customer conversations and your CRM in sync, so interactions are tracked in one place.

Supported CRMs

Salesforce

  • Lead/Contact Management: Creates Leads, updates Contacts
  • Activities: Adds conversation notes as Tasks
  • OAuth Support: Both user OAuth and service-to-service authentication
  • Instance Support: Works with any Salesforce instance

HubSpot

  • Contact Management: Creates and updates Contacts
  • Notes: Adds conversation notes as Engagements
  • OAuth Support: Both OAuth App and Private App authentication
  • Account Integration: Links to your HubSpot account

Microsoft Dynamics 365

  • Contact Management: Creates and updates Contacts
  • Annotations: Adds conversation notes as Annotations
  • Azure AD Integration: Uses Azure AD for authentication
  • Instance Support: Works with any Dynamics instance

AutoChat CRM

  • Client Management: Creates and updates clients in crm.autoch.at
  • Conversation Notes: Adds conversation notes as client activities
  • API Key Authentication: Simple API key-based authentication
  • Webhook Support: Receives webhooks from crm.autoch.at for bidirectional sync

Benefits

  • Less manual entry: Keep contact details and notes in sync
  • Faster updates: New leads can appear in your CRM right away
  • Complete History: All conversations tracked in CRM
  • Reduced Errors: Eliminates manual data entry mistakes
  • Time Savings: Automates repetitive CRM tasks
  • Better Insights: Full customer journey visible in CRM

Setting Up CRM Integration

Step 1: Choose Your CRM

Navigate to CRM Connection in the sidebar to see available CRM options:

  • Salesforce
  • HubSpot
  • Microsoft Dynamics 365
  • AutoChat CRM

Step 2: Choose Authentication Method

Each CRM supports two authentication methods:

Option A: OAuth (User Authentication)

  • Best for: Personal accounts, single-user setups
  • Requires: User to authorize via OAuth flow
  • Token Refresh: Automatically refreshes tokens when needed
  • Setup: Click "Connect with OAuth" and follow the authorization flow

Option B: Service-to-Service (API Keys)

  • Best for: Enterprise accounts, automated systems
  • Requires: Client ID and Client Secret from your CRM
  • Self-Renewing: Tokens automatically refresh before expiration
  • Setup: Click "Connect with API Keys" and enter credentials

Step 3: Connect Salesforce

OAuth Method:

  1. Click Connect with OAuth for Salesforce
  2. You'll be redirected to Salesforce login
  3. Log in and authorize the application
  4. You'll be redirected back and the connection will be established

Service-to-Service Method:

  1. Click Connect with API Keys for Salesforce
  2. Enter your Client ID (Consumer Key from Connected App)
  3. Enter your Client Secret (Consumer Secret from Connected App)
  4. Enter your Instance URL (e.g., https://yourinstance.salesforce.com)
  5. Click Connect

Salesforce Setup (for service-to-service):

  1. Go to Setup → App Manager → New Connected App
  2. Enable OAuth Settings
  3. Set Callback URL to your platform URL
  4. Select OAuth Scopes: api, refresh_token
  5. Copy Consumer Key (Client ID) and Consumer Secret (Client Secret)

Step 4: Connect HubSpot

OAuth Method:

  1. Click Connect with OAuth for HubSpot
  2. You'll be redirected to HubSpot login
  3. Log in and authorize the application
  4. You'll be redirected back and the connection will be established

Service-to-Service Method:

  1. Click Connect with API Keys for HubSpot
  2. Go to HubSpot Settings → Integrations → Private Apps
  3. Create a new Private App with contacts scope
  4. Copy the Access Token (this is your Client ID)
  5. Enter the token in the Client ID field
  6. Leave Client Secret empty (Private Apps don't use secrets)
  7. Click Connect

Note: HubSpot Private Apps use access tokens that don't expire, so no refresh is needed.

Step 5: Connect Microsoft Dynamics 365

OAuth Method:

  1. Click Connect with OAuth for Dynamics
  2. You'll be redirected to Microsoft login
  3. Log in and authorize the application
  4. You'll be redirected back and the connection will be established

Service-to-Service Method:

  1. Click Connect with API Keys for Dynamics
  2. Register an application in Azure AD
  3. Create a client secret
  4. Enter your Client ID (Application ID)
  5. Enter your Client Secret
  6. Enter your Instance URL (e.g., https://yourinstance.crm.dynamics.com)
  7. Enter your Tenant ID (Azure AD Directory ID)
  8. Click Connect

Dynamics Setup (for service-to-service):

  1. Go to Azure Portal → App Registrations → New Registration
  2. Set API permissions: Dynamics CRM user_impersonation
  3. Create a Client Secret
  4. Copy Application ID (Client ID) and Secret
  5. Note your Directory (Tenant) ID

Step 6: Connect AutoChat CRM

AutoChat CRM uses API key authentication (no OAuth flow):

  1. Click Connect with API Key for AutoChat CRM
  2. Enter your API Key from your crm.autoch.at account
  3. Click Connect

AutoChat Setup:

  1. Log in to your crm.autoch.at account
  2. Navigate to Settings → API Keys
  3. Generate a new API key or copy an existing one
  4. Paste the API key into the connection form

Note: AutoChat CRM uses API key authentication only. API keys don't expire, so no token refresh is needed.

Sync Settings

Once connected, configure your sync settings:

Enable Sync

Toggle sync on/off for each CRM connection. When disabled, no data will be synced.

Sync Options

  • Sync Contacts: Automatically sync client information to CRM
  • Sync Notes: Add conversation notes as CRM activities

Sync Qualified Only

Enable this option to sync only clients who have at least one qualified conversation:

  • When Enabled: Only clients with qualified conversations are synced to CRM
  • When Disabled: All clients are synced regardless of qualification status
  • Use Case: Focus your CRM on high-quality leads ready for sales follow-up

How It Works:

  • The system checks if a client has any conversations marked as "qualified" (including provisionally qualified)
  • If sync_qualified_only is enabled and no qualified conversations exist, the client is skipped
  • This applies to both real-time lead creation and scheduled updates
  • Once a client has a qualified conversation, they will be synced even if later conversations are unqualified
  • Provisional Qualification: Clients are synced immediately when they meet qualification criteria during a conversation (real-time), even before the final AI review

Qualification Statuses:

  • Pending: Conversation hasn't been evaluated yet or doesn't meet criteria
  • Qualified: Lead meets qualification criteria (includes provisional qualification)
  • Unqualified: Lead doesn't meet qualification criteria

Staggered Qualification System:
The platform uses a two-stage qualification process:

  1. Real-Time Qualification: During active conversations, the system checks if leads meet rule-based criteria. If qualified:
    • Lead is immediately marked as "provisionally qualified"
    • Client is synced to CRM right away (if sync_qualified_only is enabled)
    • Notifications are sent immediately
    • AI review is scheduled for 24-48 hours later
  2. Delayed AI Review: After 24-48 hours, a full AI review is performed:
    • AI analyzes the complete conversation with more context
    • Status may be updated if AI assessment differs
    • Follow-up notifications are sent if status changes
    • CRM records are updated if needed

This ensures you get immediate action on high-confidence leads while allowing AI to refine the assessment later.

Best Practices:

  • Enable for sales-focused workflows where you only want qualified leads in CRM
  • Disable if you want all leads in CRM for marketing/nurturing purposes
  • Combine with qualification criteria settings to control what gets qualified
  • Understand that leads may be synced provisionally and then confirmed/updated after AI review

Update Interval

Set how often the system should sync updates (in minutes):

  • Minimum: 5 minutes
  • Maximum: 1440 minutes (24 hours)
  • Default: 60 minutes

Note: New leads are always synced immediately, regardless of this setting (unless sync_qualified_only is enabled and the lead has no qualified conversations).

How It Works

Real-Time Lead Creation

When a new client is created in the platform:

  1. Client Created: System detects new client record
  2. Qualification Check: If sync_qualified_only is enabled, system checks for qualified conversations (including provisional)
  3. Immediate Sync: Client is immediately synced to all connected CRMs (if qualified or sync_qualified_only is disabled)
  4. Lead/Contact Created: CRM creates Lead (Salesforce) or Contact (HubSpot/Dynamics)
  5. Linked: Platform tracks the CRM record ID for future updates

With Sync Qualified Only Enabled:

  • If client has no qualified conversations, sync is skipped
  • Client will be synced automatically once they have their first qualified conversation (including provisional qualification)
  • This ensures your CRM only contains leads ready for sales follow-up
  • Provisional Qualification: Leads are synced immediately when they meet qualification criteria during a conversation, even before final AI review

Staggered Qualification Flow:

  1. During Conversation: If lead meets rule-based criteria, they're marked as "provisionally qualified"
  2. Immediate Sync: Provisionally qualified leads are synced to CRM right away (if sync_qualified_only is enabled)
  3. AI Review (24-48 hours later): Full AI analysis is performed
  4. Status Update: If AI assessment differs, status is updated and CRM records may be updated
  5. Follow-Up Notifications: If status changes, follow-up notifications are sent

Scheduled Updates

On the configured interval, the system:

  1. Checks for Updates: Finds clients updated since last sync
  2. Qualification Filter: If sync_qualified_only is enabled, filters to only clients with qualified conversations
  3. Merges Data: Updates existing CRM records (doesn't overwrite)
  4. Adds Notes: Syncs conversation notes as CRM activities
  5. Logs Sync: Records all sync operations in sync logs

With Sync Qualified Only Enabled:

  • Only clients with qualified conversations are included in scheduled updates
  • Clients without qualified conversations are skipped (but will be synced once they qualify)
  • This keeps your CRM focused on actionable leads

Data Mapping

Client → CRM Contact/Lead:

  • First Name → FirstName
  • Last Name → LastName
  • Email → Email
  • Phone → Phone
  • Company → Company
  • Address → Address fields (Street, City, State, Zip, Country)

Conversation → CRM Note:

  • Conversation summary → Note body
  • Channel type → Note subject
  • Timestamp → Note date

Sync Logs

View all sync operations in the Sync Logs section:

  • Time: When the sync occurred
  • CRM: Which CRM was synced to
  • Type: Create lead, update contact, or add note
  • Client: Which client was synced
  • Status: Success, failed, or pending

Understanding Sync Status

  • Success: Data synced successfully to CRM
  • Failed: Sync failed (check error message)
  • Pending: Sync is queued but not yet processed

Testing Your Connection

After connecting, test your connection:

  1. Click Test Connection button
  2. System verifies authentication and API access
  3. Connection status updates based on test results

Note: Test your connection after any configuration changes.

Manual Sync

Trigger a manual sync at any time:

  1. Click Sync Now button
  2. System immediately syncs all pending updates
  3. Check sync logs for results

Use Cases:

  • After bulk client updates
  • Before important meetings
  • After fixing connection issues

Best Practices

Connection Management

  1. Test Regularly: Verify connections are working
  2. Monitor Logs: Check sync logs for errors
  3. Keep Credentials Updated: Update tokens if they expire
  4. One CRM Per Type: Only one connection per CRM type per account

Sync Configuration

  1. Start Conservative: Begin with longer intervals (60+ minutes)
  2. Monitor Performance: Watch for API rate limits
  3. Adjust as Needed: Reduce interval if you need more frequent updates
  4. Enable Selectively: Only enable sync for CRMs you actively use
  5. Use Sync Qualified Only: Enable this for sales-focused workflows to keep CRM clean
  6. Coordinate with Qualification: Ensure your qualification criteria align with CRM sync goals

Data Quality

  1. Review Auto-Created Leads: Verify extracted information
  2. Merge Duplicates: Handle duplicate contacts in CRM
  3. Keep Client Data Updated: Update client info in platform for best sync
  4. Monitor Sync Logs: Address sync failures promptly

Troubleshooting

Connection Issues

Problem: Connection test fails

Solutions:

  • Verify credentials are correct
  • Check CRM account is active
  • Ensure API access is enabled
  • Try disconnecting and reconnecting
  • For OAuth: Re-authorize the connection

Problem: OAuth redirect fails

Solutions:

  • Check redirect URL is configured correctly in CRM
  • Verify callback URL matches platform URL
  • Clear browser cache and try again
  • Check CRM app settings

Sync Issues

Problem: Leads not appearing in CRM

Solutions:

  • Check sync is enabled in settings
  • Verify connection status is "Connected"
  • Check sync logs for errors
  • Ensure client has email or phone
  • Test connection to verify access
  • If sync_qualified_only is enabled: Verify client has at least one qualified conversation (check both "qualified" and "provisionally qualified" statuses)
  • Check qualification status in the Conversations page
  • For new conversations: Leads are synced immediately when they meet qualification criteria during the conversation (provisional qualification)
  • For existing conversations: Leads may need to wait for qualification evaluation or AI review
  • Check if conversation has reached minimum message count or other qualification criteria

Problem: Updates not syncing

Solutions:

  • Check update interval setting
  • Verify sync is enabled
  • Review sync logs for errors
  • Trigger manual sync to test
  • Check last sync timestamp

Problem: Duplicate contacts in CRM

Solutions:

  • Review client matching logic
  • Merge duplicates in CRM
  • Check for email/phone variations
  • Update client records to match CRM

Authentication Issues

Problem: Token expired (OAuth)

Solutions:

  • System automatically refreshes tokens
  • If refresh fails, reconnect via OAuth
  • Check refresh token is valid
  • Re-authorize connection if needed

Problem: Service credentials invalid

Solutions:

  • Verify Client ID and Secret are correct
  • Check credentials haven't been rotated
  • Ensure app has required permissions
  • Re-enter credentials and reconnect

Security

Token Security

  • Encryption: All tokens encrypted at rest
  • Secure Transmission: HTTPS only for all API calls
  • No Exposure: Tokens never displayed in UI
  • Revocable: Can disconnect at any time

Access Control

  • Tenant Isolation: Each account's data is isolated
  • Permission-Based: Only authorized users can connect CRMs
  • Audit Trail: All sync operations are logged
  • Secure Storage: Credentials stored encrypted in database

Disconnecting CRM

To disconnect a CRM:

  1. Go to CRM Connection page
  2. Find the CRM connection
  3. Click Disconnect button
  4. Confirm disconnection

Note: Disconnecting removes the ability to sync but doesn't delete existing CRM records.

Limitations

Current Limitations

  • One-Way Sync: Currently syncs Platform → CRM (not bidirectional)
  • Manual Field Mapping: Uses standard field mappings (custom fields not yet supported)
  • Rate Limits: Subject to CRM API rate limits
  • Batch Size: Syncs up to 100 records per batch
  • Qualification Dependency: When sync_qualified_only is enabled, clients must have qualified conversations to sync
  • Provisional Qualification: Leads synced provisionally may have status updated after AI review (24-48 hours later)
  • AI Review Timing: AI review occurs 24-48 hours after provisional qualification (configurable via environment variables)

Future Enhancements

  • Bidirectional sync (CRM → Platform)
  • Custom field mapping
  • Webhook support for real-time CRM updates
  • Additional CRM platforms
  • Advanced filtering and sync rules
  • Per-CRM qualification criteria

Qualification and CRM Sync

Understanding Qualification Status

The platform uses a three-tier qualification system:

  1. Pending: Conversation hasn't been evaluated or doesn't meet criteria yet
  2. Qualified: Lead meets qualification criteria (includes both provisional and final qualification)
  3. Unqualified: Lead doesn't meet qualification criteria

Staggered Qualification Process

The platform uses a two-stage qualification approach for better accuracy:

Stage 1: Real-Time Qualification (During Conversation)

  • System checks rule-based criteria (keywords, message count, contact fields)
  • If criteria are met, lead is marked as "provisionally qualified"
  • Immediate Actions:
    • Client is synced to CRM immediately (if sync_qualified_only is enabled)
    • Notifications are sent to configured channels
    • AI review is scheduled for 24-48 hours later

Stage 2: Delayed AI Review (24-48 Hours Later)

  • Full AI analysis is performed on the complete conversation
  • AI considers context, intent, and conversation quality
  • Possible Outcomes:
    • Status confirmed: Lead remains qualified
    • Status upgraded: Lead moves from unqualified to qualified
    • Status downgraded: Lead moves from qualified to unqualified
    • Follow-up notifications sent if status changes
    • CRM records updated if needed

Benefits of Staggered Qualification

  • Immediate Action: High-confidence leads are acted on right away
  • Better Accuracy: AI review provides more nuanced assessment
  • Reduced False Positives: AI can catch leads that seemed qualified but aren't
  • Reduced False Negatives: AI can identify qualified leads that rule-based system missed
  • CRM Efficiency: Your CRM gets leads quickly while maintaining quality

Configuring Qualification Criteria

To control what gets qualified (and thus synced to CRM):

  1. Go to Qualification Settings in the sidebar
  2. Create qualification criteria with:
    • Required keywords
    • Minimum message count
    • Required contact fields (email, phone, company)
    • AI analysis settings
    • Qualification score thresholds
  3. Set priority for multiple criteria (higher priority = evaluated first)
  4. Enable/disable criteria as needed

Best Practice: Align your qualification criteria with your CRM sync goals. If you only want high-quality leads in CRM, set stricter criteria.

Next Steps

  • Configure your CRM connection
  • Test the connection
  • Review sync settings (including sync_qualified_only if needed)
  • Configure Qualification Criteria to control lead qualification
  • Set up Notification Preferences to be notified when leads are qualified
  • Monitor sync logs
  • Learn about Clients - Client management system
  • Review Conversations - Conversation tracking and qualification

autoch.at Documentation