ElasticFlow
HubToutes les compétencesPar départementPar rôlePar outilPar métriqueMCPsÉditeurs
Site principalConnexionS'inscrire
ElasticFlow

Transformez votre entreprise grâce à l'automatisation des workflows alimentée par l'IA. Une plateforme unifiée pour tous vos besoins enterprise.

Suivez-nous

Plateforme

  • Fonctionnalités
  • Avantages
  • Cas d'usage
  • Bibliothèque de workflows

Cas d'usage

  • Ventes
  • Marketing
  • Finance & Juridique
  • RH

Catalogue

  • Départements
  • Rôles
  • Outils
  • Métriques
  • Plateformes

Croissance

  • Programme de parrainage
  • Partenaires

Mentions légales

  • Politique de confidentialité
  • Conditions de service
  • Politique de cookies
  • Utilisation acceptable
  • Sécurité
  • SLA

© 2026 ElasticFlow. Tous droits réservés.

ElasticFlow
HubToutes les compétencesPar départementPar rôlePar outilPar métriqueMCPsÉditeurs
Site principalConnexionS'inscrire
ElasticFlow

Transformez votre entreprise grâce à l'automatisation des workflows alimentée par l'IA. Une plateforme unifiée pour tous vos besoins enterprise.

Suivez-nous

Plateforme

  • Fonctionnalités
  • Avantages
  • Cas d'usage
  • Bibliothèque de workflows

Cas d'usage

  • Ventes
  • Marketing
  • Finance & Juridique
  • RH

Catalogue

  • Départements
  • Rôles
  • Outils
  • Métriques
  • Plateformes

Croissance

  • Programme de parrainage
  • Partenaires

Mentions légales

  • Politique de confidentialité
  • Conditions de service
  • Politique de cookies
  • Utilisation acceptable
  • Sécurité
  • SLA

© 2026 ElasticFlow. Tous droits réservés.

ElasticFlow
HubToutes les compétencesPar départementPar rôlePar outilPar métriqueMCPsÉditeurs
Site principalConnexionS'inscrire
  1. Accueil
  2. Compétences
  3. HubSpot CRM
Disponible en :🇬🇧 English🇰🇷 한국어🇵🇹 Português🇹🇷 Türkçe
Compétence IAUse HubSpot dataVentes

Use HubSpot CRM records as evidence for sales, pipeline, and customer analysis. — Claude Skill

Une compétence Claude pour Claude Code par FunnelEnvy — exécuter /hubspot-crm dans Claude·Mis à jour le 14 juin 2026·vmain@1804741

Compatible avecGChatGPTClaudeClaudeCCClaude CodeXCodex / Codex CLICursorCursorGeminiGemini

Connects HubSpot contacts, companies, lists, and deal fields to business workflows so teams can pull CRM evidence, check fields, and sync cleanly before analysis.

  • Pulls HubSpot contact, company, list, and deal context into analysis workflows.
  • Explains which CRM fields are needed before a sales or competitive question can be answered.
  • Helps avoid bad analysis caused by missing owner, lifecycle stage, deal reason, or segment data.
  • Keeps API and sync limitations visible for operators who maintain the CRM connection.
VousAujourd'hui

Teams export HubSpot data and start analysis before checking whether key fields are complete.

Avec /hubspot-crm

Run /hubspot-crm to define the records, fields, filters, and hygiene checks needed before analysis.

1 State the business question2 Map HubSpot objects and fields3 Check data quality4 Analyze with caveats

Pour qui

Responsable Revenue Operations

Turn HubSpot data into reliable inputs for sales and pipeline analysis.

Voir les compétences de ce rôle
Manager commercial

Understand which CRM fields support competitive and win/loss decisions.

Voir les compétences de ce rôle

Ce qu'il fait

Win/loss evidence

Use HubSpot deal notes and fields to support competitive analysis.

Pipeline segmentation

Filter opportunities by segment, competitor, source, or lifecycle stage.

CRM hygiene before analysis

Find missing owners, reasons, stages, or fields that would distort a report.

