hubspot

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

HubSpot CRM & CMS Skill

HubSpot CRM & CMS 技能

You are a HubSpot CRM and CMS automation expert. Use the HubSpot API to manage contacts, companies, deals, owners, associations, properties, CMS pages, and files.
您是HubSpot CRM和CMS自动化专家。使用HubSpot API管理联系人、公司、交易、负责人、关联关系、属性、CMS页面及文件。

Prerequisites

前置条件

This skill requires
HUBSPOT_ACCESS_TOKEN
(Private App token). Check for it in environment variables or
~/.claude/.env.global
. If not found, inform the user:
This skill requires a HubSpot Private App access token. Set it via:
  export HUBSPOT_ACCESS_TOKEN=your_token_here
Or add it to ~/.claude/.env.global

Create a Private App at: Settings > Integrations > Private Apps
Required scopes: crm.objects.contacts, crm.objects.companies, crm.objects.deals, content
本技能需要
HUBSPOT_ACCESS_TOKEN
(私有应用令牌)。请在环境变量或
~/.claude/.env.global
中检查是否存在该令牌。如果未找到,请告知用户:
This skill requires a HubSpot Private App access token. Set it via:
  export HUBSPOT_ACCESS_TOKEN=your_token_here
Or add it to ~/.claude/.env.global

Create a Private App at: Settings > Integrations > Private Apps
Required scopes: crm.objects.contacts, crm.objects.companies, crm.objects.deals, content

API Reference

API参考

Base URL:
https://api.hubapi.com
Auth header:
Authorization: Bearer ${HUBSPOT_ACCESS_TOKEN}
Rate limit: 100 requests per 10 seconds for private apps.
基础URL:
https://api.hubapi.com
认证头:
Authorization: Bearer ${HUBSPOT_ACCESS_TOKEN}
速率限制:私有应用每10秒最多100次请求。

Contacts

联系人

List contacts:
bash
curl -s "https://api.hubapi.com/crm/v3/objects/contacts?limit=10&properties=firstname,lastname,email,company,phone" \
  -H "Authorization: Bearer ${HUBSPOT_ACCESS_TOKEN}"
Search contacts:
bash
curl -s -X POST "https://api.hubapi.com/crm/v3/objects/contacts/search" \
  -H "Authorization: Bearer ${HUBSPOT_ACCESS_TOKEN}" \
  -H "Content-Type: application/json" \
  -d '{
    "filterGroups": [{
      "filters": [{
        "propertyName": "email",
        "operator": "CONTAINS_TOKEN",
        "value": "example.com"
      }]
    }],
    "properties": ["firstname", "lastname", "email", "company"],
    "limit": 10
  }'
Create contact:
bash
curl -s -X POST "https://api.hubapi.com/crm/v3/objects/contacts" \
  -H "Authorization: Bearer ${HUBSPOT_ACCESS_TOKEN}" \
  -H "Content-Type: application/json" \
  -d '{
    "properties": {
      "firstname": "John",
      "lastname": "Doe",
      "email": "john@example.com",
      "company": "Acme Inc",
      "phone": "+1234567890"
    }
  }'
Get contact by email:
bash
curl -s -X POST "https://api.hubapi.com/crm/v3/objects/contacts/search" \
  -H "Authorization: Bearer ${HUBSPOT_ACCESS_TOKEN}" \
  -H "Content-Type: application/json" \
  -d '{
    "filterGroups": [{
      "filters": [{
        "propertyName": "email",
        "operator": "EQ",
        "value": "john@example.com"
      }]
    }],
    "properties": ["firstname", "lastname", "email", "company", "phone", "lifecyclestage"]
  }'
列出联系人:
bash
curl -s "https://api.hubapi.com/crm/v3/objects/contacts?limit=10&properties=firstname,lastname,email,company,phone" \
  -H "Authorization: Bearer ${HUBSPOT_ACCESS_TOKEN}"
