logo文档
搜索

webhook回调事件

对话创建

当用户通过调用API创建新对话成功时,API通道配置的webhook地址将接收对话创建回调事件。

{ "account": { "id": 17629000001207, "name": "1112" }, "additional_attributes": {}, "can_reply": true, "channel": "Channel::Api", "contact_inbox": { "id": 42213404, "contact_id": 42218348, "inbox_id": 523, "source_id": "1d484823-da29-4086-a7ba-d65ad0ebb588", "created_at": "2026-01-21T03:26:49.012Z", "updated_at": "2026-01-21T03:26:49.012Z", "hmac_verified": false, "pubsub_token": "4Urn7N5A974k6C2H7Xeva8Ni" }, "id": 89, "inbox_id": 523, "messages": [], "labels": [], "meta": { "sender": { "additional_attributes": {}, "custom_attributes": {}, "email": "alice@acme.inc", "id": 42218348, "identifier": null, "name": "Test", "phone_number": "+123456789", "thumbnail": "", "blocked": false, "type": "contact" }, "assignee": null, "team": null, "hmac_verified": false, "channel": "Channel::Api" }, "status": "open", "custom_attributes": {}, "snoozed_until": null, "unread_count": 0, "first_reply_created_at": null, "priority": null, "waiting_since": 1768967324, "conversation_category": "chat", "chat_mode": "private_chat", "ticket_info": null, "agent_last_seen_at": 0, "contact_last_seen_at": 0, "last_activity_at": 1768967324, "timestamp": 1768967324, "created_at": 1768967324, "updated_at": 1768967324.268219, "event": "conversation_created" }
              
              {
  "account": {
    "id": 17629000001207,
    "name": "1112"
  },
  "additional_attributes": {},
  "can_reply": true,
  "channel": "Channel::Api",
  "contact_inbox": {
    "id": 42213404,
    "contact_id": 42218348,
    "inbox_id": 523,
    "source_id": "1d484823-da29-4086-a7ba-d65ad0ebb588",
    "created_at": "2026-01-21T03:26:49.012Z",
    "updated_at": "2026-01-21T03:26:49.012Z",
    "hmac_verified": false,
    "pubsub_token": "4Urn7N5A974k6C2H7Xeva8Ni"
  },
  "id": 89,
  "inbox_id": 523,
  "messages": [],
  "labels": [],
  "meta": {
    "sender": {
      "additional_attributes": {},
      "custom_attributes": {},
      "email": "alice@acme.inc",
      "id": 42218348,
      "identifier": null,
      "name": "Test",
      "phone_number": "+123456789",
      "thumbnail": "",
      "blocked": false,
      "type": "contact"
    },
    "assignee": null,
    "team": null,
    "hmac_verified": false,
    "channel": "Channel::Api"
  },
  "status": "open",
  "custom_attributes": {},
  "snoozed_until": null,
  "unread_count": 0,
  "first_reply_created_at": null,
  "priority": null,
  "waiting_since": 1768967324,
  "conversation_category": "chat",
  "chat_mode": "private_chat",
  "ticket_info": null,
  "agent_last_seen_at": 0,
  "contact_last_seen_at": 0,
  "last_activity_at": 1768967324,
  "timestamp": 1768967324,
  "created_at": 1768967324,
  "updated_at": 1768967324.268219,
  "event": "conversation_created"
}

            
此代码块在浮窗中显示

对话创建事件参数表

字段 类型 必填 描述
account Object 账号项目信息
id Number 项目ID
name String 项目名称
additional_attributes Object 附加属性
can_reply Boolean 是否可以回复
channel String 通道类型,例如api,email等
contact_inbox Object 联系人信息
id Number contact_inbox表id,记录联系人与通道的关系
contact_id Number 联系人ID
inbox_id Number 通道id
source_id String 对话来源ID,比如Telegram的user_id
created_at String 创建时间
updated_at String 更新时间
hmac_verified Boolean HMAC验证状态
pubsub_token String 发布订阅令牌
id Number 对话ID
inbox_id Number 通道ID
messages Array 消息列表
labels Array 标签列表
meta Object 元信息
sender Object 发送者信息
additional_attributes Object 发送者附加属性
custom_attributes Object 发送者自定义属性
email String 发送者邮箱
id Number 发送者在liveDesk的内部ID
identifier String 发送者标识符
name String 发送者名称
phone_number String 发送者电话号码
thumbnail String 发送者头像
blocked Boolean 发送者是否被锁定
type String 发送者类型
assignee Object 分配客服代理信息
team Object 分配客服团队信息
hmac_verified Boolean HMAC验证状态
channel String 通道类型
status String 对话状态,比如open,closed等
custom_attributes Object 自定义属性
snoozed_until String 暂停直到某个时间点为止
unread_count Number 未读消息数
first_reply_created_at String 首次回复创建时间
priority String 优先级
waiting_since Number 等待开始时间
conversation_category String 对话类别
chat_mode String 聊天模式
ticket_info Object 工单信息
agent_last_seen_at Number 客服最后查看时间
contact_last_seen_at Number 联系人最后查看时间
last_activity_at Number 最后活动时间
timestamp Number 时间戳
created_at Number 创建时间
updated_at Number 更新时间
event String 事件类型

