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