Fonctionnement

1

Define the business question and the HubSpot records needed to answer it.

2

Identify required objects, filters, fields, owner data, lifecycle stages, and date ranges.

3

Pull or paste exported HubSpot evidence into the analysis workflow.

4

Check for missing, duplicate, or stale fields before using the data.

5

Return a business-ready readout plus any CRM cleanup needed.

Options d'entrée

Business question

The sales, pipeline, customer, or competitive question to answer.

Exemple

What the user pastes
Need to analyze competitive losses from HubSpot for Q2.
Objects available: deals, companies, contacts.
Fields:
- dealstage
- closedate
- competitor_name
- closed_lost_reason
- amount
- owner
- company_size
- segment
Known issue: some deals have competitor_name empty but notes mention LearnPro or GuidePilot.
Need: field checklist, filters, export plan, and warnings before using this data in a battlecard refresh.
Useful result
CRM readout
Use closed-lost deals from Q2 where competitor_name is LearnPro or GuidePilot, plus deals where notes mention those names. Segment by company_size and owner before drawing conclusions.
Required HubSpot fields
| Field | Why it matters | Risk if missing |
|---|---|---|
| competitor_name | Main grouping for battlecard refresh | Losses may be undercounted |
| closed_lost_reason | Explains why deals were lost | Output becomes anecdotal |
| segment/company_size | Shows which market is affected | Enterprise and SMB patterns get mixed |
| amount | Helps prioritize high-value losses | Small deals may dominate the story |
| owner | Enables follow-up with seller | Evidence cannot be validated |
Export plan
Export closed-lost Q2 deals with required fields, then add a notes keyword pass for LearnPro and GuidePilot. Keep the notes extract separate from structured competitor_name so the team can see which findings are inferred.
Data warnings
Do not report exact competitor loss rate until empty competitor_name fields are reviewed. If closed_lost_reason is generic, use call notes or owner follow-up before turning it into battlecard guidance.
Next action
Create a CRM cleanup task: require competitor_name and closed_lost_reason for competitive closed-lost deals above $25k ARR.

Métriques améliorées

Taux de capture des données CRM
Improves completeness of CRM fields needed for analysis.
Ventes
Hygiène du portefeuille commercial
Flags missing or inconsistent records before reporting.
Ventes

Compatible avec

Google Sheets
manuel

Review exported HubSpot records and cleanup lists.

Slack
manuel

Share data quality warnings and follow-up tasks with sales owners.

HubSpot
manuel

Primary CRM source for contacts, companies, lists, deals, owners, and notes.

Envie d'utiliser HubSpot CRM ?

Choisissez comment commencer.

Exécuter dans Claude Code
Gratuit. Open source.

Installez et exécutez cette compétence localement sur votre ordinateur.

1
Installer Claude Code

Ouvrez un terminal sur votre ordinateur et collez cette commande :

2
Installer la compétence

Cela télécharge la compétence avec tous ses fichiers sur votre ordinateur :

Ajoutez -g à la fin pour le rendre disponible dans tous vos projets.

3
Lancez-le

Démarrez Claude Code, puis tapez la commande :

puis
Voir la source sur GitHub
Utiliser sur ElasticFlow
Fonctionnalités d'équipe et de collaboration

Exécutez les compétences depuis votre navigateur. Partagez les résultats, gérez les accès, collaborez avec votre équipe. Sans terminal.

Essai gratuit de 14 jours. Annulez à tout moment.

Voir sur GitHub

HubSpot CRM Integration

Sync contacts and lists to HubSpot using the REST API.

Environment Variables

HUBSPOT_API_TOKEN="pat-na1-..."  # Private App token from HubSpot

Quick Start

import os
import json
from urllib.request import Request, urlopen
from urllib.error import HTTPError

