conversation.transferred

The conversation transferred webhook is triggered when a call is successfully transferred to a phone number.

Webhook payload

Here is an example of the POST request JSON payload:

1{
2 "event_type": "conversation.transferred",
3 "data": {
4 "conversation": {
5 "id": "conv_894dcb66-c3dd-4160-8606-30387e8ab9b5",
6 "items": [
7 {
8 "role": "assistant",
9 "text": "Let me transfer you now."
10 },
11 {
12 "role": "user",
13 "text": "Thanks!"
14 }
15 ]
16 },
17 "transferred_to": "+15551234567",
18 "call_info": {
19 "from_phone_number": "+6461234567",
20 "to_phone_number": "+14151234567"
21 }
22 },
23 "created_at": "2025-07-14T11:36:33.767Z"
24}

Payload fields

event_type
stringRequired

Always "conversation.transferred"

created_at
stringRequired

ISO 8601 timestamp of when the event was created

data.conversation.id
stringRequired

Unique conversation identifier

data.conversation.items
ConversationItem[]Required

Array of conversation turns. See the Get Conversation endpoint for the full ConversationItem type.

data.transferred_to
stringRequired

The phone number the call was transferred to, in E.164 format

data.call_info
CallInfo | null

Phone call metadata (present for telephony conversations, null for web). Contains from_phone_number, to_phone_number, and optionally twilio_call_sid.

Example usage

Here’s an example of how to handle the webhook:

1import { Hono } from "hono";
2import { Webhook } from "svix";
3
4const app = new Hono();
5
6app.post("/webhooks/phonic", async (c) => {
7 if (!process.env.PHONIC_WEBHOOK_SECRET) {
8 return c.text("Bad Request", 400);
9 }
10
11 const wh = new Webhook(process.env.PHONIC_WEBHOOK_SECRET);
12 const rawBody = await c.req.text();
13
14 try {
15 const payload = wh.verify(rawBody, {
16 "svix-id": c.req.header("svix-id") ?? "",
17 "svix-timestamp": c.req.header("svix-timestamp") ?? "",
18 "svix-signature": c.req.header("svix-signature") ?? "",
19 }) as ConversationTransferredWebhookPayload;
20
21 const { conversation, transferred_to } = payload.data;
22 console.log(`Conversation ${conversation.id} transferred to ${transferred_to}`);
23
24 return c.text("OK", 200);
25 } catch (error) {
26 console.error("Failed to verify webhook:", error);
27
28 return c.text("Bad Request", 400);
29 }
30});
31
32export default app;