TIL: Testing Webhooks With curl
Webhook providers send JSON to your endpoint. You can simulate that with curl.
curl -X POST http://localhost:3000/webhook -H 'Content-Type: application/json' -d '{
event: call.completed,
call_id: ABC123,
duration: 42
}'
Replace the URL, the headers, and the body. Run it. See what your server returns.
I kept a file of webhook payloads for every Vonage API event. Incoming call, SMS received, delivery receipt, transcription ready. When I added a new feature I ran the relevant payload against my local server. No need to trigger the real event.
How do I test the response timing?
curl -w 'Total: %{time_total}s\n' -X POST http://localhost:3000/webhook -H 'Content-Type: application/json' -d '{event: ping}'
What if the webhook requires a signature?
Extract the signing secret from the provider’s dashboard and compute the signature header in your curl command, or disable signature validation during local development.