跳转到内容

HubSpot 集成

让你的智能体在 HubSpot 中管理公司和联系人。你可以创建新记录并简化 CRM 流程,从而借助 AI 驱动的自动化提升工作效率。

在使用 HubSpot 集成之前,请确保你已具备:

  • 一个拥有有效订阅的 CrewAI AMP 账户
  • 一个具备相应权限的 HubSpot 账户
  • 通过 集成页面 连接了你的 HubSpot 账户
  1. 访问 CrewAI AMP Integrations
  2. 在 Authentication Integrations 部分找到 HubSpot
  3. 点击 Connect 并完成 OAuth 流程
  4. 授予公司和联系人管理所需权限
  5. Integration Settings 复制你的 Enterprise Token
Terminal window
uv add crewai-tools
Terminal window
export CREWAI_PLATFORM_INTEGRATION_TOKEN="your_enterprise_token"

或者将其添加到你的 .env 文件中:

CREWAI_PLATFORM_INTEGRATION_TOKEN=your_enterprise_token
hubspot/create_company

说明: 在 HubSpot 中创建新的公司记录。

参数:

  • name (string, required): 公司名称。
  • domain (string, optional): 公司域名。
  • industry (string, optional): 行业。必须是 HubSpot 预定义值之一。
  • phone (string, optional): 电话号码。
  • hubspot_owner_id (string, optional): 公司所有者 ID。
  • type (string, optional): 公司类型。可用值:PROSPECT, PARTNER, RESELLER, VENDOR, OTHER
  • city (string, optional): 城市。
  • state (string, optional): 州/地区。
  • zip (string, optional): 邮政编码。
  • numberofemployees (number, optional): 员工数量。
  • annualrevenue (number, optional): 年收入。
  • timezone (string, optional): 时区。
  • description (string, optional): 描述。
  • linkedin_company_page (string, optional): LinkedIn 公司主页 URL。
  • company_email (string, optional): 公司电子邮件。
  • first_name (string, optional): 公司联系人名字。
  • last_name (string, optional): 公司联系人姓氏。
  • about_us (string, optional): 关于我们。
  • hs_csm_sentiment (string, optional): CSM 情绪。可用值:at_risk, neutral, healthy
  • closedate (string, optional): 关闭日期。
  • hs_keywords (string, optional): 公司关键词。必须是预定义值之一。
  • country (string, optional): 国家/地区。
  • hs_country_code (string, optional): 国家/地区代码。
  • hs_employee_range (string, optional): 员工范围。
  • facebook_company_page (string, optional): Facebook 公司主页 URL。
  • facebookfans (number, optional): Facebook 粉丝数。
  • hs_gps_coordinates (string, optional): GPS 坐标。
  • hs_gps_error (string, optional): GPS 错误。
  • googleplus_page (string, optional): Google Plus 页面 URL。
  • owneremail (string, optional): HubSpot 所有者电子邮件。
  • ownername (string, optional): HubSpot 所有者名称。
  • hs_ideal_customer_profile (string, optional): 理想客户画像层级。可用值:tier_1, tier_2, tier_3
  • hs_industry_group (string, optional): 行业组。
  • is_public (boolean, optional): 是否公开。
  • hs_last_metered_enrichment_timestamp (string, optional): 上次计量增强时间戳。
  • hs_lead_status (string, optional): 潜在客户状态。可用值:NEW, OPEN, IN_PROGRESS, OPEN_DEAL, UNQUALIFIED, ATTEMPTED_TO_CONTACT, CONNECTED, BAD_TIMING
  • lifecyclestage (string, optional): 生命周期阶段。可用值:subscriber, lead, marketingqualifiedlead, salesqualifiedlead, opportunity, customer, evangelist, other
  • linkedinbio (string, optional): LinkedIn 简介。
  • hs_linkedin_handle (string, optional): LinkedIn 句柄。
  • hs_live_enrichment_deadline (string, optional): 实时增强截止时间。
  • hs_logo_url (string, optional): Logo URL。
  • hs_analytics_source (string, optional): 原始流量来源。
  • hs_pinned_engagement_id (number, optional): 固定互动 ID。
  • hs_quick_context (string, optional): 快速上下文。
  • hs_revenue_range (string, optional): 收入范围。
  • hs_state_code (string, optional): 州/地区代码。
  • address (string, optional): 街道地址。
  • address2 (string, optional): 街道地址 2。
  • hs_is_target_account (boolean, optional): 是否为目标账户。
  • hs_target_account (string, optional): 目标账户层级。可用值:tier_1, tier_2, tier_3
  • hs_target_account_recommendation_snooze_time (string, optional): 目标账户推荐稍后提醒时间。
  • hs_target_account_recommendation_state (string, optional): 目标账户推荐状态。可用值:DISMISSED, NONE, SNOOZED
  • total_money_raised (string, optional): 融资总额。
  • twitterbio (string, optional): Twitter 简介。
  • twitterfollowers (number, optional): Twitter 粉丝数。
  • twitterhandle (string, optional): Twitter 账号。
  • web_technologies (string, optional): 使用的 Web 技术。必须是预定义值之一。
  • website (string, optional): 网站 URL。
  • founded_year (string, optional): 成立年份。
