Skip to content

Commit 4c0d67b

Browse files
authored
Merge branch 'main' into vap3-957-blog-update
2 parents 671e157 + 8935346 commit 4c0d67b

File tree

8 files changed

+1628
-1312
lines changed

8 files changed

+1628
-1312
lines changed

fern/apis/api/openapi.json

Lines changed: 1486 additions & 1252 deletions
Large diffs are not rendered by default.

fern/cli/mcp-integration.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -383,11 +383,11 @@ This project uses Vapi MCP for enhanced IDE support:
383383

384384
## Next steps
385385

386-
With MCP configured:
386+
Now that MCP is configured:
387387

388-
- **[Initialize a project](/cli/init):** Add Vapi to your codebase
389-
- **[Test webhooks locally](/cli/webhook):** Debug without external tunnels
390-
- **[Explore API Reference](/api-reference):** See what your IDE now knows
388+
- **[Create assistants](/quickstart/phone):** Build your first voice AI
389+
- **[Test webhooks locally](/cli/webhook):** Debug webhooks with tunneling services
390+
- **[Manage resources](/cli/overview#common-commands):** Use CLI commands
391391

392392
---
393393

fern/cli/overview.mdx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,13 +97,15 @@ Your IDE's AI assistant (Cursor, Windsurf, VSCode) gains complete, accurate know
9797
Forward webhooks to your local server for debugging:
9898

9999
```bash
100+
# Terminal 1: Create tunnel (e.g., with ngrok)
101+
ngrok http 4242
102+
103+
# Terminal 2: Forward webhooks
100104
vapi listen --forward-to localhost:3000/webhook
101105
```
102106

103-
The CLI provides a public endpoint that forwards events to your local server. You'll need to update your webhook URLs in Vapi to point to this endpoint.
104-
105107
<Note>
106-
Automatic webhook URL configuration (like Stripe CLI) is coming soon. For now, manually update your webhook URLs in the Vapi dashboard.
108+
**Important:** `vapi listen` is a local forwarder only - it does NOT provide a public URL. You need a separate tunneling service (like ngrok) to expose the CLI's port to the internet. Update your webhook URLs in Vapi to use the tunnel's public URL.
107109
</Note>
108110

109111
### 🔐 Multi-account management
@@ -241,7 +243,7 @@ Now that you have the Vapi CLI installed:
241243

242244
- **[Initialize a project](/cli/init):** Add Vapi to your existing codebase
243245
- **[Set up MCP](/cli/mcp):** Enhance your IDE with Vapi intelligence
244-
- **[Test webhooks locally](/cli/webhook):** Debug without external tunnels
246+
- **[Test webhooks locally](/cli/webhook):** Debug webhooks with tunneling services
245247
- **[Manage authentication](/cli/auth):** Work with multiple accounts
246248

247249
---

fern/cli/webhook-testing.mdx

Lines changed: 102 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -6,60 +6,78 @@ slug: cli/webhook
66

77
## Overview
88

9-
The `vapi listen` command provides a webhook forwarding service that receives events from Vapi and forwards them to your local development server. This helps you debug webhook integrations without deploying your code.
9+
The `vapi listen` command provides a local webhook forwarding service that receives events and forwards them to your local development server. This helps you debug webhook integrations during development.
10+
11+
**Important:** `vapi listen` does NOT provide a public URL or tunnel. You'll need to use a separate tunneling solution like ngrok to expose your local server to the internet.
1012

1113
**In this guide, you'll learn to:**
12-
- Set up local webhook forwarding
14+
- Set up local webhook forwarding with a tunneling service
1315
- Debug webhook events in real-time
1416
- Configure advanced forwarding options
1517
- Handle different webhook types
1618

17-
<Info>
18-
**Note on tunneling:** Currently, `vapi listen` requires you to manually update your webhook URLs in Vapi. Automatic tunnel creation (like Stripe CLI) is coming in a future update.
19-
</Info>
19+
<Warning>
20+
**No automatic tunneling:** The `vapi listen` command is a local forwarder only. It does not create a public URL or tunnel to the internet. You must use a separate tunneling service (like ngrok) and configure your Vapi webhook URLs manually.
21+
</Warning>
2022

2123
## Quick start
2224

2325
<Steps>
26+
<Step title="Set up a tunnel to your local machine">
27+
Use a tunneling service like ngrok to create a public URL:
28+
```bash
29+
# Example with ngrok
30+
ngrok http 4242 # 4242 is the default port for vapi listen
31+
```
32+
33+
Note the public URL provided by your tunneling service (e.g., `https://abc123.ngrok.io`)
34+
</Step>
35+
2436
<Step title="Start the webhook listener">
2537
```bash
2638
vapi listen --forward-to localhost:3000/webhook
2739
```
2840

29-
Note the public URL provided in the output (e.g., `https://webhook-proxy.vapi.ai/wh_abc123def456`)
41+
This starts a local server on port 4242 that forwards to your application
3042
</Step>
3143

3244
<Step title="Update your webhook URLs">
33-
Go to your Vapi Dashboard and update your webhook URLs to point to the URL from step 1:
34-
- Assistant webhook URL
35-
- Phone number webhook URL
45+
Go to your Vapi Dashboard and update your webhook URLs to point to your tunnel URL:
46+
- Assistant webhook URL: `https://abc123.ngrok.io`
47+
- Phone number webhook URL: `https://abc123.ngrok.io`
3648
- Or any other webhook configuration
3749
</Step>
3850

3951
<Step title="Test your webhooks">
40-
Trigger webhook events (make calls, etc.) and see them forwarded to your local server in real-time
52+
Trigger webhook events (make calls, etc.) and see them forwarded through the tunnel to your local server
4153
</Step>
4254
</Steps>
4355

4456
## How it works
4557

4658
<Note>
47-
**Current implementation:** The `vapi listen` command currently acts as a local webhook forwarder. Unlike tools like Stripe CLI, it doesn't yet create an automatic tunnel to update your Vapi webhook URLs. You'll need to manually configure your webhook URL in Vapi to point to the CLI's endpoint.
59+
**Current implementation:** The `vapi listen` command acts as a local webhook forwarder only. It receives webhook events on a local port (default 4242) and forwards them to your specified endpoint. To receive events from Vapi, you must:
4860

49-
**Coming soon:** Automatic tunneling that updates your Vapi webhook configuration is planned for a future release.
61+
1. Use a tunneling service (ngrok, localtunnel, etc.) to expose port 4242 to the internet
62+
2. Configure your Vapi webhook URLs to point to the tunnel URL
63+
3. The flow is: Vapi → Your tunnel URL → vapi listen (port 4242) → Your local server
5064
</Note>
5165

5266
<Steps>
53-
<Step title="Local server starts">
54-
The CLI starts a webhook server on port 4242 (configurable)
67+
<Step title="Local forwarder starts">
68+
The CLI starts a webhook forwarder on port 4242 (configurable)
69+
</Step>
70+
71+
<Step title="Tunnel exposes the forwarder">
72+
Your tunneling service creates a public URL that routes to port 4242
5573
</Step>
5674

5775
<Step title="Configure webhook URL">
58-
Update your Vapi webhook URL to point to the CLI's public endpoint (provided when you start the listener)
76+
Update your Vapi webhook URL to point to the tunnel's public URL
5977
</Step>
6078

6179
<Step title="Events forwarded">
62-
All webhook events are forwarded to your specified local endpoint
80+
Webhook events flow: Vapi → Tunnel → CLI forwarder → Your local endpoint
6381
</Step>
6482

6583
<Step title="Real-time logging">
@@ -88,6 +106,9 @@ Use a different port for the webhook listener:
88106
```bash
89107
# Listen on port 8080 instead of default 4242
90108
vapi listen --forward-to localhost:3000/webhook --port 8080
109+
110+
# Remember to update your tunnel to use port 8080
111+
ngrok http 8080
91112
```
92113

93114
### Skip TLS verification
@@ -110,20 +131,21 @@ When you run `vapi listen`, you'll see:
110131
$ vapi listen --forward-to localhost:3000/webhook
111132

112133
🎧 Vapi Webhook Listener
113-
📡 Listening on: https://webhook-proxy.vapi.ai/wh_abc123def456
134+
📡 Listening on: http://localhost:4242
114135
📍 Forwarding to: http://localhost:3000/webhook
115136

116-
⚠️ Please update your webhook URL in Vapi to:
117-
https://webhook-proxy.vapi.ai/wh_abc123def456
137+
⚠️ To receive Vapi webhooks:
138+
1. Use a tunneling service (e.g., ngrok http 4242)
139+
2. Update your Vapi webhook URLs to the tunnel URL
118140

119141
Waiting for webhook events...
120142

121-
[2024-01-15 10:30:45] POST /webhook
143+
[2024-01-15 10:30:45] POST /
122144
Event: call-started
123145
Call ID: call_abc123def456
124146
Status: 200 OK (45ms)
125147

126-
[2024-01-15 10:30:52] POST /webhook
148+
[2024-01-15 10:30:52] POST /
127149
Event: speech-update
128150
Transcript: "Hello, how can I help you?"
129151
Status: 200 OK (12ms)
@@ -167,23 +189,56 @@ The listener adds helpful headers to forwarded requests:
167189

168190
```http
169191
X-Forwarded-For: vapi-webhook-listener
170-
X-Original-Host: vapi-webhooks.ngrok.io
192+
X-Original-Host: <your-tunnel-domain>
171193
X-Webhook-Event: call-started
172194
X-Webhook-Timestamp: 1705331445
173195
```
174196

175197
Your server receives the exact webhook payload from Vapi with these additional headers for debugging.
176198

177-
### Manual webhook configuration
178-
179-
Since automatic tunneling isn't available yet, you'll need to:
199+
### Setting up with different tunneling services
180200

181-
1. Start the webhook listener and note the public URL
182-
2. Go to your Vapi Dashboard or use the API to update webhook URLs
183-
3. Set the webhook URL to the one provided by `vapi listen`
201+
<AccordionGroup>
202+
<Accordion title="Using ngrok">
203+
```bash
204+
# Terminal 1: Start ngrok tunnel
205+
ngrok http 4242
206+
207+
# Terminal 2: Start vapi listener
208+
vapi listen --forward-to localhost:3000/webhook
209+
210+
# Use the ngrok URL in Vapi Dashboard
211+
```
212+
</Accordion>
213+
214+
<Accordion title="Using localtunnel">
215+
```bash
216+
# Terminal 1: Install and start localtunnel
217+
npm install -g localtunnel
218+
lt --port 4242
219+
220+
# Terminal 2: Start vapi listener
221+
vapi listen --forward-to localhost:3000/webhook
222+
223+
# Use the localtunnel URL in Vapi Dashboard
224+
```
225+
</Accordion>
226+
227+
<Accordion title="Using cloudflared">
228+
```bash
229+
# Terminal 1: Start cloudflare tunnel
230+
cloudflared tunnel --url http://localhost:4242
231+
232+
# Terminal 2: Start vapi listener
233+
vapi listen --forward-to localhost:3000/webhook
234+
235+
# Use the cloudflare URL in Vapi Dashboard
236+
```
237+
</Accordion>
238+
</AccordionGroup>
184239

185240
<Tip>
186-
**Future enhancement:** We're working on automatic webhook URL updates, similar to how Stripe CLI works. This will eliminate the manual configuration step.
241+
**Pro tip:** Some tunneling services offer static URLs (like ngrok with a paid plan), which means you won't need to update your Vapi webhook configuration every time you restart development.
187242
</Tip>
188243

189244
### Filtering events
@@ -218,22 +273,38 @@ The listener expects standard HTTP responses:
218273
```
219274
</Step>
220275

221-
<Step title="Start webhook listener">
276+
<Step title="Start tunnel to expose port 4242">
222277
```bash
223278
# In terminal 2
279+
ngrok http 4242 # Creates public URL for the CLI listener
280+
# Note the public URL (e.g., https://abc123.ngrok.io)
281+
```
282+
</Step>
283+
284+
<Step title="Start webhook listener">
285+
```bash
286+
# In terminal 3
224287
vapi listen --forward-to localhost:3000/api/vapi/webhook
225288
```
226289
</Step>
227290

291+
<Step title="Configure Vapi webhooks">
292+
Update your Vapi webhook URLs to point to the ngrok URL from step 2
293+
</Step>
294+
228295
<Step title="Make test calls">
229296
Use the Vapi dashboard or API to trigger webhooks
230297
</Step>
231298

232299
<Step title="Debug in real-time">
233-
See events in both terminals and debug your handler
300+
See events in the CLI terminal and debug your handler
234301
</Step>
235302
</Steps>
236303

304+
<Note>
305+
**Data flow:** Vapi sends webhooks → Ngrok tunnel (public URL) → vapi listen (port 4242) → Your local server (port 3000)
306+
</Note>
307+
237308
### Example webhook handler
238309

239310
<CodeBlocks>

fern/debugging.mdx

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -122,17 +122,19 @@ Navigate to `Observe > Webhook Logs` to:
122122

123123
<video autoPlay loop muted src="./static/videos/debugging/webhook-logs.mp4" type="video/mp4" style={{ aspectRatio: '16 / 9', width: '100%' }} />
124124

125-
<Tip>
126-
**Local webhook debugging with Vapi CLI:**
127-
128-
Forward webhooks to your local server:
125+
Use the Vapi CLI to forward webhooks to your local development server:
129126

130127
```bash
128+
# Terminal 1: Create tunnel (e.g., with ngrok)
129+
ngrok http 4242
130+
131+
# Terminal 2: Forward webhooks
131132
vapi listen --forward-to localhost:3000/webhook
132133
```
133134

134-
The CLI provides a public endpoint that forwards events to your local server. You'll need to update your webhook URLs in Vapi to use this endpoint. Automatic configuration is coming soon. [Learn more →](/cli/webhook)
135-
</Tip>
135+
<Note>
136+
`vapi listen` is a local forwarder that requires a separate tunneling service. Update your webhook URLs in Vapi to use the tunnel's public URL. [Learn more →](/cli/webhook)
137+
</Note>
136138

137139
### Voice Test Suites
138140

fern/server-url.mdx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,15 @@ To get started using server URLs, read our guides:
6363
</CardGroup>
6464

6565
<Tip>
66-
**Quick local testing with Vapi CLI:**
66+
**Quick local testing with Vapi CLI + tunneling:**
6767
```bash
68+
# Terminal 1: Create tunnel
69+
ngrok http 4242
70+
71+
# Terminal 2: Start webhook forwarder
6872
vapi listen --forward-to localhost:3000/webhook
6973
```
70-
This instantly forwards all webhook events to your local server for debugging.
74+
This setup forwards webhook events to your local server. Remember to update your Vapi webhook URLs to use the ngrok public URL.
7175
</Tip>
7276

7377
## FAQ

fern/server-url/developing-locally.mdx

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,29 +9,28 @@ slug: server-url/developing-locally
99
<img src="../static/images/server-url/developing-locally/reverse-proxy-developing-locally.png" />
1010
</Frame>
1111

12-
## Quick solution: Vapi CLI
12+
## Quick solution: Vapi CLI + Tunneling
1313

14-
Test webhooks locally with the Vapi CLI webhook forwarder:
14+
Use the Vapi CLI webhook forwarder along with a tunneling service to test webhooks locally:
1515

1616
```bash
17-
# Install Vapi CLI
18-
curl -sSL https://vapi.ai/install.sh | bash
17+
# Terminal 1: Set up tunnel (example with ngrok)
18+
ngrok http 4242
1919

20-
# Start webhook forwarding
20+
# Terminal 2: Install and run Vapi CLI
21+
curl -sSL https://vapi.ai/install.sh | bash
2122
vapi listen --forward-to localhost:3000/webhook
2223
```
2324

24-
The CLI provides a public endpoint that forwards events to your local server. You'll need to manually update your webhook URLs in Vapi to use this endpoint.
25-
2625
<Note>
27-
Unlike tools like Stripe CLI, automatic webhook URL configuration isn't available yet. This feature is coming in a future update. For now, the CLI works similarly to ngrok - providing a public URL that you configure manually.
26+
**Important:** The `vapi listen` command is a local forwarder only - it does NOT provide a public URL or tunnel. You must use a separate tunneling service (like ngrok) to expose the CLI's port (default 4242) to the internet, then configure your Vapi webhook URLs to use the tunnel's public URL.
2827
</Note>
2928

3029
[Learn more about the Vapi CLI →](/cli/webhook)
3130

3231
## Manual setup with ngrok
3332

34-
If you prefer to use ngrok or need more control over the tunneling process, follow the guide below.
33+
If you prefer to skip the CLI and connect ngrok directly to your application, follow the guide below.
3534

3635
## The Problem
3736

fern/tools/custom-tools.mdx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,15 +105,19 @@ vapi tool test <tool-id>
105105
vapi tool delete <tool-id>
106106
```
107107

108-
<Tip>
109-
**Local development tip:** When developing custom tools, use the Vapi CLI to forward webhooks to your local server:
108+
Use the Vapi CLI to forward tool calls to your local server:
110109

111110
```bash
111+
# Terminal 1: Create tunnel (e.g., with ngrok)
112+
ngrok http 4242
113+
114+
# Terminal 2: Forward events
112115
vapi listen --forward-to localhost:3000/tools/webhook
113116
```
114117

115-
The CLI provides a public endpoint that you can configure as your tool's server URL for testing. Automatic URL configuration is coming soon. [Learn more →](/cli/webhook)
116-
</Tip>
118+
<Note>
119+
`vapi listen` is a local forwarder that requires a separate tunneling service. Configure your tool's server URL to use the tunnel's public URL for testing. [Learn more →](/cli/webhook)
120+
</Note>
117121

118122
## Alternative: API Configuration
119123

0 commit comments

Comments
 (0)