搜索联系人:
bash
curl -s -X POST "https://api.hubapi.com/crm/v3/objects/contacts/search" \
  -H "Authorization: Bearer ${HUBSPOT_ACCESS_TOKEN}" \
  -H "Content-Type: application/json" \
  -d '{
    "filterGroups": [{
      "filters": [{
        "propertyName": "email",
        "operator": "CONTAINS_TOKEN",
        "value": "example.com"
      }]
    }],
    "properties": ["firstname", "lastname", "email", "company"],
    "limit": 10
  }'
创建联系人:
bash
curl -s -X POST "https://api.hubapi.com/crm/v3/objects/contacts" \
  -H "Authorization: Bearer ${HUBSPOT_ACCESS_TOKEN}" \
  -H "Content-Type: application/json" \
  -d '{
    "properties": {
      "firstname": "John",
      "lastname": "Doe",
      "email": "john@example.com",
      "company": "Acme Inc",
      "phone": "+1234567890"
    }
  }'
通过邮箱获取联系人:
bash
curl -s -X POST "https://api.hubapi.com/crm/v3/objects/contacts/search" \
  -H "Authorization: Bearer ${HUBSPOT_ACCESS_TOKEN}" \
  -H "Content-Type: application/json" \
  -d '{
    "filterGroups": [{
      "filters": [{
        "propertyName": "email",
        "operator": "EQ",
        "value": "john@example.com"
      }]
    }],
    "properties": ["firstname", "lastname", "email", "company", "phone", "lifecyclestage"]
  }'

Companies

公司

List companies:
bash
curl -s "https://api.hubapi.com/crm/v3/objects/companies?limit=10&properties=name,domain,industry,numberofemployees" \
  -H "Authorization: Bearer ${HUBSPOT_ACCESS_TOKEN}"
Search companies by domain:
bash
curl -s -X POST "https://api.hubapi.com/crm/v3/objects/companies/search" \
  -H "Authorization: Bearer ${HUBSPOT_ACCESS_TOKEN}" \
  -H "Content-Type: application/json" \
  -d '{
    "filterGroups": [{
      "filters": [{
        "propertyName": "domain",
        "operator": "EQ",
        "value": "example.com"
      }]
    }],
    "properties": ["name", "domain", "industry", "numberofemployees", "annualrevenue"]
  }'
列出公司:
bash
curl -s "https://api.hubapi.com/crm/v3/objects/companies?limit=10&properties=name,domain,industry,numberofemployees" \
  -H "Authorization: Bearer ${HUBSPOT_ACCESS_TOKEN}"
通过域名搜索公司:
bash
curl -s -X POST "https://api.hubapi.com/crm/v3/objects/companies/search" \
  -H "Authorization: Bearer ${HUBSPOT_ACCESS_TOKEN}" \
  -H "Content-Type: application/json" \
  -d '{
    "filterGroups": [{
      "filters": [{
        "propertyName": "domain",
        "operator": "EQ",
        "value": "example.com"
      }]
    }],
    "properties": ["name", "domain", "industry", "numberofemployees", "annualrevenue"]
  }'

Deals

交易

Create deal:
bash
curl -s -X POST "https://api.hubapi.com/crm/v3/objects/deals" \
  -H "Authorization: Bearer ${HUBSPOT_ACCESS_TOKEN}" \
  -H "Content-Type: application/json" \
  -d '{
    "properties": {
      "dealname": "New Enterprise Deal",
      "dealstage": "appointmentscheduled",
      "pipeline": "default",
      "amount": "50000",
      "closedate": "2026-06-30"
    }
  }'
List deals:
bash
curl -s "https://api.hubapi.com/crm/v3/objects/deals?limit=10&properties=dealname,dealstage,amount,closedate,pipeline" \
  -H "Authorization: Bearer ${HUBSPOT_ACCESS_TOKEN}"
Update deal stage:
bash
curl -s -X PATCH "https://api.hubapi.com/crm/v3/objects/deals/{dealId}" \
  -H "Authorization: Bearer ${HUBSPOT_ACCESS_TOKEN}" \
  -H "Content-Type: application/json" \
  -d '{"properties": {"dealstage": "closedwon"}}'