hubspot/create_contact

说明: 在 HubSpot 中创建新的联系人记录。

参数:

  • email (string, required): 联系人电子邮件地址。
  • firstname (string, optional): 名字。
  • lastname (string, optional): 姓氏。
  • phone (string, optional): 电话号码。
  • hubspot_owner_id (string, optional): 联系人所有者。
  • lifecyclestage (string, optional): 生命周期阶段。可用值:subscriber, lead, marketingqualifiedlead, salesqualifiedlead, opportunity, customer, evangelist, other
  • hs_lead_status (string, optional): 潜在客户状态。可用值:NEW, OPEN, IN_PROGRESS, OPEN_DEAL, UNQUALIFIED, ATTEMPTED_TO_CONTACT, CONNECTED, BAD_TIMING
  • annualrevenue (string, optional): 年收入。
  • hs_buying_role (string, optional): 采购角色。
  • cc_emails (string, optional): 抄送电子邮件。
  • ch_customer_id (string, optional): Chargify 客户 ID。
  • ch_customer_reference (string, optional): Chargify 客户引用。
  • chargify_sites (string, optional): Chargify 站点。
  • city (string, optional): 城市。
  • hs_facebook_ad_clicked (boolean, optional): 是否点击过 Facebook 广告。
  • hs_linkedin_ad_clicked (string, optional): 是否点击过 LinkedIn 广告。
  • hs_clicked_linkedin_ad (string, optional): 是否点击过 LinkedIn 广告。
  • closedate (string, optional): 关闭日期。
  • company (string, optional): 公司名称。
  • company_size (string, optional): 公司规模。
  • country (string, optional): 国家/地区。
  • hs_country_region_code (string, optional): 国家/地区代码。
  • date_of_birth (string, optional): 出生日期。
  • degree (string, optional): 学位。
  • hs_email_customer_quarantined_reason (string, optional): 电子邮件地址隔离原因。
  • hs_role (string, optional): 职位。必须是预定义值之一。
  • hs_seniority (string, optional): 职级。必须是预定义值之一。
  • hs_sub_role (string, optional): 子职能。必须是预定义值之一。
  • hs_employment_change_detected_date (string, optional): 检测到职位变动的日期。
  • hs_enriched_email_bounce_detected (boolean, optional): 检测到增强邮箱退信。
  • hs_facebookid (string, optional): Facebook ID。
  • hs_facebook_click_id (string, optional): Facebook 点击 ID。
  • fax (string, optional): 传真号码。
  • field_of_study (string, optional): 学习领域。
  • followercount (number, optional): 粉丝数。
  • gender (string, optional): 性别。
  • hs_google_click_id (string, optional): Google 广告点击 ID。
  • graduation_date (string, optional): 毕业日期。
  • owneremail (string, optional): HubSpot 所有者电子邮件(旧字段)。
  • ownername (string, optional): HubSpot 所有者名称(旧字段)。
  • industry (string, optional): 行业。
  • hs_inferred_language_codes (string, optional): 推断语言代码。必须是预定义值之一。
  • jobtitle (string, optional): 职位名称。
  • hs_job_change_detected_date (string, optional): 检测到职位变动的日期。
  • job_function (string, optional): 职能。
  • hs_journey_stage (string, optional): 旅程阶段。必须是预定义值之一。
  • kloutscoregeneral (number, optional): Klout 分数。
  • hs_last_metered_enrichment_timestamp (string, optional): 上次计量增强时间戳。
  • hs_latest_source (string, optional): 最新流量来源。
  • hs_latest_source_timestamp (string, optional): 最新流量来源日期。
  • hs_legal_basis (string, optional): 处理联系人数据的法律依据。
  • linkedinbio (string, optional): LinkedIn 简介。
  • linkedinconnections (number, optional): LinkedIn 连接数。
  • hs_linkedin_url (string, optional): LinkedIn URL。
  • hs_linkedinid (string, optional): LinkedIn ID。
  • hs_live_enrichment_deadline (string, optional): 实时增强截止时间。
  • marital_status (string, optional): 婚姻状况。
  • hs_content_membership_email (string, optional): 会员邮箱。
  • hs_content_membership_notes (string, optional): 会员备注。
  • message (string, optional): 消息。
  • military_status (string, optional): 服役状态。
  • mobilephone (string, optional): 手机号码。
  • numemployees (string, optional): 员工数量。
  • hs_analytics_source (string, optional): 原始流量来源。
  • photo (string, optional): 照片。
  • hs_pinned_engagement_id (number, optional): 固定互动 ID。
  • zip (string, optional): 邮政编码。
  • hs_language (string, optional): 首选语言。必须是预定义值之一。
  • associatedcompanyid (number, optional): 主要关联公司 ID。
  • hs_email_optout_survey_reason (string, optional): 退订电子邮件的原因。
  • relationship_status (string, optional): 关系状态。
  • hs_returning_to_office_detected_date (string, optional): 检测到返回办公室的日期。
  • salutation (string, optional): 称谓。
  • school (string, optional): 学校。
  • seniority (string, optional): 资历。
  • hs_feedback_show_nps_web_survey (boolean, optional): 是否显示 NPS 网页调查。
  • start_date (string, optional): 开始日期。
  • state (string, optional): 州/地区。
  • hs_state_code (string, optional): 州/地区代码。
  • hs_content_membership_status (string, optional): 状态。
  • address (string, optional): 街道地址。
  • tax_exempt (string, optional): 免税状态。
  • hs_timezone (string, optional): 时区。必须是预定义值之一。
  • twitterbio (string, optional): Twitter 简介。
  • hs_twitterid (string, optional): Twitter ID。
  • twitterprofilephoto (string, optional): Twitter 头像。
  • twitterhandle (string, optional): Twitter 用户名。
  • vat_number (string, optional): 增值税号。
  • ch_verified (string, optional): 通过 ACH/eCheck 支付验证。
  • website (string, optional): 网站 URL。
  • hs_whatsapp_phone_number (string, optional): WhatsApp 电话号码。
  • work_email (string, optional): 工作邮箱。
  • hs_googleplusid (string, optional): Googleplus ID。
