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}

Example usage

Here’s an example of how to handle the webhook in a Hono app:

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 });
20
21 console.log(JSON.stringify(payload, null, 2));
22
23 return c.text("OK", 200);
24 } catch (error) {
25 console.error("Failed to verify webhook:", error);
26
27 return c.text("Bad Request", 400);
28 }
29});
30
31export default app;