Setting up a Twilio SMS or Voice integration usually hits the same speed bump: Twilio needs a public HTTPS URL before it can send you a single event, and you want to see the real form fields and headers before writing half your backend. Spinning up a local tunnel or deploying a temporary server works, until your laptop goes to sleep or you need to test what happens when your endpoint returns an error.
With SnapHook, you can generate a live webhook endpoint in two seconds, inspect Twilio's exact requests in real time, return valid TwiML so Twilio's debugger stays green, and even simulate 500 failures to test your fallback URLs.
Why Twilio Webhooks Need More Than a Plain Request Bin
A Twilio webhook is a two-way conversation: Twilio sends your server an HTTP request (usually a POST with application/x-www-form-urlencoded fields such as From, To, Body, and MessageSid), and for incoming calls or messages, Twilio pauses and waits for valid TwiML (Twilio Markup Language) XML in the response body.
That second part trips up most generic request bins. If a capture endpoint always replies with JSON like {"ok":true}, Twilio logs a content-type or XML parse warning in the Twilio Console Debugger even though the HTTP status was 200 OK. Because SnapHook lets you customize the response status, Content-Type, and body per session, it works cleanly with every Twilio callback type:
- Incoming SMS, MMS, and WhatsApp webhooks: Capture form payloads and reply with TwiML instructions (or an empty
<Response/>). - Voice webhooks: Inspect call state fields (
CallSid,CallStatus,Caller) and return spoken or routing TwiML. - Status callbacks (
StatusCallback): Watch outbound delivery transitions (queued,sent,delivered,failed) as they happen. - Fallback URLs: Return a synthetic
500response on purpose to verify Twilio fails over cleanly.
[Twilio] ── POST /w/<slug>/twilio/sms ──► [SnapHook] ──► Live SSE Dashboard (/app/<slug>)
│
200 OK + TwiML XML
(or 500 to test fallback)
Step 1: Create a SnapHook Endpoint in Two Seconds
You do not need an account, CLI, or SDK to start capturing Twilio events. Pick whichever option fits your workflow:
- In the browser: Open snaphook.site and click Generate free webhook URL. Your live inspector opens immediately at
/app/{slug}, and your target URL (https://snaphook.site/w/{slug}) is ready to copy. - From the terminal: Mint a session directly through the API as shown in the SnapHook Quickstart docs:
curl -s -X POST https://snaphook.site/api/new
{
"expires_at": "2026-11-29T13:30:00Z",
"expires_in_seconds": 7200,
"id": "iszus5e52fbp",
"url": "/app/iszus5e52fbp",
"webhook_url": "https://snaphook.site/w/iszus5e52fbp"
}
Keep the /app/{slug} tab open in your browser. As explained in SnapHook's URL anatomy guide, anything sent to /w/{slug} streams into that tab instantly over Server-Sent Events (SSE), with no polling or page refreshes required.
Step 2: Point Twilio at Distinct Subpaths
One SnapHook URL can capture multiple Twilio callbacks without mixing them together. SnapHook accepts any HTTP method and any subpath under /w/{slug}/..., then strips the session prefix so the inspector displays the clean callback path you configured.
For example, given the base webhook URL https://snaphook.site/w/iszus5e52fbp, you can wire up Twilio like this:
- Incoming Message ("A message comes in"):
https://snaphook.site/w/iszus5e52fbp/twilio/sms(HTTP POST) - Outbound
StatusCallbackURL:https://snaphook.site/w/iszus5e52fbp/twilio/status(HTTP POST) - Incoming Voice Call ("A call comes in"):
https://snaphook.site/w/iszus5e52fbp/twilio/voice(HTTP POST)
In the Twilio Console, open Phone Numbers → Manage → Active numbers, select your test number, and paste the subpath URL into the Messaging or Voice webhook field. You can read more about how Twilio formats these callbacks in the Twilio Webhooks documentation and the Twilio Messaging Webhook Request guide.
Step 3: Return Valid TwiML So Twilio Stays Happy
If you only attach a StatusCallback URL, Twilio ignores the response body as long as it receives an HTTP 200 OK. For incoming SMS or Voice webhooks, however, Twilio expects XML formatted as TwiML.
To configure SnapHook to answer with TwiML instead of its default JSON acknowledgement, open the Response dialog in your SnapHook inspector and click the 200 XML preset (which fills in status 200, Content-Type: application/xml; charset=utf-8, and an empty <Response></Response> body), or update it via the API with application/xml; charset=utf-8 (or text/xml; charset=utf-8) and your TwiML document.
Option A: Acknowledge Silently With an Empty Response
When you want to capture an incoming SMS without texting anything back to the sender, return an empty <Response/>:
SLUG=iszus5e52fbp
curl -X PUT "https://snaphook.site/api/$SLUG/response" \
-H 'Content-Type: application/json' \
-d '{
"status": 200,
"content_type": "application/xml; charset=utf-8",
"body": "<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response/>"
}'
Option B: Reply With an Automated Message
To verify an end-to-end SMS round trip, return a <Message> element as documented in the Twilio Messaging TwiML reference:
curl -X PUT "https://snaphook.site/api/$SLUG/response" \
-H 'Content-Type: application/json' \
-d '{
"status": 200,
"content_type": "application/xml; charset=utf-8",
"body": "<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response><Message>Received by SnapHook!</Message></Response>"
}'
Check your Content-Type header:
Make sure Content-Type is explicitly set to application/xml; charset=utf-8 or text/xml; charset=utf-8 alongside your TwiML body. If a session uses the default application/json; charset=utf-8 response, Twilio's debugger flags an XML parse warning even on HTTP 200 OK.
Step 4: Inspect Real Payloads and Debug X-Twilio-Signature
Send a text message to your Twilio number (or trigger an outbound message with StatusCallback set to your SnapHook URL). Within a second, the request appears in your SnapHook inspector with four sections:
- Metadata: Confirms whether Twilio hit
/twilio/smsor/twilio/status, the HTTP method, sequence ID, and client IP. - Headers: Captures every incoming header verbatim, including
X-Twilio-SignatureandI-Twilio-Idempotency-Token. - Query parameters: Shows any query parameters appended to your callback URL, which Twilio also includes when computing request signatures.
- Body: Displays the raw
application/x-www-form-urlencodedpayload so you can verify exact field names likeMessageSid,AccountSid,From,To,Body, orSmsStatus.
Comparing the captured X-Twilio-Signature, query string, and raw POST parameters against what your own backend receives is one of the fastest ways to diagnose signature-validation bugs (often caused by reverse proxies stripping HTTPS or altering paths before your app validates the request). For implementation details, see Twilio's Securing Webhooks guide and our Webhook Security Primer.
Step 5: Test Fallback URLs Safely
Once the happy path works, test what Twilio does when your server breaks. Because SnapHook records incoming requests before writing the response, you can configure an error status and still inspect every attempt in the inspector.
# Force SnapHook to reply 500 so Twilio triggers your Fallback URL
curl -X PUT "https://snaphook.site/api/$SLUG/response" \
-H 'Content-Type: application/json' \
-d '{"status":500,"content_type":"text/plain","body":"simulated outage"}'
Send another test SMS or call and verify in the Twilio Console Debugger that Twilio logs the 500 error and immediately invokes your configured Primary Handler Fails fallback URL.
When you are done testing failures, click Reset to default in the Response dialog or call DELETE /api/{slug}/response (see the SnapHook FAQ and our guide to webhook retries and backoff for broader resilience patterns).
Limits and Security Hygiene to Keep in Mind
Before wiring up a sandbox or staging integration, check these practical boundaries from SnapHook's limits and security notes:
- Sessions are ephemeral: Endpoints retain up to 30 requests (up to 256 KB per body) and are purged 2 hours after the last incoming request and the last open inspector tab. Keep the inspector tab open while running a test session so the window stays alive.
- Keep real customer data out of test sessions: Anyone who knows your
/app/{slug}URL can view its captures until the session expires. Use Twilio test numbers or synthetic payloads rather than production customer PII.
Ready to try it?
Generate a capture URL on snaphook.site, set your response type to application/xml; charset=utf-8 with <Response/>, and point a Twilio test number at /w/{slug}/twilio/sms. You can review all configuration options anytime in the SnapHook Docs and the Twilio Webhooks Guide.