hubspot/create_deal

说明: 在 HubSpot 中创建新的交易记录。

参数:

  • dealname (string, required): 交易名称。
  • amount (number, optional): 交易金额。
  • dealstage (string, optional): 交易所在的管道阶段。
  • pipeline (string, optional): 交易所属的管道。
  • closedate (string, optional): 预计成交日期。
  • hubspot_owner_id (string, optional): 交易所有者。
  • dealtype (string, optional): 交易类型。可用值:newbusiness, existingbusiness
  • description (string, optional): 交易描述。
  • hs_priority (string, optional): 交易优先级。可用值:low, medium, high
hubspot/create_record_engagements

说明: 在 HubSpot 中创建新的互动记录(例如:备注、电子邮件、电话、会议、任务)。

参数:

  • engagementType (string, required): 互动类型。可用值:NOTE, EMAIL, CALL, MEETING, TASK
  • hubspot_owner_id (string, optional): 将活动分配给的用户。
  • hs_timestamp (string, optional): 活动的日期和时间。
  • hs_note_body (string, optional): 备注正文。(用于 NOTE
  • hs_task_subject (string, optional): 任务标题。(用于 TASK
  • hs_task_body (string, optional): 任务备注。(用于 TASK
  • hs_task_status (string, optional): 任务状态。(用于 TASK
  • hs_meeting_title (string, optional): 会议标题。(用于 MEETING
  • hs_meeting_body (string, optional): 会议描述。(用于 MEETING
  • hs_meeting_start_time (string, optional): 会议开始时间。(用于 MEETING
  • hs_meeting_end_time (string, optional): 会议结束时间。(用于 MEETING
hubspot/update_company

说明: 更新 HubSpot 中已有的公司记录。

参数:

  • recordId (string, required): 要更新的记录 ID。
  • name (string, optional): 公司名称。
  • domain (string, optional): 公司域名。
  • industry (string, optional): 行业。
  • phone (string, optional): 电话号码。
  • city (string, optional): 城市。
  • state (string, optional): 州/地区。
  • zip (string, optional): 邮政编码。
  • numberofemployees (number, optional): 员工数量。
  • annualrevenue (number, optional): 年收入。
  • description (string, optional): 描述。
hubspot/create_record_any

说明: 在 HubSpot 中为指定对象类型创建记录。

参数:

  • recordType (string, required): 自定义对象的对象类型 ID。
  • 其他参数取决于自定义对象的 schema。
hubspot/update_contact

说明: 更新 HubSpot 中已有的联系人记录。

参数:

  • recordId (string, required): 要更新的联系人 ID。
  • firstname (string, optional): 名字。
  • lastname (string, optional): 姓氏。
  • email (string, optional): 电子邮件地址。
  • phone (string, optional): 电话号码。
  • company (string, optional): 公司名称。
  • jobtitle (string, optional): 职位名称。
  • lifecyclestage (string, optional): 生命周期阶段。
hubspot/update_deal

说明: 更新 HubSpot 中已有的交易记录。

参数:

  • recordId (string, required): 要更新的交易 ID。
  • dealname (string, optional): 交易名称。
  • amount (number, optional): 交易金额。
  • dealstage (string, optional): 交易所在的管道阶段。
  • pipeline (string, optional): 交易所属的管道。
  • closedate (string, optional): 预计成交日期。
  • dealtype (string, optional): 交易类型。
hubspot/update_record_engagements

说明: 更新 HubSpot 中已有的互动记录。

参数:

  • recordId (string, required): 要更新的互动 ID。
  • hs_note_body (string, optional): 备注正文。
  • hs_task_subject (string, optional): 任务标题。
  • hs_task_body (string, optional): 任务备注。
  • hs_task_status (string, optional): 任务状态。
hubspot/update_record_any

说明: 更新 HubSpot 中指定对象类型的记录。

参数:

  • recordId (string, required): 要更新的记录 ID。
  • recordType (string, required): 自定义对象的对象类型 ID。
  • 其他参数取决于自定义对象的 schema。
hubspot/list_companies

说明: 获取 HubSpot 中的公司记录列表。

参数:

  • paginationParameters (object, optional): 使用 pageCursor 获取后续页面。
hubspot/list_contacts

说明: 获取 HubSpot 中的联系人记录列表。

参数:

  • paginationParameters (object, optional): 使用 pageCursor 获取后续页面。
hubspot/list_deals

说明: 获取 HubSpot 中的交易记录列表。

参数:

  • paginationParameters (object, optional): 使用 pageCursor 获取后续页面。
hubspot/get_records_engagements

说明: 获取 HubSpot 中的互动记录列表。

参数:

  • objectName (string, required): 要获取的互动类型(例如:“notes”)。
  • paginationParameters (object, optional): 使用 pageCursor 获取后续页面。
hubspot/get_records_any

说明: 获取 HubSpot 中指定对象类型的记录列表。

参数:

  • recordType (string, required): 自定义对象的对象类型 ID。
  • paginationParameters (object, optional): 使用 pageCursor 获取后续页面。
hubspot/get_company

说明: 通过 ID 获取单个公司记录。

参数:

  • recordId (string, required): 要检索的公司 ID。
hubspot/get_contact

说明: 通过 ID 获取单个联系人记录。

参数:

  • recordId (string, required): 要检索的联系人 ID。
hubspot/get_deal

说明: 通过 ID 获取单个交易记录。

参数:

  • recordId (string, required): 要检索的交易 ID。
hubspot/get_record_by_id_engagements

说明: 通过 ID 获取单个互动记录。

参数:

  • recordId (string, required): 要检索的互动 ID。
hubspot/get_record_by_id_any

说明: 通过 ID 获取指定对象类型的单条记录。

参数:

  • recordType (string, required): 自定义对象的对象类型 ID。
  • recordId (string, required): 要检索的记录 ID。
hubspot/search_companies

说明: 使用筛选公式搜索 HubSpot 中的公司记录。

参数:

  • filterFormula (object, optional): 以析取范式表示的筛选条件(OR of ANDs)。
  • paginationParameters (object, optional): 使用 pageCursor 获取后续页面。
hubspot/search_contacts

说明: 使用筛选公式搜索 HubSpot 中的联系人记录。

参数:

  • filterFormula (object, optional): 以析取范式表示的筛选条件(OR of ANDs)。
  • paginationParameters (object, optional): 使用 pageCursor 获取后续页面。
hubspot/search_deals

说明: 使用筛选公式搜索 HubSpot 中的交易记录。

参数:

  • filterFormula (object, optional): 以析取范式表示的筛选条件(OR of ANDs)。
  • paginationParameters (object, optional): 使用 pageCursor 获取后续页面。
hubspot/search_records_engagements

说明: 使用筛选公式搜索 HubSpot 中的互动记录。

参数:

  • engagementFilterFormula (object, optional): 用于互动的筛选条件。
  • paginationParameters (object, optional): 使用 pageCursor 获取后续页面。
hubspot/search_records_any

说明: 搜索指定对象类型的记录。

参数:

  • recordType (string, required): 要搜索的对象类型 ID。
  • filterFormula (string, optional): 要应用的筛选公式。
  • paginationParameters (object, optional): 使用 pageCursor 获取后续页面。
hubspot/delete_record_companies

说明: 通过 ID 删除公司记录。

参数:

  • recordId (string, required): 要删除的公司 ID。
hubspot/delete_record_contacts

说明: 通过 ID 删除联系人记录。

参数:

  • recordId (string, required): 要删除的联系人 ID。
hubspot/delete_record_deals

说明: 通过 ID 删除交易记录。

参数:

  • recordId (string, required): 要删除的交易 ID。
hubspot/delete_record_engagements

说明: 通过 ID 删除互动记录。

参数:

  • recordId (string, required): 要删除的互动 ID。
hubspot/delete_record_any

说明: 通过 ID 删除指定对象类型的记录。

参数:

  • recordType (string, required): 自定义对象的对象类型 ID。
  • recordId (string, required): 要删除的记录 ID。
hubspot/get_contacts_by_list_id

说明: 通过列表 ID 获取某个特定列表中的联系人。

参数:

  • listId (string, required): 要从中获取联系人的列表 ID。
  • paginationParameters (object, optional): 使用 pageCursor 获取后续页面。
hubspot/describe_action_schema

说明: 获取给定对象类型和操作的预期 schema。

参数:

  • recordType (string, required): 对象类型 ID(例如:companies)。
  • operation (string, required): 操作类型(例如:CREATE_RECORD)。
from crewai import Agent, Task, Crew
# Create an agent with HubSpot capabilities
hubspot_agent = Agent(
role="CRM Manager",
goal="Manage company and contact records in HubSpot",
backstory="An AI assistant specialized in CRM management.",
apps=['hubspot'] # All HubSpot actions will be available
)
# Task to create a new company
create_company_task = Task(
description="Create a new company in HubSpot with name 'Innovate Corp' and domain 'innovatecorp.com'.",
agent=hubspot_agent,
expected_output="Company created successfully with confirmation"
)
# Run the task
crew = Crew(
agents=[hubspot_agent],
tasks=[create_company_task]
)
crew.kickoff()
from crewai import Agent, Task, Crew
# Create agent with specific HubSpot actions only
contact_creator = Agent(
role="Contact Creator",
goal="Create new contacts in HubSpot",
backstory="An AI assistant that focuses on creating new contact entries in the CRM.",
apps=['hubspot/create_contact'] # Only contact creation action
)
# Task to create a contact
create_contact = Task(
description="Create a new contact for 'John Doe' with email '[email protected]'.",
agent=contact_creator,
expected_output="Contact created successfully in HubSpot."
)
crew = Crew(
agents=[contact_creator],
tasks=[create_contact]
)
crew.kickoff()
from crewai import Agent, Task, Crew
# Create agent with HubSpot contact management capabilities
crm_manager = Agent(
role="CRM Manager",
goal="Manage and organize HubSpot contacts efficiently.",
backstory="An experienced CRM manager who maintains an organized contact database.",
apps=['hubspot'] # All HubSpot actions including contact management
)
# Task to manage contacts
contact_task = Task(
description="Create a new contact for 'Jane Smith' at 'Global Tech Inc.' with email '[email protected]'.",
agent=crm_manager,
expected_output="Contact database updated with the new contact."
)
crew = Crew(
agents=[crm_manager],
tasks=[contact_task]
)
crew.kickoff()

需要帮助?

联系我们的支持团队,获取 HubSpot 集成设置或故障排查方面的帮助。