> ## Documentation Index
> Fetch the complete documentation index at: https://docs.retellai.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Transfer chat to human

> Hand a Retell AI chat agent off to a human: add a Chat Transfer tool or node that notifies your webhook and forwards new messages to a live agent.

Chat Transfer hands a live chat from your agent to a human through your own webhook. When the agent decides to escalate, Retell AI sends a `chat_transfer_requested` event to the webhook URL you configure; if your service accepts it, the agent sends one last handoff message, stops replying, and forwards every later user message to the same webhook so a person can take over.

Chat Transfer is for [chat agents](https://docs.retellai.com/build/create-chat-agent.md) only. It isn't available on voice agents.

## When to use it

Add Chat Transfer when a conversation needs a person and you already have somewhere to route it, such as a helpdesk, a live-chat tool, or your own agent console:

* **Escalate on request** — the user asks for a human, and the agent hands the thread to your support queue.
* **Escalate on limits** — the agent reaches something it can't do (a refund above its cap, an account change it isn't allowed to make) and routes to a live agent.
* **Escalate on sentiment** — a frustrated user gets a person instead of another automated reply.

For example, a billing chat agent answers routine questions on its own. When a user disputes a charge it can't reverse, it calls Chat Transfer: your webhook receives the full chat and opens a ticket in your helpdesk, the agent tells the user a specialist is joining, and the specialist replies in the same thread.

