hubspot
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseHubSpot 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 (Private App token). Check for it in environment variables or . If not found, inform the user:
HUBSPOT_ACCESS_TOKEN~/.claude/.env.globalThis 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.globalThis 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, contentAPI Reference
API参考
Base URL:
Auth header:
Rate limit: 100 requests per 10 seconds for private apps.
https://api.hubapi.comAuthorization: Bearer ${HUBSPOT_ACCESS_TOKEN}基础URL:
认证头:
速率限制:私有应用每10秒最多100次请求。
https://api.hubapi.comAuthorization: Bearer ${HUBSPOT_ACCESS_TOKEN}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
undefinedAssociate 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}"
-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}"
-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}"
-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}"
-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}"
-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}"
-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
搜索操作符
| Operator | Description |
|---|---|
| Equal to |
| Not equal to |
| Less than / Less than or equal |
| Greater than / Greater than or equal |
| Contains word |
| Does not contain word |
| Property exists |
| Property does not exist |
| 操作符 | 描述 |
|---|---|
| 等于 |
| 不等于 |
| 小于 / 小于等于 |
| 大于 / 大于等于 |
| 包含指定词汇 |
| 不包含指定词汇 |
| 属性存在 |
| 属性不存在 |
Pagination
分页
All list endpoints support pagination via the parameter:
afterbash
curl -s "https://api.hubapi.com/crm/v3/objects/contacts?limit=100&after={next_cursor}" \
-H "Authorization: Bearer ${HUBSPOT_ACCESS_TOKEN}"The value comes from in the response.
afterpaging.next.after所有列表端点支持通过参数实现分页:
afterbash
curl -s "https://api.hubapi.com/crm/v3/objects/contacts?limit=100&after={next_cursor}" \
-H "Authorization: Bearer ${HUBSPOT_ACCESS_TOKEN}"afterpaging.next.afterCommon Workflows
常见工作流
Pipeline Report
管道报表
- List all deals with ,
dealstage,amountclosedate - Group by stage
- Sum amounts per stage
- Present as pipeline summary table
- 列出所有包含、
dealstage、amount的交易closedate - 按阶段分组
- 汇总各阶段的金额
- 以管道汇总表格形式呈现
Contact Enrichment
联系人 enrichment
- Search contacts missing key properties ()
NOT_HAS_PROPERTY - For each, check if company domain exists
- Pull company data and update contact
- 搜索缺少关键属性的联系人(使用)
NOT_HAS_PROPERTY - 对每个联系人,检查公司域名是否存在
- 拉取公司数据并更新联系人信息
Deal Health Check
交易健康检查
- List deals in active stages
- Flag deals with no activity in 14+ days
- Flag deals past expected close date
- Present prioritized action list
- 列出处于活跃阶段的交易
- 标记14天以上无活动的交易
- 标记超过预期关闭日期的交易
- 呈现优先级行动列表
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次请求。尽可能批量操作。