帮助中心Webhook文档 › 事件类型说明
WEBHOOK

Webhook 事件类型

翠鸟所有可订阅事件的描述、触发条件与 Payload 数据结构

事件 Payload 通用结构

所有 Webhook 事件共享相同的外层结构,业务数据位于 data 字段中。

{ "id": "evt_wh_9mKpRqLx", // 事件唯一ID,可用于幂等处理 "type": "lead.created", // 事件类型 "created_at": "2024-03-15T09:12:33Z", "account_id": "acc_xxxx", "api_version": "2024-01-01", "data": { // 事件相关的业务对象,结构因事件类型而异(见下文) } }

事件类型列表

事件类型触发时机data 内容
线索事件(Lead Events)
lead.created 访客通过 CTA 表单提交,新线索创建 完整的 Lead 对象,含访客行为摘要
lead.status_updated 线索状态字段发生变更 Lead 对象 + previous_status 字段
lead.score_changed 线索评分变化超过 10 分 Lead 对象 + previous_score 字段
lead.assigned 线索被分配给销售成员 Lead 对象 + assigned_to 用户信息
内容资源事件(Resource Events)
resource.created 新内容资源创建(含草稿) Resource 对象
resource.published 内容资源从草稿状态发布上线 Resource 对象,status 为 published
resource.archived 内容资源被归档 Resource 对象,status 为 archived
CTA 事件(CTA Events)
cta.form_submitted 访客提交 CTA 留资表单 表单字段值、CTA ID、关联资源 ID
cta.button_clicked 访客点击 CTA 跳转按钮 CTA ID、目标 URL、访客 ID
访客事件(Visitor Events)
visitor.identified 匿名访客与已知联系人成功匹配 访客 ID、Lead ID、识别来源

Payload 示例

lead.created

{ "id": "evt_wh_9mKpRqLx", "type": "lead.created", "created_at": "2024-03-15T09:12:33Z", "data": { "id": "lead_5xPqR8mNwK", "email": "zhang.wei@example.com", "name": "张伟", "company": "北京某科技有限公司", "engagement_score": 45, "status": "new", "source_resource_id": "res_7fK2mPqLxNz", "source_channel": "linkedin", "created_at": "2024-03-15T09:12:33Z" } }

lead.status_updated

{ "id": "evt_wh_3nRpZqWx", "type": "lead.status_updated", "created_at": "2024-03-16T14:05:00Z", "data": { "id": "lead_5xPqR8mNwK", "email": "zhang.wei@example.com", "status": "qualified", "previous_status": "contacted", "updated_at": "2024-03-16T14:05:00Z" } }
建议在处理 Webhook 时,将 id 字段(事件唯一ID)存入数据库,实现幂等处理,防止网络重试导致重复执行业务逻辑。