HubSpot Suite - Complete CRM & Marketing Platform
The ultimate HubSpot skill covering ALL aspects of the platform: CRM, Marketing, Sales, Service, CMS, and Developer tools.
Quick Start
1. Authentication Setup
CODEBLOCK0
See references/auth-setup.md for complete authentication guide including new Developer Platform.
2. Basic API Test
CODEBLOCK1
What Do You Want To Do?
CRM Management:
- -
references/crm-contacts.md → Create, update, search contacts - INLINECODE2 → Company records, hierarchies
- INLINECODE3 → Sales pipeline, deal stages
- INLINECODE4 → Support tickets, SLA management
- INLINECODE5 → Custom object schemas
Data & Associations:
- -
references/associations.md → Link records (contact→company, deal→contact) - INLINECODE7 → Custom properties, field groups
- INLINECODE8 → Deduplication, data cleanup
- INLINECODE9 → Bulk data migration
Activities & Automation:
- -
references/engagements.md → Log calls, emails, meetings, tasks - INLINECODE11 → Automation, triggers, enrollment
- INLINECODE12 → Configure pipelines, stages
Marketing & Sales:
- -
references/lists.md → Contact lists, segmentation - INLINECODE14 → Landing page forms
- INLINECODE15 → Email campaigns
- INLINECODE16 → Live chat, chatbots
Analytics & Reporting:
- -
references/reporting.md → Custom dashboards, KPIs - INLINECODE18 → Real-time event notifications
Content & Commerce:
- -
references/cms.md → Website pages, blog posts, HubDB - INLINECODE20 → Products, quotes, invoices
Platform & Development:
- -
references/developer-platform.md → HubSpot CLI, custom apps - INLINECODE22 → User management, permissions
- INLINECODE23 → UI navigation, admin tasks
Most Common Workflows
1. Import Contacts from CSV
CODEBLOCK2
2. Find & Merge Duplicate Contacts
CODEBLOCK3
3. Create Deal with Associations
CODEBLOCK4
4. Data Quality Audit
CODEBLOCK5
5. Export Pipeline Report
CODEBLOCK6
6. Log Activity (Call/Email/Meeting)
CODEBLOCK7
Script Usage
All scripts are in scripts/ directory. Make executable first:
CODEBLOCK8
Universal API Helper:
CODEBLOCK9
Data Management:
CODEBLOCK10
Reports & Analytics:
CODEBLOCK11
API Fundamentals
Rate Limits
- - Private Apps: 100 requests/10 seconds
- OAuth Apps: 100 requests/10 seconds
- Search API: 4 requests/second
- Batch Operations: 100 records max per request
Pagination
All list endpoints use
after parameter:
CODEBLOCK12
Error Handling
- - 429: Rate limit exceeded → Wait and retry
- 400: Bad request → Check property names/values
- 401: Authentication failed → Check token/scopes
- 404: Object not found → Verify ID exists
Common Headers
CODEBLOCK13
Batch Operations Pattern
CODEBLOCK14
Search Filters & Operators
Filter Syntax
CODEBLOCK15
Operators
- - EQ, NEQ: Equals, not equals
- LT, LTE, GT, GTE: Less/greater than
- CONTAINSTOKEN: Contains word
- HASPROPERTY, NOTHASPROPERTY: Property exists
- IN, NOT_IN: Value in list
- BETWEEN: Numeric/date range
Advanced Search Example
CODEBLOCK16
Environment Variables
Set these in your shell/environment:
CODEBLOCK17
Need Help?
- 1. API Issues: Check
references/rate-limits.md and INLINECODE27 - Authentication: See INLINECODE28
- UI Tasks: Check INLINECODE29
- Data Problems: Use INLINECODE30
- Specific Objects: Find the relevant
references/crm-*.md file
This skill covers the entire HubSpot platform. Start with the reference file that matches your task, then use the scripts to automate repetitive operations.
HubSpot套件 - 完整的CRM与营销平台
涵盖HubSpot平台所有方面的终极技能:CRM、营销、销售、服务、CMS和开发者工具。
快速入门
1. 认证设置
bash
私有应用(推荐)
export HUBSPOT
ACCESSTOKEN=pat-na1-xxx # 或 pat-eu1-xxx
传统API密钥
export HUBSPOT
APIKEY=your-api-key
完整认证指南(包括新的开发者平台)请参阅 references/auth-setup.md。
2. 基础API测试
bash
curl -H Authorization: Bearer $HUBSPOT
ACCESSTOKEN \
https://api.hubapi.com/crm/v3/objects/contacts?limit=1
你想做什么?
CRM管理:
- - references/crm-contacts.md → 创建、更新、搜索联系人
- references/crm-companies.md → 公司记录、层级结构
- references/crm-deals.md → 销售管道、交易阶段
- references/crm-tickets.md → 支持工单、SLA管理
- references/crm-custom-objects.md → 自定义对象架构
数据与关联:
- - references/associations.md → 关联记录(联系人→公司,交易→联系人)
- references/properties.md → 自定义属性、字段组
- references/data-quality.md → 去重、数据清理
- references/import-export.md → 批量数据迁移
活动与自动化:
- - references/engagements.md → 记录通话、邮件、会议、任务
- references/workflows.md → 自动化、触发器、注册
- references/pipelines.md → 配置管道、阶段
营销与销售:
- - references/lists.md → 联系人列表、细分
- references/forms.md → 落地页表单
- references/email-marketing.md → 邮件营销活动
- references/conversations.md → 实时聊天、聊天机器人
分析与报告:
- - references/reporting.md → 自定义仪表盘、关键绩效指标
- references/webhooks.md → 实时事件通知
内容与商务:
- - references/cms.md → 网站页面、博客文章、HubDB
- references/commerce.md → 产品、报价、发票
平台与开发:
- - references/developer-platform.md → HubSpot CLI、自定义应用
- references/owners.md → 用户管理、权限
- references/knowledge-base-tips.md → 界面导航、管理任务
最常见的工作流程
1. 从CSV导入联系人
bash
./scripts/bulk-import.sh contacts contacts.csv
2. 查找并合并重复联系人
bash
./scripts/find-duplicates.sh contacts email
./scripts/merge-records.sh contacts ID1 ID2
3. 创建带关联的交易
bash
创建交易
curl -X POST https://api.hubapi.com/crm/v3/objects/deals \
-H Authorization: Bearer $HUBSPOT
ACCESSTOKEN \
-H Content-Type: application/json \
-d {
properties: {
dealname: 大交易,
amount: 50000,
dealstage: qualifiedtobuy
}
}
关联到联系人(类型3 = 交易→联系人)
curl -X PUT https://api.hubapi.com/crm/v3/objects/deals/DEAL
ID/associations/contacts/CONTACTID/3 \
-H Authorization: Bearer $HUBSPOT
ACCESSTOKEN
4. 数据质量审计
bash
./scripts/data-audit.sh
5. 导出管道报告
bash
./scripts/pipeline-report.sh > pipeline_report.csv
6. 记录活动(通话/邮件/会议)
bash
记录销售通话
curl -X POST https://api.hubapi.com/crm/v3/objects/calls \
-H Authorization: Bearer $HUBSPOT
ACCESSTOKEN \
-H Content-Type: application/json \
-d {
properties: {
hs
calltitle: 发现通话,
hs
callduration: 1800000,
hs
calldisposition: 已接通
},
associations: [{
to: { id: CONTACT_ID },
types: [{ associationCategory: HUBSPOT_DEFINED, associationTypeId: 194 }]
}]
}
脚本使用
所有脚本都在 scripts/ 目录中。首先使其可执行:
bash
chmod +x scripts/*.sh
通用API助手:
bash
./scripts/hs-api.sh GET /crm/v3/objects/contacts
./scripts/hs-api.sh POST /crm/v3/objects/companies {properties:{name:ACME}}
数据管理:
bash
./scripts/bulk-import.sh [对象类型] [csv文件]
./scripts/bulk-export.sh [对象类型] [输出文件]
./scripts/find-duplicates.sh [对象类型] [属性]
./scripts/merge-records.sh [对象类型] [主ID] [重复ID]
报告与分析:
bash
./scripts/data-audit.sh > audit-report.txt
./scripts/pipeline-report.sh > pipeline-analysis.csv
API基础知识
速率限制
- - 私有应用: 每10秒100次请求
- OAuth应用: 每10秒100次请求
- 搜索API: 每秒4次请求
- 批量操作: 每次请求最多100条记录
分页
所有列表端点使用 after 参数:
bash
curl https://api.hubapi.com/crm/v3/objects/contacts?after=12345&limit=100
错误处理
- - 429: 超出速率限制 → 等待后重试
- 400: 错误请求 → 检查属性名称/值
- 401: 认证失败 → 检查令牌/作用域
- 404: 对象未找到 → 验证ID是否存在
通用请求头
bash
-H Authorization: Bearer $HUBSPOT
ACCESSTOKEN
-H Content-Type: application/json
批量操作模式
bash
curl -X POST https://api.hubapi.com/crm/v3/objects/contacts/batch/create \
-H Authorization: Bearer $HUBSPOT
ACCESSTOKEN \
-H Content-Type: application/json \
-d {
inputs: [
{properties: {firstname: 张三, lastname: 李}},
{properties: {firstname: 王芳, lastname: 赵}}
]
}
搜索过滤器与运算符
过滤器语法
json
{
filters: [{
propertyName: email,
operator: EQ,
value: john@example.com
}]
}
运算符
- - EQ, NEQ: 等于,不等于
- LT, LTE, GT, GTE: 小于/大于
- CONTAINSTOKEN: 包含词语
- HASPROPERTY, NOTHASPROPERTY: 属性存在
- IN, NOT_IN: 值在列表中
- BETWEEN: 数值/日期范围
高级搜索示例
bash
curl -X POST https://api.hubapi.com/crm/v3/objects/contacts/search \
-H Authorization: Bearer $HUBSPOT
ACCESSTOKEN \
-H Content-Type: application/json \
-d {
filters: [{
propertyName: createdate,
operator: GTE,
value: 2024-01-01
}],
sorts: [{propertyName: createdate, direction: DESCENDING}],
limit: 100
}
环境变量
在shell/环境中设置以下变量:
bash
必需
export HUBSPOT
ACCESSTOKEN=pat-na1-xxx # 私有应用令牌
可选
export HUBSPOT
APIKEY=xxx # 传统API密钥
export HUBSPOT
PORTALID=12345 # 用于某些API调用
export HUBSPOT
BASEURL=https://api.hubapi.com # 测试时覆盖
需要帮助?
- 1. API问题: 查看 references/