对话更新

当对话中的任何属性更新时,将触发该事件。

{ "event": "conversation_updated", "changed_attributes": [ { "updated_at": { "previous_value": "2026-01-21T04:04:56.548Z", "current_value": "2026-01-21T04:04:56.601Z" } }, { "first_reply_created_at": { "previous_value": null, "current_value": "2026-01-21T04:04:56.544Z" } }, { "waiting_since": { "previous_value": "2026-01-21T03:48:44.268Z", "current_value": null } } ] // <...Conversation Attributes> 对话属性内容 }
              
              {
  "event": "conversation_updated",
  "changed_attributes": [
    {
      "updated_at": {
        "previous_value": "2026-01-21T04:04:56.548Z",
        "current_value": "2026-01-21T04:04:56.601Z"
      }
    },
    {
      "first_reply_created_at": {
        "previous_value": null,
        "current_value": "2026-01-21T04:04:56.544Z"
      }
    },
    {
      "waiting_since": {
        "previous_value": "2026-01-21T03:48:44.268Z",
        "current_value": null
      }
    }
  ]
  // <...Conversation Attributes> 对话属性内容
}

            
此代码块在浮窗中显示

对话更新事件参数

字段 类型 必填 描述
event String 事件类型
changed_attributes Array 变更属性列表
field_name Object 变更的字段名称
previous_value string 变更前的值
current_value string 变更后的值

对话状态变更

当对话状态发生变化时,将触发此事件。

{ "event": "conversation_status_changed" // <...Conversation Attributes> 对话属性内容 }
              
              {
  "event": "conversation_status_changed"
  // <...Conversation Attributes> 对话属性内容
}

            
此代码块在浮窗中显示

消息创建

当用户或者客服发送消息,将触发该事件。

{ "account": { "id": 17629000001207, "name": "1112" }, "additional_attributes": {}, "content_attributes": {}, "content_type": "text", "content": "你好请问有什么问题", "conversation": { "account": { "id": 17629000001207, "name": "1112" }, "additional_attributes": {}, "can_reply": true, "channel": "Channel::Api", "contact_inbox": { "id": 42213404, "contact_id": 42218348, "inbox_id": 523, "source_id": "1d484823-da29-4086-a7ba-d65ad0ebb588", "created_at": "2026-01-21T03:26:49.012Z", "updated_at": "2026-01-21T03:26:49.012Z", "hmac_verified": false, "pubsub_token": "4Urn7N5A974k6C2H7Xeva8Ni" }, "id": 89, "inbox_id": 523, "messages": [ { "id": 2187685, "content": "你好请问有什么问题", "account_id": 17629000001207, "inbox_id": 523, "conversation_id": 89, "message_type": 1, "created_at": 1768968296, "updated_at": "2026-01-21T04:04:56.544Z", "private": false, "status": "sent", "source_id": null, "content_type": "text", "content_attributes": {}, "sender_type": "User", "sender_id": 41, "external_source_ids": {}, "additional_attributes": {}, "processed_message_content": "你好请问有什么问题", "sentiment": {}, "sorting_id": null, "original_message_id": null, "conversation_topic_id": null, "topic_id": null, "conversation": { "assignee_id": null, "unread_count": 0, "last_activity_at": 1768968296, "contact_inbox": { "source_id": "1d484823-da29-4086-a7ba-d65ad0ebb588" } }, "sender": { "id": 41, "name": "support", "available_name": "support", "avatar_url": "", "type": "user", "availability_status": null, "thumbnail": "" } } ], "labels": [], "meta": { "sender": { "additional_attributes": {}, "custom_attributes": {}, "email": "alice@acme.inc", "id": 42218348, "identifier": null, "name": "Test", "phone_number": "+123456789", "thumbnail": "", "blocked": false, "type": "contact" }, "assignee": null, "team": null, "hmac_verified": false, "channel": "Channel::Api" }, "status": "open", "custom_attributes": {}, "snoozed_until": null, "unread_count": 0, "first_reply_created_at": null, "priority": null, "waiting_since": 1768967324, "conversation_category": "chat", "chat_mode": "private_chat", "ticket_info": null, "agent_last_seen_at": 0, "contact_last_seen_at": 0, "last_activity_at": 1768968296, "timestamp": 1768968296, "created_at": 1768967324, "updated_at": 1768968296.5483441 }, "created_at": "2026-01-21T04:04:56.544Z", "id": 2187685, "inbox": { "id": 523, "name": "Test01" }, "message_type": "outgoing", "conversation_topic_id": null, "private": false, "sender": { "id": 41, "name": "support", "email": "support@jiguang.cn", "type": "user", "availability": "online" }, "source_id": null, "user_id": 42213404, "contact_id": 42218348, "participants": null, "event": "message_created" }
              
              {
  "account": {
    "id": 17629000001207,
    "name": "1112"
  },
  "additional_attributes": {},
  "content_attributes": {},
  "content_type": "text",
  "content": "你好请问有什么问题",
  "conversation": {
    "account": {
      "id": 17629000001207,
      "name": "1112"
    },
    "additional_attributes": {},
    "can_reply": true,
    "channel": "Channel::Api",
    "contact_inbox": {
      "id": 42213404,
      "contact_id": 42218348,
      "inbox_id": 523,
      "source_id": "1d484823-da29-4086-a7ba-d65ad0ebb588",
      "created_at": "2026-01-21T03:26:49.012Z",
      "updated_at": "2026-01-21T03:26:49.012Z",
      "hmac_verified": false,
      "pubsub_token": "4Urn7N5A974k6C2H7Xeva8Ni"
    },
    "id": 89,
    "inbox_id": 523,
    "messages": [
      {
        "id": 2187685,
        "content": "你好请问有什么问题",
        "account_id": 17629000001207,
        "inbox_id": 523,
        "conversation_id": 89,
        "message_type": 1,
        "created_at": 1768968296,
        "updated_at": "2026-01-21T04:04:56.544Z",
        "private": false,
        "status": "sent",
        "source_id": null,
        "content_type": "text",
        "content_attributes": {},
        "sender_type": "User",
        "sender_id": 41,
        "external_source_ids": {},
        "additional_attributes": {},
        "processed_message_content": "你好请问有什么问题",
        "sentiment": {},
        "sorting_id": null,
        "original_message_id": null,
        "conversation_topic_id": null,
        "topic_id": null,
        "conversation": {
          "assignee_id": null,
          "unread_count": 0,
          "last_activity_at": 1768968296,
          "contact_inbox": {
            "source_id": "1d484823-da29-4086-a7ba-d65ad0ebb588"
          }
        },
        "sender": {
          "id": 41,
          "name": "support",
          "available_name": "support",
          "avatar_url": "",
          "type": "user",
          "availability_status": null,
          "thumbnail": ""
        }
      }
    ],
    "labels": [],
    "meta": {
      "sender": {
        "additional_attributes": {},
        "custom_attributes": {},
        "email": "alice@acme.inc",
        "id": 42218348,
        "identifier": null,
        "name": "Test",
        "phone_number": "+123456789",
        "thumbnail": "",
        "blocked": false,
        "type": "contact"
      },
      "assignee": null,
      "team": null,
      "hmac_verified": false,
      "channel": "Channel::Api"
    },
    "status": "open",
    "custom_attributes": {},
    "snoozed_until": null,
    "unread_count": 0,
    "first_reply_created_at": null,
    "priority": null,
    "waiting_since": 1768967324,
    "conversation_category": "chat",
    "chat_mode": "private_chat",
    "ticket_info": null,
    "agent_last_seen_at": 0,
    "contact_last_seen_at": 0,
    "last_activity_at": 1768968296,
    "timestamp": 1768968296,
    "created_at": 1768967324,
    "updated_at": 1768968296.5483441
  },
  "created_at": "2026-01-21T04:04:56.544Z",
  "id": 2187685,
  "inbox": {
    "id": 523,
    "name": "Test01"
  },
  "message_type": "outgoing",
  "conversation_topic_id": null,
  "private": false,
  "sender": {
    "id": 41,
    "name": "support",
    "email": "support@jiguang.cn",
    "type": "user",
    "availability": "online"
  },
  "source_id": null,
  "user_id": 42213404,
  "contact_id": 42218348,
  "participants": null,
  "event": "message_created"
}

            
此代码块在浮窗中显示

消息创建事件参数表

字段 类型 必填 描述
account Object 账户信息
id Number 项目ID
name String 项目名称
additional_attributes Object 附加属性
content_attributes Object 内容属性
content_type String 内容类型
content String 消息内容
conversation Object 对话信息
created_at String 创建时间
id Number 消息ID
inbox Object 通道信息
id Number 通道ID
name String 通道名称
message_type String 消息类型
conversation_topic_id String 对话主题ID
private Boolean 是否私有
sender Object 发送者信息
id Number 发送者ID
name String 发送者名称
email String 发送者邮箱
type String 发送者类型
availability String 发送者可用状态
source_id String 来源ID
participants Object 参与者信息
event String 事件类型

消息更新

当对话中的消息内容更新时,将触发该事件。

{ "event": "message_updated" // <...Message Attributes> 消息属性内容 }
              
              {
  "event": "message_updated"
  // <...Message Attributes> 消息属性内容
}

            
此代码块在浮窗中显示
icon
联系销售