> [!NOTE]
>
> Chat Transfer is the escalation **trigger** — it notifies your system and forwards messages. The human replies back into the chat as a `transfer_target` over the [chat WebSocket](https://docs.retellai.com/deploy/connect-to-chat-websocket.md) or the record-chat-message endpoint. If a human already watches the socket, they can take over without a webhook; use Chat Transfer when the handoff has to reach an external system.

## How it works

1. The agent calls Chat Transfer when the conversation matches the tool's description (single-prompt agents) or reaches the Chat Transfer node (conversation flow agents).
2. Retell AI sends a [`chat_transfer_requested`](#chat-transfer-requested) event to your webhook URL.
3. Your service returns a `2xx` status to accept the handoff, or any other status to reject it.
4. **On accept:** the agent sends the [handoff message](#handoff-message), the chat is marked transferred, and the agent stops generating replies. Every later user message is sent to your webhook as a [`chat_message_forwarded`](#chat-message-forwarded) event.
5. **On reject:** the escalation fails. A single-prompt agent keeps chatting with the failure result; a Chat Transfer node follows its **Escalation failed** edge.

The chat stays open after a transfer — each new message resets the [inactivity timer](https://docs.retellai.com/build/create-chat-agent.md#chat-settings) — until you [end it](https://docs.retellai.com/api-references/end-chat.md) or it times out.

## Set up Chat Transfer

Where you add Chat Transfer depends on the agent type.

**1. Open the agent**

Open a chat agent in the builder.

**2. Add Chat Transfer**

* **Single prompt:** in the agent's functions, add a function and choose **Chat Transfer**.
* **Conversation flow:** drag a **Chat Transfer** node onto the canvas, or add it from the node menu.

Chat Transfer nodes only work in chat agents. Pasting one into a non-chat flow is rejected.

**3. Configure the transfer**

Fill in the [Chat Transfer dialog](#configuration) — at minimum a webhook URL and a handoff message — and save.

### Configuration

The **Chat Transfer** dialog holds these fields. A single-prompt function also sets a name and description; a conversation flow node sets its name on the canvas and has no description.

* **Name** *(function only)* — the function name the agent calls. Letters, numbers, underscores, or dashes, no spaces, up to 64 characters.
* **Description** *(function only)* — tells the LLM when to transfer and how to fill the function fields. Up to 1024 characters. Write a clear rule, such as "Transfer when the user asks for a person or needs an account change you can't make."
* **Handoff Message** — the last message the agent sends after the transfer is accepted. See [Handoff message](#handoff-message).
* **Webhook URL** — the HTTP method (`POST` or `PUT`) and the URL that receives transfer and forwarded-message events. Supports [dynamic variables](https://docs.retellai.com/build/dynamic-variables.md) such as `https://support.example.com/retell/{{customer_id}}`.
* **Timeout** — how long Retell AI waits for your webhook, in seconds. 1 to 600; defaults to 120.
* **Max retries** — how many times to retry a failed webhook call, 0 to 5. Defaults to 0.
* **Headers and query parameters** — optional custom headers and query-string values added to every request, with dynamic variables supported.
* **Function fields** — custom fields the LLM fills from the chat and sends inside the request's `args`, next to `event_type` and `chat`. A field with a **Value** is sent as typed; a field with a **Description** is inferred by the LLM. Use these to pass context your system needs, such as an escalation reason or a customer ID.

### Handoff message

The handoff message is the last thing the agent says before the human takes over, sent only after your webhook accepts the transfer. It's a message to the end user, not a summary for the human agent — the human can read the full chat history.

Choose how it's written:

* **Prompt** — an instruction the LLM follows to write the message, such as "Let the user know a human support agent is joining."
* **Static sentence** — the exact text to send, word for word. Supports dynamic variables.

## Webhook events

Both events are sent to the webhook URL you configured, using the method you chose. Verify each request the same way you verify a [custom function](https://docs.retellai.com/build/add-function-calling) call before trusting it.

### chat\_transfer\_requested

Sent once, when the agent escalates. Return `2xx` to accept the handoff; any other status rejects it.

```json theme={"dark"}
{
  "event_type": "chat_transfer_requested",
  "chat": {
    "chat_id": "chat_a1b2c3",
    "agent_id": "agent_7d9f2e",
    "agent_name": "Billing agent",
    "chat_status": "ongoing",
    "is_escalated": false
  },
  "args": {
    "reason": "Billing dispute the agent can't resolve",
    "customer_id": "cus_8f21a"
  }
}
```

* `chat` — the current chat, including its transcript, so your system has the full context.
* `args` — the [function fields](#configuration) you configured, resolved for this chat.

### chat\_message\_forwarded

Sent for every user message after the transfer is accepted, so the human sees what the user keeps typing. Return `2xx` to confirm receipt; a non-`2xx` response is treated as a delivery failure.

```json theme={"dark"}
{
  "event_type": "chat_message_forwarded",
  "chat_id": "chat_a1b2c3",
  "message": {
    "content": "I'd like to speak to a person please",
    "message_id": "message_9f2e1c7a4b",
    "created_timestamp": 1764460803000
  }
}
```

## Find transferred chats

In [Chat History](https://docs.retellai.com/features/session-history.md), filter by **Chat Transfer** (**Transferred** or **Not transferred**) to see which chats reached a human. The same filter is available in analytics and when you rerun chat analysis. A transferred chat's transcript shows a **Transfer started** (or **Transfer failed**) marker and the human agent's replies.

## FAQ

> [accordion] Can voice agents transfer to a human?
>
> Chat Transfer is chat-only. For voice, use [call transfer](https://docs.retellai.com/build/single-multi-prompt/transfer-call.md) or [agent transfer](https://docs.retellai.com/build/conversation-flow/transfer-agent-node.md).

> [accordion] What happens if my webhook is down or rejects the transfer?
>
> The escalation fails. A single-prompt agent keeps chatting and gets a failure result it can act on; a Chat Transfer node follows its **Escalation failed** edge. Set **Max retries** to retry a transient failure.

> [accordion] Does the agent keep replying after a transfer?
>
> No. Once a transfer is accepted, the agent stops generating replies, and requesting an agent completion on a transferred chat is rejected. From then on the user and the human agent exchange messages in the thread.

> [accordion] How does the human reply to the user?
>
> They record messages into the chat as a `transfer_target`, over the [chat WebSocket](https://docs.retellai.com/deploy/connect-to-chat-websocket.md) or the record-chat-message endpoint. Those replies appear to the user in the same thread.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.