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 | 否 | 通道類型,eg: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 | 否 | 發送者自訂屬性 |
| 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 | 否 | 對話類別,例如ticket、chat |
| 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 | 否 | 發送者名稱 |
| String | 否 | 發送者郵箱 | |
| type | String | 否 | 發送者類型 |
| availability | String | 否 | 發送者可用狀態 |
| source_id | String | 否 | 來源ID |
| participants | Object | 否 | 參與者資訊 |
| event | String | 否 | 事件類型 |
訊息更新
當對話中的訊息內容更新時,將觸發該事件。
{
"event": "message_updated"
// <...Message Attributes> 訊息屬性內容
}
{
"event": "message_updated"
// <...Message Attributes> 訊息屬性內容
}
此代碼塊在浮窗中顯示