class HubSpotClient:
    """Simple HubSpot API client."""

    def __init__(self):
        self.token = os.environ.get('HUBSPOT_API_TOKEN')
        if not self.token:
            raise ValueError("HUBSPOT_API_TOKEN environment variable not set")
        self.base_url = "https://api.hubapi.com"

    def _request(self, method: str, endpoint: str, data: dict = None) -> dict:
        url = f"{self.base_url}{endpoint}"
        headers = {
            "Authorization": f"Bearer {self.token}",
            "Content-Type": "application/json"
        }
        body = json.dumps(data).encode('utf-8') if data else None
        request = Request(url, data=body, headers=headers, method=method)

        with urlopen(request, timeout=30) as response:
            return json.loads(response.read().decode('utf-8'))

Create Static List

def create_static_list(client, name: str) -> str:
    """Create a static list for contacts. Returns list ID."""
    payload = {
        "name": name,
        "objectTypeId": "0-1",  # REQUIRED: 0-1 = contacts
        "processingType": "MANUAL"
    }

    result = client._request("POST", "/crm/v3/lists", payload)
    # Response is nested: {"list": {"listId": "..."}}
    list_data = result.get("list", result)
    list_id = list_data.get("listId")

    print(f"✅ Created list: {name} (ID: {list_id})")
    return list_id

Search Contact by Email

def search_contact(client, email: str) -> str | None:
    """Find contact by email. Returns contact ID or None."""
    payload = {
        "filterGroups": [{
            "filters": [{
                "propertyName": "email",
                "operator": "EQ",
                "value": email
            }]
        }],
        "properties": ["email"],
        "limit": 1
    }

    result = client._request("POST", "/crm/v3/objects/contacts/search", payload)
    results = result.get("results", [])
    return results[0]["id"] if results else None

Create Contact

def create_contact(client, email: str, firstname: str = None, lastname: str = None) -> str:
    """Create a new contact with email only (vanilla upload).

    Only uses standard HubSpot properties (email, firstname, lastname)
    to avoid errors from missing custom properties in the target account.
    """
    properties = {"email": email}
    if firstname:
        properties["firstname"] = firstname
    if lastname:
        properties["lastname"] = lastname

    result = client._request("POST", "/crm/v3/objects/contacts", {"properties": properties})
    return result["id"]

Important: Do NOT pass arbitrary CSV columns as properties. HubSpot will reject any property names that don't exist in the target account. Only use standard fields (email, firstname, lastname) unless you've confirmed custom properties exist.

Add Contacts to List

def add_to_list(client, list_id: str, contact_ids: list[str]):
    """Add contacts to a static list. Batches in groups of 100."""
    endpoint = f"/crm/v3/lists/{list_id}/memberships/add"

    batch_size = 100
    total_added = 0

    for i in range(0, len(contact_ids), batch_size):
        batch = contact_ids[i:i + batch_size]
        # IMPORTANT: Payload is a simple array, NOT {"recordIdsToAdd": [...]}
        result = client._request("PUT", endpoint, batch)
        added = len(result.get("recordsIdsAdded", []))
        total_added += added
        print(f"  Added batch: {added} contacts")

    print(f"✅ Added {total_added} total contacts to list")

Full Upload Flow

def upload_users_to_hubspot(emails: list[str], list_name: str) -> str:
    """Upload a list of email addresses to HubSpot."""
    client = HubSpotClient()

    # Create list
    list_id = create_static_list(client, list_name)

    # Find or create contacts
    contact_ids = []
    for email in emails:
        contact_id = search_contact(client, email)
        if not contact_id:
            contact_id = create_contact(client, email)
        contact_ids.append(contact_id)

    # Add to list
    add_to_list(client, list_id, contact_ids)

    print(f"\n✅ Complete!")
    print(f"   List: https://app.hubspot.com/contacts/lists/{list_id}")

    return list_id

Usage Example

# Upload at-risk users from analysis
at_risk_emails = [
    "[email protected]",
    "[email protected]",
    "[email protected]"
]

list_id = upload_users_to_hubspot(
    emails=at_risk_emails,
    list_name="At-Risk Trial Users - Dec 2024"
)

Using the Integration Script

For CSV files, use the provided script:

.venv/bin/python demos/04-trial-to-paid/scripts/hubspot_integration.py \
  path/to/users.csv \
  "List Name Here"

