← Thomas R. Christian — portfolio

How to point a Twilio phone number at a Cloudflare Worker webhook

HOW-TO GUIDEv1.0reviewedOwner: Thomas ChristianUpdated 2026-07-30Verified 2026-07-30

Connect an incoming Twilio number to a Cloudflare Worker's voice webhook, verify the wiring end to end, and get past the trial-account traps.

Overview

When a Twilio number receives a call, Twilio sends an HTTP request to whatever URL the number's Voice Configuration points at. This guide wires that webhook to a deployed Cloudflare Worker, verifies the connection with a live call, and covers the failure modes that cost the most debugging time — including two trial-account behaviors that fail silently.

Prerequisites

Steps

  1. Confirm the Worker is reachable before touching Twilio:
curl https://<worker-url>/health

You should see: your health route's response (for example ok resbit-telephony). If this fails, fix the deployment first — nothing in Twilio will work around a dead Worker.

  1. In the Twilio Console, open Phone Numbers → Manage → Active Numbers and click the number.

  2. On the Configure tab, find Voice Configuration → "A call comes in". Set the first dropdown to Webhook, the URL to https://<worker-url>/voice, and the HTTP dropdown to HTTP POST.

  3. Click Save configuration at the bottom of the page.

  4. Verify the save by hard-reloading the configuration page and reading the field back — trust the reloaded value, not the save toast. Console saves occasionally fail to land.

  5. If your Worker validates Twilio request signatures against a configured public URL (recommended), confirm that variable exactly matches the deployed URL — same host, same scheme, no trailing slash — then redeploy if you changed it:

npx wrangler deploy

Verify it worked

Tail the Worker and place a real call to the number:

npx wrangler tail <worker-name>

You should see: a POST /voice request with status 200 the moment the call connects, and your Worker's call behavior on the phone. That pair — log line plus live behavior — is the end-to-end proof.

Troubleshooting

Symptom Cause Fix
No request in the tail when calling Webhook still pointed at the old URL, or save never landed Redo steps 3–5; verify by reload
Every request logs 403 Signature validation URL mismatch (often a trailing slash) Make the Worker's public-URL setting match the deployed URL exactly; redeploy
Requests log 405 Number configured with HTTP GET Set the HTTP dropdown to POST and save
Buying a second number fails with no error Trial accounts allow one number; the buy fails silently Release the existing number (its Properties tab — repurchasable for 10 days) or upgrade the account
"That number is not available" at purchase Stale search inventory Re-run the search and pick a fresh result
A spoken preamble plays before calls connect Trial-account behavior Upgrade the account to remove it
Outbound calls or SMS never arrive Trial accounts only reach verified numbers Verify the destination number, or upgrade

Related

Resbit Telephony Worker — Webhook API Reference documents the full webhook surface this guide connects. Runbook: Resbit family number — calls not connecting or not logging covers diagnosis after go-live.