πŸ”—Integration & Channels

How to Connect OpenClaw to HubSpot

Intermediate30-45 minutesUpdated 2025-03-01

HubSpot's CRM platform offers powerful APIs for sales and marketing automation, but integration requires understanding private app authentication, contact object mapping, and workflow triggers. This intermediate guide walks you through creating a HubSpot private app, configuring API scopes, installing the CRM skill, mapping contact fields, testing CRUD operations, and building sales automation workflows that leverage AI.

Why This Is Hard to Do Yourself

These are the common pitfalls that trip people up.

πŸ”

HubSpot API auth

HubSpot uses private apps (access tokens) or OAuth. Private apps are simpler but have account-wide access. OAuth is more secure but complex to set up.

πŸ—ΊοΈ

Contact data mapping

HubSpot contacts have standard properties (email, name) and custom properties. Mapping your data model to HubSpot's schema requires field-by-field configuration.

πŸ”„

Workflow triggers

HubSpot workflows trigger on property changes, form submissions, and events. Integrating OpenClaw requires webhook endpoints or API polling for trigger detection.

Step-by-Step Guide

Step 1

Create HubSpot private app

Set up a private app to generate API credentials.

# 1. Go to HubSpot β†’ Settings (gear icon) β†’ Integrations β†’ Private Apps
# 2. Click "Create a private app"
# 3. Set:
#    - App name: OpenClaw AI
#    - Description: AI-powered CRM automation
# 4. Note the app will appear in your integrations list
Step 2

Configure API scopes

Grant the app access to CRM objects.

# In the Private App settings β†’ Scopes tab:
# Enable scopes:
#   CRM:
#     - crm.objects.contacts.read
#     - crm.objects.contacts.write
#     - crm.objects.companies.read
#     - crm.objects.deals.read
#     - crm.objects.deals.write
#   Other:
#     - crm.schemas.contacts.read (for custom properties)
#     - timeline (for activity logging)
# Click "Create app"
# Copy the Access Token (shown once)

Warning: Private app tokens grant full access to the scopes selected. Store the token securely and never commit it to version control. Use environment variables in production.

Step 3

Install CRM skill

Configure OpenClaw with HubSpot API credentials.

# In config/skills/hubspot.yaml:
hubspot:
  enabled: true
  access_token: "YOUR_HUBSPOT_PRIVATE_APP_TOKEN"
  portal_id: "YOUR_HUBSPOT_PORTAL_ID"  # Found in Settings β†’ Account Defaults

# Install the HubSpot skill:
openclaw skill install hubspot

# Test connection:
openclaw skill test hubspot --action get_account_info
Step 4

Map contact fields

Configure how OpenClaw data maps to HubSpot contact properties.

# In config/skills/hubspot.yaml (continued):
field_mapping:
  contacts:
    email: email  # HubSpot standard property
    first_name: firstname
    last_name: lastname
    phone: phone
    company_name: company
    # Custom properties (create in HubSpot first):
    ai_sentiment: ai_sentiment_score  # Custom property
    last_ai_interaction: last_openclaw_chat
    lead_quality: ai_lead_quality_rating

Warning: Custom properties must be created in HubSpot (Settings β†’ Properties) before mapping. OpenClaw cannot create custom properties via the API.

Step 5

Test CRUD operations

Verify that OpenClaw can create, read, update, and delete HubSpot records.

# Create a contact:
openclaw chat "Create a HubSpot contact: email=john@example.com, name=John Doe, company=Acme Corp"

# Read contact:
openclaw chat "Show me the HubSpot contact for email john@example.com"

# Update contact:
openclaw chat "Update the HubSpot contact john@example.com with phone number +1-555-0123"

# Search contacts:
openclaw chat "Find all HubSpot contacts from company 'Acme Corp'"

# Check logs:
tail -f ~/.openclaw/logs/skills.log | grep hubspot
Step 6

Build sales automation workflows

Create AI-driven workflows for lead qualification and follow-up.

# Example: Lead scoring workflow
# config/workflows/hubspot_lead_scoring.yaml:
workflows:
  hubspot_lead_scoring:
    trigger:
      type: webhook
      path: /webhooks/hubspot/contact-created
    steps:
      - name: Get contact details
        action: hubspot.get_contact
        params:
          email: "{{ webhook.body.email }}"
      - name: Analyze lead quality
        action: ai.analyze
        input: |
          Analyze this lead and assign a score (1-10):
          Name: {{ steps.get_contact_details.output.firstname }} {{ steps.get_contact_details.output.lastname }}
          Company: {{ steps.get_contact_details.output.company }}
          Email domain: {{ steps.get_contact_details.output.email | domain }}
      - name: Update HubSpot with score
        action: hubspot.update_contact
        params:
          email: "{{ webhook.body.email }}"
          properties:
            ai_lead_quality_rating: "{{ steps.analyze_lead_quality.output.score }}"
            lead_status: "{{ steps.analyze_lead_quality.output.score >= 7 ? 'hot' : 'warm' }}"

Warning: HubSpot API rate limit is 100 requests per 10 seconds for standard accounts (higher for Enterprise). Monitor API usage to avoid 429 rate limit errors.

CRM Integration Requires Data Architecture Skills

Private app setup, API scopes, field mapping, custom properties, workflow triggers, rate limiting β€” our integration experts build HubSpot integrations that fit your sales process and scale with your team.

Get matched with a specialist who can help.

Sign Up for Expert Help β†’

Frequently Asked Questions