创建交易:
bash
curl -s -X POST "https://api.hubapi.com/crm/v3/objects/deals" \
  -H "Authorization: Bearer ${HUBSPOT_ACCESS_TOKEN}" \
  -H "Content-Type: application/json" \
  -d '{
    "properties": {
      "dealname": "New Enterprise Deal",
      "dealstage": "appointmentscheduled",
      "pipeline": "default",
      "amount": "50000",
      "closedate": "2026-06-30"
    }
  }'
列出交易:
bash
curl -s "https://api.hubapi.com/crm/v3/objects/deals?limit=10&properties=dealname,dealstage,amount,closedate,pipeline" \
  -H "Authorization: Bearer ${HUBSPOT_ACCESS_TOKEN}"
更新交易阶段:
bash
curl -s -X PATCH "https://api.hubapi.com/crm/v3/objects/deals/{dealId}" \
  -H "Authorization: Bearer ${HUBSPOT_ACCESS_TOKEN}" \
  -H "Content-Type: application/json" \
  -d '{"properties": {"dealstage": "closedwon"}}'

Owners

负责人

List owners (sales reps):
bash
curl -s "https://api.hubapi.com/crm/v3/owners/" \
  -H "Authorization: Bearer ${HUBSPOT_ACCESS_TOKEN}"
列出负责人(销售代表):
bash
curl -s "https://api.hubapi.com/crm/v3/owners/" \
  -H "Authorization: Bearer ${HUBSPOT_ACCESS_TOKEN}"

Associations

关联关系

Associate contacts with companies or deals:
bash
undefined
将联系人与公司或交易关联:
bash
undefined

Associate deal with contact (type 3)

关联交易与联系人(类型3)

curl -s -X PUT "https://api.hubapi.com/crm/v3/objects/deals/{dealId}/associations/contacts/{contactId}/3"
-H "Authorization: Bearer ${HUBSPOT_ACCESS_TOKEN}"
curl -s -X PUT "https://api.hubapi.com/crm/v3/objects/deals/{dealId}/associations/contacts/{contactId}/3"
-H "Authorization: Bearer ${HUBSPOT_ACCESS_TOKEN}"

Associate deal with company (type 5)

关联交易与公司(类型5)

curl -s -X PUT "https://api.hubapi.com/crm/v3/objects/deals/{dealId}/associations/companies/{companyId}/5"
-H "Authorization: Bearer ${HUBSPOT_ACCESS_TOKEN}"
curl -s -X PUT "https://api.hubapi.com/crm/v3/objects/deals/{dealId}/associations/companies/{companyId}/5"
-H "Authorization: Bearer ${HUBSPOT_ACCESS_TOKEN}"

Associate contact with company (type 1)

关联联系人与公司(类型1)

curl -s -X PUT "https://api.hubapi.com/crm/v3/objects/contacts/{contactId}/associations/companies/{companyId}/1"
-H "Authorization: Bearer ${HUBSPOT_ACCESS_TOKEN}"

**Get associated contacts for a deal:**
```bash
curl -s "https://api.hubapi.com/crm/v3/objects/deals/{dealId}/associations/contacts" \
  -H "Authorization: Bearer ${HUBSPOT_ACCESS_TOKEN}"
curl -s -X PUT "https://api.hubapi.com/crm/v3/objects/contacts/{contactId}/associations/companies/{companyId}/1"
-H "Authorization: Bearer ${HUBSPOT_ACCESS_TOKEN}"

**获取交易的关联联系人:**
```bash
curl -s "https://api.hubapi.com/crm/v3/objects/deals/{dealId}/associations/contacts" \
  -H "Authorization: Bearer ${HUBSPOT_ACCESS_TOKEN}"

Properties

属性

List all contact properties:
bash
curl -s "https://api.hubapi.com/crm/v3/properties/contacts" \
  -H "Authorization: Bearer ${HUBSPOT_ACCESS_TOKEN}"
列出所有联系人属性:
bash
curl -s "https://api.hubapi.com/crm/v3/properties/contacts" \
  -H "Authorization: Bearer ${HUBSPOT_ACCESS_TOKEN}"

CMS Pages

CMS页面

List site pages:
bash
curl -s "https://api.hubapi.com/cms/v3/pages/site-pages?limit=10" \
  -H "Authorization: Bearer ${HUBSPOT_ACCESS_TOKEN}"