The CSV must have an email column.

API Gotchas

  1. List creation requires objectTypeId: Always include "objectTypeId": "0-1" for contacts
  2. Response is nested: List ID is at result["list"]["listId"], not result["listId"]
  3. Add-to-list payload format: Use simple array ["id1", "id2"], NOT {"recordIdsToAdd": [...]}
  4. Contact IDs are strings: Even though they look numeric, treat them as strings
  5. Batch limit: Add contacts in batches of 100 max

Error Handling

from urllib.error import HTTPError

try:
    result = client._request("POST", endpoint, payload)
except HTTPError as e:
    error_body = e.read().decode('utf-8')
    print(f"HubSpot API error: {e.code}")
    print(f"  {error_body}")

Getting Your HubSpot Private App Token

  1. Go to Settings (gear icon) in HubSpot
  2. Navigate to Integrations > Private Apps
  3. Click Create a private app
  4. Give it a name (e.g., "AI Agent Integration")
  5. Under Scopes, enable:
    • crm.lists.read
    • crm.lists.write
    • crm.objects.contacts.read
    • crm.objects.contacts.write
  6. Click Create app and copy the token
  7. Set as HUBSPOT_API_TOKEN environment variable

Documents de référence


name: hubspot-crm description: Use when syncing contacts or lists to HubSpot CRM. Automatically uses HUBSPOT_API_TOKEN from environment.

HubSpot CRM Integration

Sync contacts and lists to HubSpot using the REST API.

Environment Variables

HUBSPOT_API_TOKEN="pat-na1-..."  # Private App token from HubSpot

Quick Start

import os
import json
from urllib.request import Request, urlopen
from urllib.error import HTTPError

class HubSpotClient:
    """Simple HubSpot API client."""

    def __init__(self):
        self.token = os.environ.get('HUBSPOT_API_TOKEN')
        if not self.token:
            raise ValueError("HUBSPOT_API_TOKEN environment variable not set")
        self.base_url = "https://api.hubapi.com"

    def _request(self, method: str, endpoint: str, data: dict = None) -> dict:
        url = f"{self.base_url}{endpoint}"
        headers = {
            "Authorization": f"Bearer {self.token}",
            "Content-Type": "application/json"
        }
        body = json.dumps(data).encode('utf-8') if data else None
        request = Request(url, data=body, headers=headers, method=method)

        with urlopen(request, timeout=30) as response:
            return json.loads(response.read().decode('utf-8'))

Create Static List

def create_static_list(client, name: str) -> str:
    """Create a static list for contacts. Returns list ID."""
    payload = {
        "name": name,
        "objectTypeId": "0-1",  # REQUIRED: 0-1 = contacts
        "processingType": "MANUAL"
    }

    result = client._request("POST", "/crm/v3/lists", payload)
    # Response is nested: {"list": {"listId": "..."}}
    list_data = result.get("list", result)
    list_id = list_data.get("listId")

    print(f"✅ Created list: {name} (ID: {list_id})")
    return list_id

Search Contact by Email

def search_contact(client, email: str) -> str | None:
    """Find contact by email. Returns contact ID or None."""
    payload = {
        "filterGroups": [{
            "filters": [{
                "propertyName": "email",
                "operator": "EQ",
                "value": email
            }]
        }],
        "properties": ["email"],
        "limit": 1
    }

    result = client._request("POST", "/crm/v3/objects/contacts/search", payload)
    results = result.get("results", [])
    return results[0]["id"] if results else None

Create Contact

def create_contact(client, email: str, firstname: str = None, lastname: str = None) -> str:
    """Create a new contact with email only (vanilla upload).

    Only uses standard HubSpot properties (email, firstname, lastname)
    to avoid errors from missing custom properties in the target account.
    """
    properties = {"email": email}
    if firstname:
        properties["firstname"] = firstname
    if lastname:
        properties["lastname"] = lastname

    result = client._request("POST", "/crm/v3/objects/contacts", {"properties": properties})
    return result["id"]

