> For the complete documentation index, see [llms.txt](https://docs.maiagent.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.maiagent.ai/build/conversation-settings/human-handoff/handoff-notification.md).

# 轉真人客服通知

對話被指派給真人客服時，以通知中心、Email 提醒內部人員；並在轉真人觸發、指派、轉回 AI 與排隊逾時時，以 Webhook 通知外部系統

當一筆對話從 AI 轉給真人並**指派給客服專員**時，MaiAgent 可透過 <mark style="color:blue;">Email</mark>、<mark style="color:blue;">通知中心</mark>與 <mark style="color:blue;">Webhook 通知（系統串接）</mark>送出通知。前兩個通道提醒專員與主管；Webhook 則讓派工、告警或 CRM 等外部系統接續處理，並在 AI 判定轉真人、對話轉回 AI 與排隊逾時時也送出事件，讓自帶真人客服的外部系統能完整接手。

{% hint style="info" %}
**方案導覽**：本頁是對話平台設定的其中一步，文字客服的完整上線流程見 [文字客服：從零到上線](/serve/text-service.md)。
{% endhint %}

{% hint style="info" %}
本功能屬於「**客服轉真人設定**」的一部分。只有在該對話平台已<mark style="color:blue;">啟用真人客服轉接</mark>後，通知才會發送。
{% endhint %}

## 什麼情況下會發出通知？ <a href="#when-notified" id="when-notified"></a>

通知包含三個可分別開關的管道：**Email 與通知中心**在對話被指派給某位專員（Human Assigned）時發送；**Webhook**則涵蓋下列四個轉真人生命週期事件：

* **Email 通知**：寄給被指派的專員；副本通知對象（例如主管）也會一併收到副本（同一封信，所有收件人互相可見）。
* **通知中心公告**：在後台右上角的鈴鐺（通知中心）對被指派人與副本通知對象發出一則「轉真人通知」公告，內含前往該對話的連結。
* **Webhook 通知（系統串接）**：向管理者設定的 HTTPS 網址送出轉真人生命週期的 JSON 事件，供外部系統自動開單、接手或告警：AI 判定轉真人時 `handoff.requested`、對話指派給專員時 `handoff.assigned`、專員按下<mark style="color:blue;">轉回 AI Agent</mark>把對話交回 AI 時 `handoff.returned_to_ai`、排隊逾時自動轉回 AI 時 `handoff.queue_timeout`。四個事件對應對話時間軸上的「觸發轉接」「真人客服接手」「轉回 AI Agent」「排隊逾時」。

{% hint style="warning" %}
**Email 與通知中心**只在對話「**被指派**」時發出通知。若對話已進入轉真人佇列但**尚未指派**給特定專員，這兩個管道不會發送通知；已啟用的 **Webhook** 仍會在 AI 判定轉真人時送出 `handoff.requested`。
{% endhint %}

### 通知不會做的事 <a href="#what-it-does-not-do" id="what-it-does-not-do"></a>

* 點擊 Email 或公告中的連結，只會**開啟該對話**，**不會**自動把對話切換成真人回應模式。專員進入對話後，仍需自行按下對話上方的<mark style="color:blue;">我來接手</mark>鈕，才會停止 AI 自動回覆、由真人接手。
* 通知不會發給客戶；這是純粹**對內部人員**的提醒，客戶端看到的轉真人訊息不受影響。
* Webhook 只傳送事件所需的識別資訊與後台對話連結，不包含對話文字，也不提供特定第三方系統的專屬轉換器。

## 使用情境 <a href="#scenario" id="scenario"></a>

客服主管希望每次轉真人都自動進入公司的派工系統，而不是靠人盯著公告或 Email。她開啟該對話平台的<mark style="color:blue;">客服轉真人設定</mark>，在<mark style="color:blue;">通知</mark>分頁打開 <mark style="color:blue;">Webhook 通知（系統串接）</mark>、填入公司派工系統的 HTTPS 接收網址並儲存。下一次有對話被指派給專員時，派工系統立刻收到 `handoff.assigned` 事件並自動建立工單；專員處理完按下「轉回 AI Agent」後，派工系統再收到 `handoff.returned_to_ai`，把工單自動關閉。整個流程不需要主管手動轉貼任何資訊。

## 如何設定通知 <a href="#setup" id="setup"></a>

{% stepper %}
{% step %}

### 進入通知設定 <a href="#enter-settings" id="enter-settings"></a>

1. 前往<mark style="color:blue;">客服對話</mark> → <mark style="color:blue;">對話平台</mark>，在要設定的對話平台按<mark style="color:blue;">編輯</mark>。
2. 在左側設定選單的「進階功能」點選<mark style="color:blue;">客服轉真人設定</mark>，先確認上方的<mark style="color:blue;">啟用真人客服轉接</mark>已開啟。
3. 點選子分頁<mark style="color:blue;">通知</mark>。

{% hint style="info" %}
若尚未啟用轉真人，左側選單的<mark style="color:blue;">客服轉真人設定</mark>會標示「未設定」，頁面只顯示<mark style="color:blue;">啟用真人客服轉接</mark>開關，<mark style="color:blue;">通知</mark>等子分頁不會出現——請先開啟真人客服轉接並儲存，再進行下列設定。
{% endhint %}
{% endstep %}

{% step %}

### 選擇通知管道 <a href="#channels" id="channels"></a>

通知分頁提供三個彼此獨立的開關，可依需求個別開啟或關閉：

* <mark style="color:blue;">通知中心公告</mark>：對話指派時，在通知中心對被指派人與副本通知對象發出公告。
* <mark style="color:blue;">Email 通知</mark>：對話指派時，寄送 Email 給被指派人，並寄送副本通知給指定對象。
* <mark style="color:blue;">Webhook 通知（系統串接）</mark>：AI 判定轉真人、對話指派、轉回 AI 與排隊逾時時，將事件送往指定的外部系統。**預設關閉**，需要串接時再開啟。

只關閉其中一個管道時，其他已啟用的管道仍會照常發送。

<figure><img src="https://1593648278-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmzb5NG9GDzFP2YDKeYVl%2Fuploads%2Fgit-blob-9bfb10b279b20accd92ea73ee04f8236a1948139%2Fhandoff-notification-channels.png?alt=media" alt="轉真人設定的通知子分頁"><figcaption><p>客服轉真人設定 →「通知」子分頁：三個通道開關、副本通知對象與通知範本</p></figcaption></figure>
{% endstep %}

{% step %}

### 設定 Webhook（選填） <a href="#webhook" id="webhook"></a>

1. 開啟<mark style="color:blue;">Webhook 通知（系統串接）</mark>，下方會展開 Webhook 欄位。
2. 在<mark style="color:blue;">Webhook 網址</mark>填入外部系統的接收網址。網址必須以 `https://` 開頭；留空會顯示「啟用 Webhook 時必須填寫 Webhook 網址」、填入 `http://` 會顯示「Webhook 網址必須使用 HTTPS」，兩種情況都無法儲存。
3. 若接收端需要驗證事件來源，可在<mark style="color:blue;">簽章密鑰（選填）</mark>填入雙方約定的密鑰。啟用簽章後，每次推送都會帶上 `X-MaiAgent-Signature-256` 標頭。

<figure><img src="https://1593648278-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmzb5NG9GDzFP2YDKeYVl%2Fuploads%2Fgit-blob-3badb22c7c48cd5e0a21af1a1acde0bae07922e0%2Fhandoff-notification-webhook.png?alt=media" alt="開啟 Webhook 通知後的網址與簽章密鑰欄位"><figcaption><p>開啟 Webhook 通知（系統串接）後展開的「Webhook 網址」與「簽章密鑰（選填）」欄位</p></figcaption></figure>

**密鑰的後續管理**：

* 密鑰儲存後**不會再次顯示**，欄位會改為提示「已設定——留空表示維持不變」。要換新密鑰就直接輸入新值再儲存；留空則保留原本的密鑰。
* 要停止簽章，按欄位旁的<mark style="color:blue;">清除密鑰</mark>並確認。清除後推送不再帶簽章標頭；若接收端正在驗章，會開始拒收，請先調整接收端再清除。

{% hint style="info" %}
事件的欄位格式、簽章驗證方式與重試行為，請串接人員參考 API 文件的[轉真人 Webhook 事件](https://docs.maiagent.ai/api/preparation/handoff-webhook)。若真人客服要在你自己的客服系統接手回覆，同一頁的「轉真人後由外部系統接手對話」說明如何搭配對話平台的<mark style="color:blue;">Webhook</mark>（訊息收送）與訊息 API 完成雙向同步。
{% endhint %}

{% hint style="warning" %}
接收端應確認只有適當人員能查看事件中的識別資訊與後台對話連結。若不再使用此串接，請關閉 Webhook 通知。
{% endhint %}
{% endstep %}

{% step %}

### 設定副本通知對象（選填） <a href="#copy-recipients" id="copy-recipients"></a>

若希望主管或其他人一同掌握轉真人狀況，可設定副本通知對象：

* <mark style="color:blue;">寄送副本通知（成員）</mark>：選擇要寄送副本通知的成員（例如主管）。
* <mark style="color:blue;">寄送副本通知（群組）</mark>：選擇要寄送副本通知的群組；群組會自動展開為其中的所有成員。

被指派的專員本人會自動排除在副本通知對象之外（不會重複收到副本）。
{% endstep %}

{% step %}

### 自訂通知範本（選填） <a href="#templates" id="templates"></a>

四個範本欄位可自訂通知的文字內容，開啟轉真人時會帶入預設範本：

* <mark style="color:blue;">公告標題範本</mark>
* <mark style="color:blue;">公告內容範本</mark>
* <mark style="color:blue;">Email 主旨範本</mark>
* <mark style="color:blue;">Email 內文範本</mark>

範本中可使用以下**變數**，發送時會自動代換成該筆對話的實際內容：

| 變數                  | 代換內容       |
| ------------------- | ---------- |
| `{agentName}`       | 被指派的客服專員名稱 |
| `{inboxName}`       | 對話平台（客服）名稱 |
| `{customerName}`    | 客戶（來訪者）名稱  |
| `{conversationUrl}` | 前往該對話的連結   |

<figure><img src="https://1593648278-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmzb5NG9GDzFP2YDKeYVl%2Fuploads%2Fgit-blob-e8a5d6b0e7eb74e9dfcd8ec9e386fd2fe9fbe5a8%2Fhandoff-notification-templates.png?alt=media" alt="通知範本編輯"><figcaption><p>四個範本欄位與可用變數提示</p></figcaption></figure>

<details>

<summary>預設範本內容參考</summary>

**Email 主旨範本**

```
【轉真人】對話已指派給您 — {inboxName}
```

**Email 內文範本**

```
您好 {agentName}，

客服「{inboxName}」有一筆來自 {customerName} 的對話已指派給您。
請點擊以下連結進入後台對話：
{conversationUrl}
```

**公告標題範本**

```
對話已指派：{customerName}
```

**公告內容範本**

```
客服「{inboxName}」有一筆來自 {customerName} 的對話已指派給 {agentName}，請進入後台確認。
```

</details>
{% endstep %}

{% step %}

### 儲存設定 <a href="#save" id="save"></a>

完成後儲存，設定即刻生效。之後系統會依各管道的開關與事件範圍發送通知：Email 與通知中心僅在指派時發送，Webhook 則在 AI 判定轉真人、指派、轉回 AI 與排隊逾時時發送。

{% hint style="info" %}
關閉<mark style="color:blue;">啟用真人客服轉接</mark>時，通知會一併停止發送，但通知設定會**保留**；再次開啟轉真人即可恢復原本的設定。
{% endhint %}
{% endstep %}
{% endstepper %}

## 專員與主管會收到什麼 <a href="#what-recipients-see" id="what-recipients-see"></a>

### Email 通知 <a href="#email" id="email"></a>

被指派的專員會收到一封 MaiAgent 品牌樣式的 Email，主旨與內文依範本產生，內含前往該對話的連結。設定的副本通知對象會以**副本**收到同一封信（所有收件人互相可見）。

### 通知中心公告 <a href="#notification-center" id="notification-center"></a>

在後台右上角點開鈴鐺開啟<mark style="color:blue;">通知中心</mark>，切換到<mark style="color:blue;">組織公告</mark>分頁，即可看到類型為<mark style="color:blue;">轉真人通知</mark>的公告。點擊公告中的<mark style="color:blue;">前往接手</mark>，即可直接開啟該對話。通知中心的完整說明見 [通知中心](/start/notifications.md)。

{% hint style="info" %}
轉真人通知屬於高頻的交易型事件，為避免灌爆公告列表，這類公告會在發出後 **7 天自動過期**。
{% endhint %}

### 外部系統會收到什麼 <a href="#what-webhook-receives" id="what-webhook-receives"></a>

外部系統會收到一筆 JSON 事件，內容只有識別資訊：事件名稱、事件識別碼與發生時間、對話、對話平台、組織、客戶與該事件當下被指派專員的識別碼，以及前往後台對話的連結；不含任何對話文字。四種事件欄位相同，沒有指派專員的事件（轉真人觸發、轉回 AI、排隊逾時）被指派專員為空。詳細欄位與驗證範例見 API 文件的[轉真人 Webhook 事件](https://docs.maiagent.ai/api/preparation/handoff-webhook)。

## 注意事項 <a href="#notes" id="notes"></a>

* **權限**：僅具備該對話平台設定權限的人員可檢視與編輯通知設定；沿用既有的轉真人設定權限。
* **專員沒有 Email**：若被指派的專員沒有設定 Email，系統會自動略過 Email 通道，但**通知中心公告仍會照常發送**，不影響其他收件人。
* **通道彼此獨立**：Email、通知中心與 Webhook 各自運作，其中一個發送失敗不會影響其他通道，也不會影響對話的指派流程。
* **Webhook 失敗處理**：外部端點逾時或回傳錯誤時，系統會在背景自動重試三次；這段期間轉真人與其他通知通道仍照常運作。接收端請以事件識別碼去除重複事件。
* **與對話平台的「Webhook」不同**：對話平台另有一個 [Webhook](/build/conversation-settings/webhook.md) 功能負責傳送對話訊息本身；轉真人 Webhook 只送轉真人狀態事件，兩者設定與密鑰各自獨立，互不影響。
* **進入對話後仍需接手**：如前述，連結只會導向對話本身，實際接手仍以對話上方的<mark style="color:blue;">我來接手</mark>鈕為準。


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.maiagent.ai/build/conversation-settings/human-handoff/handoff-notification.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
