Replit Agent
Collaboration
Deployments
App Builder
Website Builder
Game Builder
Dashboard Builder
Chatbot Builder
Product Managers
Designers
Operations
Software Engineers
IT
SMB Owners
DevRel
Founders
TeamsPricingBlogCareers
Contact salesLog inSign up
  • Teams
  • Pricing
  • Blog
  • Careers
Contact salesLog in
Start building
GuidesHow to Build an AI Sales Development Representative (SDR) in Slack - Part 5: HubSpot CRM Integration

How to Build an AI Sales Development Representative (SDR) in Slack - Part 5: HubSpot CRM Integration

A guide by
Image of Horacio LopezHoracio Lopez
Cover image with title "Build an AI SDR - Part 5"
Get a demo
Try for free
Table of ContentsIntroductionGetting StartedBreaking Down the Enhanced AI Sales Assistant CodeDeploying Your AI SDRWhat's Next for Your AI Sales Assistant
Recent Posts
Slackbot Quickstart Guide
Create a virtual whiteboard with Roboflow vision models
How to Build Your Own Simple Poll Slack App
AI Support Specialist With Groq - Part I

Introduction #

In this fifth part of our AI SDR series, we'll enhance our AI sales assistant with HubSpot integration and multi-platform campaign execution capabilities. By the end of this guide, your AI SDR will be able to handle the entire process from lead generation to campaign creation across both Smartlead and log these leads in HubSpot.

This guide is Part 5 of a six-part series for how to build your own AI SDR (Sales Development Representative) in Slack. This template includes the code from Parts 1-4 and the subsequent guides are linked at the bottom of this post.

Getting Started #

To begin enhancing your AI sales assistant with HubSpot integration and multi-platform campaign execution capabilities, fork this template by clicking "Use Template" below:

Use the template

HubSpot Private App Key

Log in to your HubSpot account and go to Settings > Integrations > Private Apps.

HubSpot Private apps creation UI - 2024-06-28

Click Create a private app and give it a name.

HubSpot Private app naming UI - 2024-06-24

Set the required scopes (you'll need access to deals, contacts, companies, and owners). For this app you will need to give the following scopes:

crm.schemas.contacts.write

crm.schemas.contacts.read

crm.schemas.custom.read

crm.schemas.custom.write

crm.schemas.companies.read

crm.schemas.companies.write

crm.objects.goals.read

Click Create app and you'll receive a private app access token.

In Replit, add this token to the Secrets tab as HUBSPOT_API_KEY.

Replit Secrets UI adding a HUBSPOT_ACCESS_TOKEN

Breaking Down the Enhanced AI Sales Assistant Code #

Let's explore the key components that make our AI SDR a more powerful tool for lead generation, qualification, email sequence generation, and multi-platform campaign execution:

HubSpot Integration

We've added a new function in utils.py to handle the upload of leads to HubSpot:

This function handles the process of uploading leads to HubSpot, ensuring that we respect API rate limits and handle potential errors.

Multi-Platform Campaign Execution

We've updated the post_final_email_sequence function in main.py to handle campaign execution across both Smartlead and HubSpot:

This function now handles the uploading leads to both Smartlead and HubSpot, and provides a summary of the actions taken across both platforms.

Deploying Your AI SDR #

In order to keep your AI SDR running 24/7 and receive requests whenever someone mentions it in Slack, you'll need to deploy it on a hosted server.

Open a new tab in the Workspace and search for “Deployments” or open the control console by typing ⌘ + K (or Ctrl + K) and type "deploy". You should find a screen like this.

Replit Deployments selection UI

For bots like this that need always need to be up listening to requests, we recommend using a Reserved VM. On the next screen, click Approve and configure build settings most internal bots work fine with the default machine settings but if you need more power later, you can always come back and change these settings later. You can monitor your usage and billing at any time at: replit.com/usage.

On the next screen, you’ll be able to set your primary domain and edit the Secrets that will be in your production deployment. Usually, we keep these settings as they are.

Finally, click Deploy and watch your bot go live!

What's Next for Your AI Sales Assistant #

With these enhancements, your AI SDR is now a comprehensive tool for lead generation, email address enrichment, email sequence generation, and CRM syncs. In the next part of this series, we'll be adding the ability for the assistant to add your leads and into your HubSpot CRM. The other parts of the series include:

  • AI SDR - Part 1 - Lead List Creation
  • AI SDR - Part 2 - Lead Enrichment
  • AI SDR - Part 3 - Draft Email Copy
  • AI SDR - Part 4 - Create Smartlead campaign
  • AI SDR - Part 5 (this guide) - Add Leads to HubSpot
  • AI SDR - Part 6 (Final) - Agent Mode

It is important to note that HubSpot's Acceptable Use Policy (Section 2c) prohibits the emailing of purchased emails like those pulled from Apollo in Part 1 of this six-part tutorial. Therefore, we recommend only emailing these leads from tools like Smartlead.

If you'd like to discuss how to enable your team to build and implement tools like these, feel free to schedule some time with the Replit team for a quick demo of our product.

Happy coding and selling!

Replit

  • Mobile App
  • Desktop App
  • Blog
  • Careers
  • About
  • Pricing
  • Guides

Features

  • Replit Agent
  • Collaboration
  • Deployments
  • Teams

Legal

  • Terms of service
  • Teams agreement
  • Privacy
  • Subprocessors
  • DPA
  • Report abuse

Connect

  • X / Twitter
  • Tiktok
  • Facebook
  • Instagram
  • Linkedin

Languages

  • Python
  • Javascript
  • TypeScript
  • Node.js
  • Nix
  • HTML, CSS, JS
  • C++
  • Golang

Handy Links

  • Vibe Coding 101
  • Languages
  • Docs
  • Help
  • Status
  • Import from GitHub
  • Copilot alternative
  • Brand kit
  • Partnerships
All rights reserved. Copyright © 2025 Replit, Inc.