Important: Do NOT pass arbitrary CSV columns as properties. HubSpot will reject any property names that don't exist in the target account. Only use standard fields (email, firstname, lastname) unless you've confirmed custom properties exist.

Add Contacts to List

def add_to_list(client, list_id: str, contact_ids: list[str]):
    """Add contacts to a static list. Batches in groups of 100."""
    endpoint = f"/crm/v3/lists/{list_id}/memberships/add"

    batch_size = 100
    total_added = 0

    for i in range(0, len(contact_ids), batch_size):
        batch = contact_ids[i:i + batch_size]
        # IMPORTANT: Payload is a simple array, NOT {"recordIdsToAdd": [...]}
        result = client._request("PUT", endpoint, batch)
        added = len(result.get("recordsIdsAdded", []))
        total_added += added
        print(f"  Added batch: {added} contacts")

    print(f"✅ Added {total_added} total contacts to list")

Full Upload Flow

def upload_users_to_hubspot(emails: list[str], list_name: str) -> str:
    """Upload a list of email addresses to HubSpot."""
    client = HubSpotClient()

    # Create list
    list_id = create_static_list(client, list_name)

    # Find or create contacts
    contact_ids = []
    for email in emails:
        contact_id = search_contact(client, email)
        if not contact_id:
            contact_id = create_contact(client, email)
        contact_ids.append(contact_id)

    # Add to list
    add_to_list(client, list_id, contact_ids)

    print(f"\n✅ Complete!")
    print(f"   List: https://app.hubspot.com/contacts/lists/{list_id}")

    return list_id

Usage Example

# Upload at-risk users from analysis
at_risk_emails = [
    "[email protected]",
    "[email protected]",
    "[email protected]"
]

list_id = upload_users_to_hubspot(
    emails=at_risk_emails,
    list_name="At-Risk Trial Users - Dec 2024"
)

Using the Integration Script

For CSV files, use the provided script:

.venv/bin/python demos/04-trial-to-paid/scripts/hubspot_integration.py \
  path/to/users.csv \
  "List Name Here"

The CSV must have an email column.

API Gotchas

  1. List creation requires objectTypeId: Always include "objectTypeId": "0-1" for contacts
  2. Response is nested: List ID is at result["list"]["listId"], not result["listId"]
  3. Add-to-list payload format: Use simple array ["id1", "id2"], NOT {"recordIdsToAdd": [...]}
  4. Contact IDs are strings: Even though they look numeric, treat them as strings
  5. Batch limit: Add contacts in batches of 100 max

Error Handling

from urllib.error import HTTPError

try:
    result = client._request("POST", endpoint, payload)
except HTTPError as e:
    error_body = e.read().decode('utf-8')
    print(f"HubSpot API error: {e.code}")
    print(f"  {error_body}")

Getting Your HubSpot Private App Token

  1. Go to Settings (gear icon) in HubSpot
  2. Navigate to Integrations > Private Apps
  3. Click Create a private app
  4. Give it a name (e.g., "AI Agent Integration")
  5. Under Scopes, enable:
    • crm.lists.read
    • crm.lists.write
    • crm.objects.contacts.read
    • crm.objects.contacts.write
  6. Click Create app and copy the token
  7. Set as HUBSPOT_API_TOKEN environment variable
ElasticFlow

Transformez votre entreprise grâce à l'automatisation des workflows alimentée par l'IA. Une plateforme unifiée pour tous vos besoins enterprise.

Suivez-nous

Plateforme

  • Fonctionnalités
  • Avantages
  • Cas d'usage
  • Bibliothèque de workflows

Cas d'usage

  • Ventes
  • Marketing
  • Finance & Juridique
  • RH

Catalogue

  • Départements
  • Rôles
  • Outils
  • Métriques
  • Plateformes

Croissance

  • Programme de parrainage
  • Partenaires

Mentions légales

  • Politique de confidentialité
  • Conditions de service
  • Politique de cookies
  • Utilisation acceptable
  • Sécurité
  • SLA

© 2026 ElasticFlow. Tous droits réservés.