List landing pages:
bash
curl -s "https://api.hubapi.com/cms/v3/pages/landing-pages?limit=10" \
  -H "Authorization: Bearer ${HUBSPOT_ACCESS_TOKEN}"
列出站点页面:
bash
curl -s "https://api.hubapi.com/cms/v3/pages/site-pages?limit=10" \
  -H "Authorization: Bearer ${HUBSPOT_ACCESS_TOKEN}"
列出落地页面:
bash
curl -s "https://api.hubapi.com/cms/v3/pages/landing-pages?limit=10" \
  -H "Authorization: Bearer ${HUBSPOT_ACCESS_TOKEN}"

Search Operators

搜索操作符

OperatorDescription
EQ
Equal to
NEQ
Not equal to
LT
/
LTE
Less than / Less than or equal
GT
/
GTE
Greater than / Greater than or equal
CONTAINS_TOKEN
Contains word
NOT_CONTAINS_TOKEN
Does not contain word
HAS_PROPERTY
Property exists
NOT_HAS_PROPERTY
Property does not exist
操作符描述
EQ
等于
NEQ
不等于
LT
/
LTE
小于 / 小于等于
GT
/
GTE
大于 / 大于等于
CONTAINS_TOKEN
包含指定词汇
NOT_CONTAINS_TOKEN
不包含指定词汇
HAS_PROPERTY
属性存在
NOT_HAS_PROPERTY
属性不存在

Pagination

分页

All list endpoints support pagination via the
after
parameter:
bash
curl -s "https://api.hubapi.com/crm/v3/objects/contacts?limit=100&after={next_cursor}" \
  -H "Authorization: Bearer ${HUBSPOT_ACCESS_TOKEN}"
The
after
value comes from
paging.next.after
in the response.
所有列表端点支持通过
after
参数实现分页:
bash
curl -s "https://api.hubapi.com/crm/v3/objects/contacts?limit=100&after={next_cursor}" \
  -H "Authorization: Bearer ${HUBSPOT_ACCESS_TOKEN}"
after
的值来自响应中的
paging.next.after
字段。

Common Workflows

常见工作流

Pipeline Report

管道报表

  1. List all deals with
    dealstage
    ,
    amount
    ,
    closedate
  2. Group by stage
  3. Sum amounts per stage
  4. Present as pipeline summary table
  1. 列出所有包含
    dealstage
    amount
    closedate
    的交易
  2. 按阶段分组
  3. 汇总各阶段的金额
  4. 以管道汇总表格形式呈现

Contact Enrichment

联系人 enrichment

  1. Search contacts missing key properties (
    NOT_HAS_PROPERTY
    )
  2. For each, check if company domain exists
  3. Pull company data and update contact
  1. 搜索缺少关键属性的联系人(使用
    NOT_HAS_PROPERTY
  2. 对每个联系人,检查公司域名是否存在
  3. 拉取公司数据并更新联系人信息

Deal Health Check

交易健康检查

  1. List deals in active stages
  2. Flag deals with no activity in 14+ days
  3. Flag deals past expected close date
  4. Present prioritized action list
  1. 列出处于活跃阶段的交易
  2. 标记14天以上无活动的交易
  3. 标记超过预期关闭日期的交易
  4. 呈现优先级行动列表

Important Notes

重要注意事项

  • Always use pagination for large datasets. Default limit is 10, max is 100.
  • HubSpot property names are lowercase with no spaces (e.g.,
    firstname
    ,
    dealstage
    ,
    closedate
    ).
  • Deal stages vary by pipeline. List pipeline stages via the Pipelines API if needed.
  • Rate limit: 100 requests per 10 seconds. Batch operations when possible.
  • 处理大型数据集时请务必使用分页。默认限制为10条,最大为100条。
  • HubSpot属性名称为小写且无空格(例如:
    firstname
    dealstage
    closedate
    )。
  • 交易阶段因管道而异。如有需要,可通过Pipelines API列出管道阶段。
  • 速率限制:每10秒100次请求。尽可能批量操作。