[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-twilio-twilio-webhook-architecture":3,"mdc-75ql97-key":33,"related-org-twilio-twilio-webhook-architecture":3572,"related-repo-twilio-twilio-webhook-architecture":3752},{"slug":4,"name":4,"fn":5,"description":6,"org":7,"tags":11,"stars":23,"repoUrl":24,"updatedAt":25,"license":26,"forks":27,"topics":28,"repo":29,"sourceUrl":31,"mdContent":32},"twilio-webhook-architecture","design and secure Twilio webhook endpoints","Design, secure, and operate Twilio webhook endpoints. Covers inbound event handling, status callbacks, signature validation, connection overrides for retry and timeout tuning, local development tunneling, and production hardening. Use this skill whenever an agent needs to receive HTTP callbacks from Twilio for any product -- messaging, voice, verify, or event streams.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},"twilio","Twilio","https:\u002F\u002Fpexgzepcugksgbtrxkhf.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Forg-logos\u002Ftwilio.png",[12,16,19,22],{"name":13,"slug":14,"type":15},"Security","security","tag",{"name":17,"slug":18,"type":15},"API Development","api-development",{"name":20,"slug":21,"type":15},"Webhooks","webhooks",{"name":9,"slug":8,"type":15},25,"https:\u002F\u002Fgithub.com\u002Ftwilio\u002Fai","2026-07-17T06:04:15.349404",null,7,[],{"repoUrl":24,"stars":23,"forks":27,"topics":30,"description":26},[],"https:\u002F\u002Fgithub.com\u002Ftwilio\u002Fai\u002Ftree\u002FHEAD\u002Fskills\u002Ftwilio\u002Ftwilio-webhook-architecture","---\nname: twilio-webhook-architecture\ndescription: >\n  Design, secure, and operate Twilio webhook endpoints. Covers inbound event\n  handling, status callbacks, signature validation, connection overrides for\n  retry and timeout tuning, local development tunneling, and production\n  hardening. Use this skill whenever an agent needs to receive HTTP callbacks\n  from Twilio for any product -- messaging, voice, verify, or event streams.\n---\n\n## Overview\n\nTwilio delivers events to your application via HTTP callbacks (webhooks). Inbound messages and calls trigger webhooks that expect a TwiML response; status callbacks and event streams push delivery and lifecycle data asynchronously. This skill covers the cross-product patterns that apply to every webhook integration.\n\n---\n\n## Prerequisites\n\n- Twilio account with a phone number or service configured with a webhook URL\n  -- New to Twilio? See `twilio-account-setup`\n- `TWILIO_ACCOUNT_SID` and `TWILIO_AUTH_TOKEN` -- see `twilio-iam-auth-setup`\n- SDK: `pip install twilio flask` \u002F `npm install twilio express`\n- Publicly accessible HTTPS endpoint (see Local Development section below)\n\n---\n\n## Quickstart\n\nReceive an inbound SMS and validate the request signature before replying.\n\n**Python (Flask)**\n```python\nimport os\nfrom flask import Flask, request, abort\nfrom twilio.request_validator import RequestValidator\nfrom twilio.twiml.messaging_response import MessagingResponse\n\napp = Flask(__name__)\nvalidator = RequestValidator(os.environ[\"TWILIO_AUTH_TOKEN\"])\n\n@app.route(\"\u002Fsms\", methods=[\"POST\"])\ndef incoming_sms():\n    sig = request.headers.get(\"X-Twilio-Signature\", \"\")\n    if not validator.validate(request.url, request.form, sig):\n        abort(403)\n    resp = MessagingResponse()\n    resp.message(f\"Got: {request.form.get('Body')}\")\n    return str(resp), 200, {\"Content-Type\": \"text\u002Fxml\"}\n```\n\n**Node.js (Express)**\n```node\nconst express = require(\"express\");\nconst twilio = require(\"twilio\");\nconst app = express();\napp.use(express.urlencoded({ extended: false }));\n\napp.post(\"\u002Fsms\", (req, res) => {\n    const valid = twilio.validateRequest(\n        process.env.TWILIO_AUTH_TOKEN,\n        req.headers[\"x-twilio-signature\"],\n        `https:\u002F\u002F${req.headers.host}${req.originalUrl}`,\n        req.body\n    );\n    if (!valid) return res.status(403).send(\"Forbidden\");\n    const twiml = new twilio.twiml.MessagingResponse();\n    twiml.message(`Got: ${req.body.Body}`);\n    res.type(\"text\u002Fxml\").send(twiml.toString());\n});\n```\n\nSet your webhook URL in Console: **Phone Numbers > Active Numbers > (your number) > Messaging > \"A Message Comes In\"**.\n\n---\n\n## Key Patterns\n\n### 1. Webhook Types Across Products\n\n| Webhook type | Trigger | Expected response | Products |\n|---|---|---|---|\n| Inbound event | Message received \u002F call answered | TwiML (XML) | Messaging, Voice |\n| Status callback | Resource state change | `200` or `204` (no body required) | Messaging, Voice, Verify, Video |\n| Action URL | TwiML verb completes (`\u003CGather>`, `\u003CRecord>`) | Next TwiML | Voice |\n| Recording status | Recording processing completes | `200` or `204` | Voice |\n| Debugger event | Error or warning on account | `200` or `204` | All |\n| Event Streams | Any subscribed event | `200` or `204` | All (via Sink) |\n\n### 2. Signature Validation\n\nTwilio signs every webhook with an `X-Twilio-Signature` header (HMAC-SHA1 using your Auth Token). Always validate before processing.\n\n**Form-encoded requests (`application\u002Fx-www-form-urlencoded`):**\n\nPass the full URL and POST body parameters to the validator.\n\n**Python**\n```python\nfrom twilio.request_validator import RequestValidator\n\nvalidator = RequestValidator(os.environ[\"TWILIO_AUTH_TOKEN\"])\nis_valid = validator.validate(request.url, request.form, request.headers.get(\"X-Twilio-Signature\", \"\"))\n```\n\n**Node.js**\n```node\nconst { validateRequest } = require(\"twilio\");\n\nconst isValid = validateRequest(\n    process.env.TWILIO_AUTH_TOKEN,\n    req.headers[\"x-twilio-signature\"],\n    `https:\u002F\u002F${req.headers.host}${req.originalUrl}`,\n    req.body\n);\n```\n\n**JSON requests (`application\u002Fjson`):**\n\nTwilio appends a `bodySHA256` query parameter to your URL. Use the SDK's JSON-specific validation.\n\n**Python**\n```python\nfrom twilio.request_validator import RequestValidator\n\nvalidator = RequestValidator(os.environ[\"TWILIO_AUTH_TOKEN\"])\nis_valid = validator.validate_body(\n    request.url,\n    request.get_data(as_text=True),\n    request.headers.get(\"X-Twilio-Signature\", \"\")\n)\n```\n\n**Node.js**\n```node\nconst twilio = require(\"twilio\");\n\n\u002F\u002F Use express.raw() or a verify callback to preserve the raw body\nconst isValid = twilio.validateRequestWithBody(\n    process.env.TWILIO_AUTH_TOKEN,\n    req.headers[\"x-twilio-signature\"],\n    `https:\u002F\u002F${req.headers.host}${req.originalUrl}`,\n    req.rawBody  \u002F\u002F must be the exact bytes Twilio sent, not JSON.stringify(req.body)\n);\n```\n\n**Critical:** Use the SDK validator. Do not implement your own -- Twilio may add parameters without notice, and the exact algorithm (including port handling) has edge cases the SDK handles.\n\n### 3. Status Callback Handling\n\nStatus callbacks are asynchronous POST requests Twilio sends when a resource changes state. They do not expect TwiML -- return `200` or `204`.\n\n**Messaging status flow:** `queued` -> `sent` -> `delivered` (or `undelivered` \u002F `failed`)\n\nWhen using Messaging Services, the flow starts with `accepted` -> `queued` -> ...\n\n**Voice status events:** `initiated`, `ringing`, `answered`, `completed`\n\nSubscribe to specific events via `StatusCallbackEvent` parameter.\n\nStatus callbacks are signed with `X-Twilio-Signature` like all Twilio webhooks. Validate before acting on the payload -- an unvalidated endpoint lets anyone forge delivery status and drive downstream logic.\n\n**Python (Flask) -- messaging status handler**\n```python\n@app.route(\"\u002Fstatus\", methods=[\"POST\"])\ndef message_status():\n    sig = request.headers.get(\"X-Twilio-Signature\", \"\")\n    if not validator.validate(request.url, request.form, sig):\n        return \"Forbidden\", 403\n    sid = request.form.get(\"MessageSid\")\n    status = request.form.get(\"MessageStatus\")\n    error_code = request.form.get(\"ErrorCode\")\n    if status in (\"failed\", \"undelivered\") and error_code:\n        print(f\"Delivery failed {sid}: error {error_code}\")\n    return \"\", 204\n```\n\n**Node.js (Express) -- voice status handler**\n```node\napp.post(\"\u002Fcall-status\", (req, res) => {\n    const valid = twilio.validateRequest(\n        process.env.TWILIO_AUTH_TOKEN,\n        req.headers[\"x-twilio-signature\"],\n        `https:\u002F\u002F${req.headers.host}${req.originalUrl}`,\n        req.body\n    );\n    if (!valid) return res.status(403).send(\"Forbidden\");\n    const { CallSid, CallStatus, Duration } = req.body;\n    console.log(`${CallSid}: ${CallStatus} (${Duration}s)`);\n    res.sendStatus(204);\n});\n```\n\n**Attach status callbacks when creating resources:**\n\n```python\n# Messaging\nmessage = client.messages.create(\n    to=\"+15558675310\", from_=\"+15017122661\", body=\"Hello!\",\n    status_callback=\"https:\u002F\u002Fyourapp.com\u002Fstatus\"\n)\n\n# Voice\ncall = client.calls.create(\n    to=\"+15558675310\", from_=\"+15017122661\",\n    url=\"https:\u002F\u002Fyourapp.com\u002Fvoice\",\n    status_callback=\"https:\u002F\u002Fyourapp.com\u002Fcall-status\",\n    status_callback_event=[\"initiated\", \"ringing\", \"answered\", \"completed\"],\n    status_callback_method=\"POST\"\n)\n```\n\n### 4. Connection Overrides (Retry and Timeout Tuning)\n\nAppend URL fragments to any webhook URL to override default connection behavior. Fragments are not included in signature computation.\n\n**Format:** `https:\u002F\u002Fyourapp.com\u002Fwebhook#key=value&key=value`\n\n| Parameter | Key | Default | Range | Description |\n|---|---|---|---|---|\n| Connect Timeout | `ct` | 5000ms | 100-10000 | TCP connection timeout |\n| Read Timeout | `rt` | 15000ms | 100-15000 | Time to wait for first response byte |\n| Total Time | `tt` | 15000ms | 100-15000 | Total time for all retries |\n| Retry Count | `rc` | 1 | 0-5 | Number of retry attempts |\n| Retry Policy | `rp` | `ct` | `4xx`, `5xx`, `ct`, `rt`, `all` | What triggers a retry |\n| Edge Location | `e` | `ashburn` | `ashburn`, `dublin`, `frankfurt`, `sao-paulo`, `singapore`, `sydney`, `tokyo`, `umatilla` | Egress edge |\n\n**Examples:**\n\n```text\n# Retry up to 3 times on connection or read timeout\nhttps:\u002F\u002Fyourapp.com\u002Fsms#rc=3&rp=ct,rt\n\n# Fast failover: 1s connect timeout, 2 retries\nhttps:\u002F\u002Fyourapp.com\u002Fvoice#ct=1000&rc=2\n\n# Rotate edge locations on retry\nhttps:\u002F\u002Fyourapp.com\u002Fstatus#e=ashburn,dublin&rc=1\n```\n\nTwilio adds an `I-Twilio-Idempotency-Token` header on retries for deduplication.\n\n**Limitations:** Connection overrides are not available on Twilio Conversations or Frontline webhooks. Voice webhooks have a hard 15-second ceiling regardless of override values.\n\n### 5. Configure Webhook URLs via API\n\n**Python**\n```python\n# Phone number -- messaging\nclient.incoming_phone_numbers(\"PNxxxxxxxxxx\").update(\n    sms_url=\"https:\u002F\u002Fyourapp.com\u002Fsms\",\n    sms_method=\"POST\",\n    sms_fallback_url=\"https:\u002F\u002Fyourapp.com\u002Fsms-fallback\",\n    sms_fallback_method=\"POST\"\n)\n\n# Phone number -- voice\nclient.incoming_phone_numbers(\"PNxxxxxxxxxx\").update(\n    voice_url=\"https:\u002F\u002Fyourapp.com\u002Fvoice\",\n    voice_method=\"POST\",\n    voice_fallback_url=\"https:\u002F\u002Fyourapp.com\u002Fvoice-fallback\",\n    voice_fallback_method=\"POST\",\n    status_callback=\"https:\u002F\u002Fyourapp.com\u002Fcall-status\",\n    status_callback_method=\"POST\"\n)\n```\n\n**Node.js**\n```node\n\u002F\u002F Phone number -- messaging\nawait client.incomingPhoneNumbers(\"PNxxxxxxxxxx\").update({\n    smsUrl: \"https:\u002F\u002Fyourapp.com\u002Fsms\",\n    smsMethod: \"POST\",\n    smsFallbackUrl: \"https:\u002F\u002Fyourapp.com\u002Fsms-fallback\",\n    smsFallbackMethod: \"POST\",\n});\n\n\u002F\u002F Phone number -- voice\nawait client.incomingPhoneNumbers(\"PNxxxxxxxxxx\").update({\n    voiceUrl: \"https:\u002F\u002Fyourapp.com\u002Fvoice\",\n    voiceMethod: \"POST\",\n    voiceFallbackUrl: \"https:\u002F\u002Fyourapp.com\u002Fvoice-fallback\",\n    voiceFallbackMethod: \"POST\",\n    statusCallback: \"https:\u002F\u002Fyourapp.com\u002Fcall-status\",\n    statusCallbackMethod: \"POST\",\n});\n```\n\n### 6. Local Development with Tunnels\n\nTwilio cannot reach `localhost`. Use a tunnel to expose your local server.\n\n**ngrok (recommended for development):**\n```bash\nngrok http 5000\n# Copy the HTTPS URL, e.g. https:\u002F\u002Fabc123.ngrok-free.app\n```\n\nThen set the ngrok URL as your webhook in Console or via API.\n\n**Twilio CLI:**\n```bash\n# Install and use the CLI webhook plugin\ntwilio phone-numbers:update +15017122661 \\\n  --sms-url=\"https:\u002F\u002Fabc123.ngrok-free.app\u002Fsms\"\n```\n\n**ngrok caveats:**\n- Free tier URLs change on restart -- update Twilio config each time\n- Free tier sessions expire after hours -- use a stable host for anything beyond quick tests\n- For persistent local dev, use ngrok with a custom domain (paid) or deploy to a cloud host\n\n### 7. Event Streams (Webhook Sink)\n\nFor high-volume or cross-product event delivery, use Event Streams instead of per-resource status callbacks. Event Streams deliver events to a Sink (webhook, Kinesis, or Segment). The Twilio SDK does not wrap Event Streams -- use `requests` \u002F `fetch` directly.\n\n**Python -- create a webhook sink and subscribe to error events**\n```python\nimport os, requests\n\naccount_sid = os.environ[\"TWILIO_ACCOUNT_SID\"]\nauth_token = os.environ[\"TWILIO_AUTH_TOKEN\"]\n\n# Create a webhook sink\nsink = requests.post(\n    \"https:\u002F\u002Fevents.twilio.com\u002Fv1\u002FSinks\",\n    auth=(account_sid, auth_token),\n    data={\n        \"Description\": \"Error log sink\",\n        \"SinkType\": \"webhook\",\n        \"SinkConfiguration\": '{\"destination\": \"https:\u002F\u002Fyourapp.com\u002Fevents\", \"method\": \"POST\"}'\n    }\n).json()\n\n# Subscribe to error log events\nrequests.post(\n    \"https:\u002F\u002Fevents.twilio.com\u002Fv1\u002FSubscriptions\",\n    auth=(account_sid, auth_token),\n    data={\n        \"Description\": \"Error log subscription\",\n        \"SinkSid\": sink[\"sid\"],\n        \"Types\": '[{\"type\": \"com.twilio.error-logs.error.logged\"}]'\n    }\n)\n```\n\nSink types: `webhook`, `kinesis`, `segment`. Subscriptions filter which event types route to which sinks.\n\n### 8. HTTP Authentication for Webhook URLs\n\nTwilio supports HTTP Basic and Digest authentication. Embed credentials in the URL:\n\n```text\nhttps:\u002F\u002Fusername:password@yourapp.com\u002Fsms\n```\n\nThis provides an additional layer of protection beyond signature validation. Note: these credentials are visible in Console webhook configuration and may appear in server access logs -- rotate them independently of your Auth Token.\n\n---\n\n## Common Webhook Parameters\n\n### Inbound SMS\n\n| Parameter | Description |\n|---|---|\n| `MessageSid` | Unique message identifier |\n| `AccountSid` | Your Twilio account SID |\n| `From` | Sender phone number (E.164) |\n| `To` | Your Twilio number |\n| `Body` | Message text |\n| `NumMedia` | Number of media attachments |\n| `MediaUrl0..N` | URL of each media attachment |\n| `MediaContentType0..N` | MIME type of each attachment |\n\n### Inbound Voice Call\n\n| Parameter | Description |\n|---|---|\n| `CallSid` | Unique call identifier |\n| `AccountSid` | Your Twilio account SID |\n| `From` | Caller phone number (E.164) |\n| `To` | Your Twilio number |\n| `CallStatus` | `queued`, `ringing`, `in-progress`, `completed`, `busy`, `failed`, `no-answer`, `canceled` |\n| `Direction` | `inbound` |\n| `ForwardedFrom` | Number that forwarded the call (if applicable) |\n\n### Message Status Callback\n\n| Parameter | Description |\n|---|---|\n| `MessageSid` | Unique message identifier |\n| `MessageStatus` | `accepted`, `queued`, `sending`, `sent`, `delivered`, `undelivered`, `failed`, `read` |\n| `ErrorCode` | Twilio error code (present on `failed`\u002F`undelivered`) |\n| `ErrorMessage` | Human-readable error description |\n\n### Debugger Event Callback\n\n| Parameter | Description |\n|---|---|\n| `Sid` | Debugger event identifier |\n| `AccountSid` | Account that generated the event |\n| `Level` | `Error` or `Warning` |\n| `Timestamp` | ISO 8601 time of occurrence |\n| `Payload` | JSON with `resource_sid`, `error_code`, `more_info`, `webhook` (request\u002Fresponse details) |\n\n---\n\n## CANNOT\n\n- **Cannot exceed 15-second voice webhook response time** — Twilio hangs up or falls back. Messaging webhooks retry on timeout.\n- **Cannot use HTTP in production** — HTTPS required. No self-signed certificates. Do not pin Twilio certificates — they rotate without notice.\n- **Cannot allowlist Twilio by IP** — Webhooks come from dynamic IPs. Use signature validation instead.\n- **Cannot guarantee status callback delivery or order** — Best-effort. Implement idempotency using `MessageSid` + `MessageStatus` or `CallSid` + `CallStatus` as composite keys.\n- **Cannot redirect without losing POST parameters** — HTTP 301\u002F302 redirects cause Twilio to follow with GET, dropping `Digits`, `RecordingUrl`, etc.\n- **Cannot use connection overrides on Conversations or Frontline webhooks** — Not supported for these products\n\n---\n\n## Next Steps\n\n- **Receive inbound SMS:** `twilio-messaging-webhooks`\n- **Voice call handling:** `twilio-voice-twiml`\n- **Scale webhook handling:** `twilio-reliability-patterns`\n- **Debug webhook failures:** `twilio-debugging-observability`\n- **Secure credentials:** `twilio-iam-auth-setup`\n",{"data":34,"body":35},{"name":4,"description":6},{"type":36,"children":37},"root",[38,47,53,57,63,129,132,138,143,152,308,316,461,473,476,482,489,721,727,740,756,761,769,805,813,883,898,911,918,986,993,1066,1076,1082,1099,1146,1165,1201,1214,1226,1234,1327,1335,1430,1438,1554,1560,1565,1580,1896,1904,1914,1927,1937,1943,1950,2087,2094,2233,2239,2252,2260,2299,2304,2312,2374,2382,2400,2406,2426,2434,2650,2677,2683,2688,2697,2702,2705,2711,2717,2873,2879,3066,3072,3218,3224,3367,3370,3376,3480,3483,3489,3566],{"type":39,"tag":40,"props":41,"children":43},"element","h2",{"id":42},"overview",[44],{"type":45,"value":46},"text","Overview",{"type":39,"tag":48,"props":49,"children":50},"p",{},[51],{"type":45,"value":52},"Twilio delivers events to your application via HTTP callbacks (webhooks). Inbound messages and calls trigger webhooks that expect a TwiML response; status callbacks and event streams push delivery and lifecycle data asynchronously. This skill covers the cross-product patterns that apply to every webhook integration.",{"type":39,"tag":54,"props":55,"children":56},"hr",{},[],{"type":39,"tag":40,"props":58,"children":60},{"id":59},"prerequisites",[61],{"type":45,"value":62},"Prerequisites",{"type":39,"tag":64,"props":65,"children":66},"ul",{},[67,80,105,124],{"type":39,"tag":68,"props":69,"children":70},"li",{},[71,73],{"type":45,"value":72},"Twilio account with a phone number or service configured with a webhook URL\n-- New to Twilio? See ",{"type":39,"tag":74,"props":75,"children":77},"code",{"className":76},[],[78],{"type":45,"value":79},"twilio-account-setup",{"type":39,"tag":68,"props":81,"children":82},{},[83,89,91,97,99],{"type":39,"tag":74,"props":84,"children":86},{"className":85},[],[87],{"type":45,"value":88},"TWILIO_ACCOUNT_SID",{"type":45,"value":90}," and ",{"type":39,"tag":74,"props":92,"children":94},{"className":93},[],[95],{"type":45,"value":96},"TWILIO_AUTH_TOKEN",{"type":45,"value":98}," -- see ",{"type":39,"tag":74,"props":100,"children":102},{"className":101},[],[103],{"type":45,"value":104},"twilio-iam-auth-setup",{"type":39,"tag":68,"props":106,"children":107},{},[108,110,116,118],{"type":45,"value":109},"SDK: ",{"type":39,"tag":74,"props":111,"children":113},{"className":112},[],[114],{"type":45,"value":115},"pip install twilio flask",{"type":45,"value":117}," \u002F ",{"type":39,"tag":74,"props":119,"children":121},{"className":120},[],[122],{"type":45,"value":123},"npm install twilio express",{"type":39,"tag":68,"props":125,"children":126},{},[127],{"type":45,"value":128},"Publicly accessible HTTPS endpoint (see Local Development section below)",{"type":39,"tag":54,"props":130,"children":131},{},[],{"type":39,"tag":40,"props":133,"children":135},{"id":134},"quickstart",[136],{"type":45,"value":137},"Quickstart",{"type":39,"tag":48,"props":139,"children":140},{},[141],{"type":45,"value":142},"Receive an inbound SMS and validate the request signature before replying.",{"type":39,"tag":48,"props":144,"children":145},{},[146],{"type":39,"tag":147,"props":148,"children":149},"strong",{},[150],{"type":45,"value":151},"Python (Flask)",{"type":39,"tag":153,"props":154,"children":159},"pre",{"className":155,"code":156,"language":157,"meta":158,"style":158},"language-python shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import os\nfrom flask import Flask, request, abort\nfrom twilio.request_validator import RequestValidator\nfrom twilio.twiml.messaging_response import MessagingResponse\n\napp = Flask(__name__)\nvalidator = RequestValidator(os.environ[\"TWILIO_AUTH_TOKEN\"])\n\n@app.route(\"\u002Fsms\", methods=[\"POST\"])\ndef incoming_sms():\n    sig = request.headers.get(\"X-Twilio-Signature\", \"\")\n    if not validator.validate(request.url, request.form, sig):\n        abort(403)\n    resp = MessagingResponse()\n    resp.message(f\"Got: {request.form.get('Body')}\")\n    return str(resp), 200, {\"Content-Type\": \"text\u002Fxml\"}\n","python","",[160],{"type":39,"tag":74,"props":161,"children":162},{"__ignoreMap":158},[163,174,183,192,201,211,220,228,236,245,254,263,272,281,290,299],{"type":39,"tag":164,"props":165,"children":168},"span",{"class":166,"line":167},"line",1,[169],{"type":39,"tag":164,"props":170,"children":171},{},[172],{"type":45,"value":173},"import os\n",{"type":39,"tag":164,"props":175,"children":177},{"class":166,"line":176},2,[178],{"type":39,"tag":164,"props":179,"children":180},{},[181],{"type":45,"value":182},"from flask import Flask, request, abort\n",{"type":39,"tag":164,"props":184,"children":186},{"class":166,"line":185},3,[187],{"type":39,"tag":164,"props":188,"children":189},{},[190],{"type":45,"value":191},"from twilio.request_validator import RequestValidator\n",{"type":39,"tag":164,"props":193,"children":195},{"class":166,"line":194},4,[196],{"type":39,"tag":164,"props":197,"children":198},{},[199],{"type":45,"value":200},"from twilio.twiml.messaging_response import MessagingResponse\n",{"type":39,"tag":164,"props":202,"children":204},{"class":166,"line":203},5,[205],{"type":39,"tag":164,"props":206,"children":208},{"emptyLinePlaceholder":207},true,[209],{"type":45,"value":210},"\n",{"type":39,"tag":164,"props":212,"children":214},{"class":166,"line":213},6,[215],{"type":39,"tag":164,"props":216,"children":217},{},[218],{"type":45,"value":219},"app = Flask(__name__)\n",{"type":39,"tag":164,"props":221,"children":222},{"class":166,"line":27},[223],{"type":39,"tag":164,"props":224,"children":225},{},[226],{"type":45,"value":227},"validator = RequestValidator(os.environ[\"TWILIO_AUTH_TOKEN\"])\n",{"type":39,"tag":164,"props":229,"children":231},{"class":166,"line":230},8,[232],{"type":39,"tag":164,"props":233,"children":234},{"emptyLinePlaceholder":207},[235],{"type":45,"value":210},{"type":39,"tag":164,"props":237,"children":239},{"class":166,"line":238},9,[240],{"type":39,"tag":164,"props":241,"children":242},{},[243],{"type":45,"value":244},"@app.route(\"\u002Fsms\", methods=[\"POST\"])\n",{"type":39,"tag":164,"props":246,"children":248},{"class":166,"line":247},10,[249],{"type":39,"tag":164,"props":250,"children":251},{},[252],{"type":45,"value":253},"def incoming_sms():\n",{"type":39,"tag":164,"props":255,"children":257},{"class":166,"line":256},11,[258],{"type":39,"tag":164,"props":259,"children":260},{},[261],{"type":45,"value":262},"    sig = request.headers.get(\"X-Twilio-Signature\", \"\")\n",{"type":39,"tag":164,"props":264,"children":266},{"class":166,"line":265},12,[267],{"type":39,"tag":164,"props":268,"children":269},{},[270],{"type":45,"value":271},"    if not validator.validate(request.url, request.form, sig):\n",{"type":39,"tag":164,"props":273,"children":275},{"class":166,"line":274},13,[276],{"type":39,"tag":164,"props":277,"children":278},{},[279],{"type":45,"value":280},"        abort(403)\n",{"type":39,"tag":164,"props":282,"children":284},{"class":166,"line":283},14,[285],{"type":39,"tag":164,"props":286,"children":287},{},[288],{"type":45,"value":289},"    resp = MessagingResponse()\n",{"type":39,"tag":164,"props":291,"children":293},{"class":166,"line":292},15,[294],{"type":39,"tag":164,"props":295,"children":296},{},[297],{"type":45,"value":298},"    resp.message(f\"Got: {request.form.get('Body')}\")\n",{"type":39,"tag":164,"props":300,"children":302},{"class":166,"line":301},16,[303],{"type":39,"tag":164,"props":304,"children":305},{},[306],{"type":45,"value":307},"    return str(resp), 200, {\"Content-Type\": \"text\u002Fxml\"}\n",{"type":39,"tag":48,"props":309,"children":310},{},[311],{"type":39,"tag":147,"props":312,"children":313},{},[314],{"type":45,"value":315},"Node.js (Express)",{"type":39,"tag":153,"props":317,"children":321},{"className":318,"code":319,"language":320,"meta":158,"style":158},"language-node shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","const express = require(\"express\");\nconst twilio = require(\"twilio\");\nconst app = express();\napp.use(express.urlencoded({ extended: false }));\n\napp.post(\"\u002Fsms\", (req, res) => {\n    const valid = twilio.validateRequest(\n        process.env.TWILIO_AUTH_TOKEN,\n        req.headers[\"x-twilio-signature\"],\n        `https:\u002F\u002F${req.headers.host}${req.originalUrl}`,\n        req.body\n    );\n    if (!valid) return res.status(403).send(\"Forbidden\");\n    const twiml = new twilio.twiml.MessagingResponse();\n    twiml.message(`Got: ${req.body.Body}`);\n    res.type(\"text\u002Fxml\").send(twiml.toString());\n});\n","node",[322],{"type":39,"tag":74,"props":323,"children":324},{"__ignoreMap":158},[325,333,341,349,357,364,372,380,388,396,404,412,420,428,436,444,452],{"type":39,"tag":164,"props":326,"children":327},{"class":166,"line":167},[328],{"type":39,"tag":164,"props":329,"children":330},{},[331],{"type":45,"value":332},"const express = require(\"express\");\n",{"type":39,"tag":164,"props":334,"children":335},{"class":166,"line":176},[336],{"type":39,"tag":164,"props":337,"children":338},{},[339],{"type":45,"value":340},"const twilio = require(\"twilio\");\n",{"type":39,"tag":164,"props":342,"children":343},{"class":166,"line":185},[344],{"type":39,"tag":164,"props":345,"children":346},{},[347],{"type":45,"value":348},"const app = express();\n",{"type":39,"tag":164,"props":350,"children":351},{"class":166,"line":194},[352],{"type":39,"tag":164,"props":353,"children":354},{},[355],{"type":45,"value":356},"app.use(express.urlencoded({ extended: false }));\n",{"type":39,"tag":164,"props":358,"children":359},{"class":166,"line":203},[360],{"type":39,"tag":164,"props":361,"children":362},{"emptyLinePlaceholder":207},[363],{"type":45,"value":210},{"type":39,"tag":164,"props":365,"children":366},{"class":166,"line":213},[367],{"type":39,"tag":164,"props":368,"children":369},{},[370],{"type":45,"value":371},"app.post(\"\u002Fsms\", (req, res) => {\n",{"type":39,"tag":164,"props":373,"children":374},{"class":166,"line":27},[375],{"type":39,"tag":164,"props":376,"children":377},{},[378],{"type":45,"value":379},"    const valid = twilio.validateRequest(\n",{"type":39,"tag":164,"props":381,"children":382},{"class":166,"line":230},[383],{"type":39,"tag":164,"props":384,"children":385},{},[386],{"type":45,"value":387},"        process.env.TWILIO_AUTH_TOKEN,\n",{"type":39,"tag":164,"props":389,"children":390},{"class":166,"line":238},[391],{"type":39,"tag":164,"props":392,"children":393},{},[394],{"type":45,"value":395},"        req.headers[\"x-twilio-signature\"],\n",{"type":39,"tag":164,"props":397,"children":398},{"class":166,"line":247},[399],{"type":39,"tag":164,"props":400,"children":401},{},[402],{"type":45,"value":403},"        `https:\u002F\u002F${req.headers.host}${req.originalUrl}`,\n",{"type":39,"tag":164,"props":405,"children":406},{"class":166,"line":256},[407],{"type":39,"tag":164,"props":408,"children":409},{},[410],{"type":45,"value":411},"        req.body\n",{"type":39,"tag":164,"props":413,"children":414},{"class":166,"line":265},[415],{"type":39,"tag":164,"props":416,"children":417},{},[418],{"type":45,"value":419},"    );\n",{"type":39,"tag":164,"props":421,"children":422},{"class":166,"line":274},[423],{"type":39,"tag":164,"props":424,"children":425},{},[426],{"type":45,"value":427},"    if (!valid) return res.status(403).send(\"Forbidden\");\n",{"type":39,"tag":164,"props":429,"children":430},{"class":166,"line":283},[431],{"type":39,"tag":164,"props":432,"children":433},{},[434],{"type":45,"value":435},"    const twiml = new twilio.twiml.MessagingResponse();\n",{"type":39,"tag":164,"props":437,"children":438},{"class":166,"line":292},[439],{"type":39,"tag":164,"props":440,"children":441},{},[442],{"type":45,"value":443},"    twiml.message(`Got: ${req.body.Body}`);\n",{"type":39,"tag":164,"props":445,"children":446},{"class":166,"line":301},[447],{"type":39,"tag":164,"props":448,"children":449},{},[450],{"type":45,"value":451},"    res.type(\"text\u002Fxml\").send(twiml.toString());\n",{"type":39,"tag":164,"props":453,"children":455},{"class":166,"line":454},17,[456],{"type":39,"tag":164,"props":457,"children":458},{},[459],{"type":45,"value":460},"});\n",{"type":39,"tag":48,"props":462,"children":463},{},[464,466,471],{"type":45,"value":465},"Set your webhook URL in Console: ",{"type":39,"tag":147,"props":467,"children":468},{},[469],{"type":45,"value":470},"Phone Numbers > Active Numbers > (your number) > Messaging > \"A Message Comes In\"",{"type":45,"value":472},".",{"type":39,"tag":54,"props":474,"children":475},{},[],{"type":39,"tag":40,"props":477,"children":479},{"id":478},"key-patterns",[480],{"type":45,"value":481},"Key Patterns",{"type":39,"tag":483,"props":484,"children":486},"h3",{"id":485},"_1-webhook-types-across-products",[487],{"type":45,"value":488},"1. Webhook Types Across Products",{"type":39,"tag":490,"props":491,"children":492},"table",{},[493,522],{"type":39,"tag":494,"props":495,"children":496},"thead",{},[497],{"type":39,"tag":498,"props":499,"children":500},"tr",{},[501,507,512,517],{"type":39,"tag":502,"props":503,"children":504},"th",{},[505],{"type":45,"value":506},"Webhook type",{"type":39,"tag":502,"props":508,"children":509},{},[510],{"type":45,"value":511},"Trigger",{"type":39,"tag":502,"props":513,"children":514},{},[515],{"type":45,"value":516},"Expected response",{"type":39,"tag":502,"props":518,"children":519},{},[520],{"type":45,"value":521},"Products",{"type":39,"tag":523,"props":524,"children":525},"tbody",{},[526,550,587,626,657,689],{"type":39,"tag":498,"props":527,"children":528},{},[529,535,540,545],{"type":39,"tag":530,"props":531,"children":532},"td",{},[533],{"type":45,"value":534},"Inbound event",{"type":39,"tag":530,"props":536,"children":537},{},[538],{"type":45,"value":539},"Message received \u002F call answered",{"type":39,"tag":530,"props":541,"children":542},{},[543],{"type":45,"value":544},"TwiML (XML)",{"type":39,"tag":530,"props":546,"children":547},{},[548],{"type":45,"value":549},"Messaging, Voice",{"type":39,"tag":498,"props":551,"children":552},{},[553,558,563,582],{"type":39,"tag":530,"props":554,"children":555},{},[556],{"type":45,"value":557},"Status callback",{"type":39,"tag":530,"props":559,"children":560},{},[561],{"type":45,"value":562},"Resource state change",{"type":39,"tag":530,"props":564,"children":565},{},[566,572,574,580],{"type":39,"tag":74,"props":567,"children":569},{"className":568},[],[570],{"type":45,"value":571},"200",{"type":45,"value":573}," or ",{"type":39,"tag":74,"props":575,"children":577},{"className":576},[],[578],{"type":45,"value":579},"204",{"type":45,"value":581}," (no body required)",{"type":39,"tag":530,"props":583,"children":584},{},[585],{"type":45,"value":586},"Messaging, Voice, Verify, Video",{"type":39,"tag":498,"props":588,"children":589},{},[590,595,616,621],{"type":39,"tag":530,"props":591,"children":592},{},[593],{"type":45,"value":594},"Action URL",{"type":39,"tag":530,"props":596,"children":597},{},[598,600,606,608,614],{"type":45,"value":599},"TwiML verb completes (",{"type":39,"tag":74,"props":601,"children":603},{"className":602},[],[604],{"type":45,"value":605},"\u003CGather>",{"type":45,"value":607},", ",{"type":39,"tag":74,"props":609,"children":611},{"className":610},[],[612],{"type":45,"value":613},"\u003CRecord>",{"type":45,"value":615},")",{"type":39,"tag":530,"props":617,"children":618},{},[619],{"type":45,"value":620},"Next TwiML",{"type":39,"tag":530,"props":622,"children":623},{},[624],{"type":45,"value":625},"Voice",{"type":39,"tag":498,"props":627,"children":628},{},[629,634,639,653],{"type":39,"tag":530,"props":630,"children":631},{},[632],{"type":45,"value":633},"Recording status",{"type":39,"tag":530,"props":635,"children":636},{},[637],{"type":45,"value":638},"Recording processing completes",{"type":39,"tag":530,"props":640,"children":641},{},[642,647,648],{"type":39,"tag":74,"props":643,"children":645},{"className":644},[],[646],{"type":45,"value":571},{"type":45,"value":573},{"type":39,"tag":74,"props":649,"children":651},{"className":650},[],[652],{"type":45,"value":579},{"type":39,"tag":530,"props":654,"children":655},{},[656],{"type":45,"value":625},{"type":39,"tag":498,"props":658,"children":659},{},[660,665,670,684],{"type":39,"tag":530,"props":661,"children":662},{},[663],{"type":45,"value":664},"Debugger event",{"type":39,"tag":530,"props":666,"children":667},{},[668],{"type":45,"value":669},"Error or warning on account",{"type":39,"tag":530,"props":671,"children":672},{},[673,678,679],{"type":39,"tag":74,"props":674,"children":676},{"className":675},[],[677],{"type":45,"value":571},{"type":45,"value":573},{"type":39,"tag":74,"props":680,"children":682},{"className":681},[],[683],{"type":45,"value":579},{"type":39,"tag":530,"props":685,"children":686},{},[687],{"type":45,"value":688},"All",{"type":39,"tag":498,"props":690,"children":691},{},[692,697,702,716],{"type":39,"tag":530,"props":693,"children":694},{},[695],{"type":45,"value":696},"Event Streams",{"type":39,"tag":530,"props":698,"children":699},{},[700],{"type":45,"value":701},"Any subscribed event",{"type":39,"tag":530,"props":703,"children":704},{},[705,710,711],{"type":39,"tag":74,"props":706,"children":708},{"className":707},[],[709],{"type":45,"value":571},{"type":45,"value":573},{"type":39,"tag":74,"props":712,"children":714},{"className":713},[],[715],{"type":45,"value":579},{"type":39,"tag":530,"props":717,"children":718},{},[719],{"type":45,"value":720},"All (via Sink)",{"type":39,"tag":483,"props":722,"children":724},{"id":723},"_2-signature-validation",[725],{"type":45,"value":726},"2. Signature Validation",{"type":39,"tag":48,"props":728,"children":729},{},[730,732,738],{"type":45,"value":731},"Twilio signs every webhook with an ",{"type":39,"tag":74,"props":733,"children":735},{"className":734},[],[736],{"type":45,"value":737},"X-Twilio-Signature",{"type":45,"value":739}," header (HMAC-SHA1 using your Auth Token). Always validate before processing.",{"type":39,"tag":48,"props":741,"children":742},{},[743],{"type":39,"tag":147,"props":744,"children":745},{},[746,748,754],{"type":45,"value":747},"Form-encoded requests (",{"type":39,"tag":74,"props":749,"children":751},{"className":750},[],[752],{"type":45,"value":753},"application\u002Fx-www-form-urlencoded",{"type":45,"value":755},"):",{"type":39,"tag":48,"props":757,"children":758},{},[759],{"type":45,"value":760},"Pass the full URL and POST body parameters to the validator.",{"type":39,"tag":48,"props":762,"children":763},{},[764],{"type":39,"tag":147,"props":765,"children":766},{},[767],{"type":45,"value":768},"Python",{"type":39,"tag":153,"props":770,"children":772},{"className":155,"code":771,"language":157,"meta":158,"style":158},"from twilio.request_validator import RequestValidator\n\nvalidator = RequestValidator(os.environ[\"TWILIO_AUTH_TOKEN\"])\nis_valid = validator.validate(request.url, request.form, request.headers.get(\"X-Twilio-Signature\", \"\"))\n",[773],{"type":39,"tag":74,"props":774,"children":775},{"__ignoreMap":158},[776,783,790,797],{"type":39,"tag":164,"props":777,"children":778},{"class":166,"line":167},[779],{"type":39,"tag":164,"props":780,"children":781},{},[782],{"type":45,"value":191},{"type":39,"tag":164,"props":784,"children":785},{"class":166,"line":176},[786],{"type":39,"tag":164,"props":787,"children":788},{"emptyLinePlaceholder":207},[789],{"type":45,"value":210},{"type":39,"tag":164,"props":791,"children":792},{"class":166,"line":185},[793],{"type":39,"tag":164,"props":794,"children":795},{},[796],{"type":45,"value":227},{"type":39,"tag":164,"props":798,"children":799},{"class":166,"line":194},[800],{"type":39,"tag":164,"props":801,"children":802},{},[803],{"type":45,"value":804},"is_valid = validator.validate(request.url, request.form, request.headers.get(\"X-Twilio-Signature\", \"\"))\n",{"type":39,"tag":48,"props":806,"children":807},{},[808],{"type":39,"tag":147,"props":809,"children":810},{},[811],{"type":45,"value":812},"Node.js",{"type":39,"tag":153,"props":814,"children":816},{"className":318,"code":815,"language":320,"meta":158,"style":158},"const { validateRequest } = require(\"twilio\");\n\nconst isValid = validateRequest(\n    process.env.TWILIO_AUTH_TOKEN,\n    req.headers[\"x-twilio-signature\"],\n    `https:\u002F\u002F${req.headers.host}${req.originalUrl}`,\n    req.body\n);\n",[817],{"type":39,"tag":74,"props":818,"children":819},{"__ignoreMap":158},[820,828,835,843,851,859,867,875],{"type":39,"tag":164,"props":821,"children":822},{"class":166,"line":167},[823],{"type":39,"tag":164,"props":824,"children":825},{},[826],{"type":45,"value":827},"const { validateRequest } = require(\"twilio\");\n",{"type":39,"tag":164,"props":829,"children":830},{"class":166,"line":176},[831],{"type":39,"tag":164,"props":832,"children":833},{"emptyLinePlaceholder":207},[834],{"type":45,"value":210},{"type":39,"tag":164,"props":836,"children":837},{"class":166,"line":185},[838],{"type":39,"tag":164,"props":839,"children":840},{},[841],{"type":45,"value":842},"const isValid = validateRequest(\n",{"type":39,"tag":164,"props":844,"children":845},{"class":166,"line":194},[846],{"type":39,"tag":164,"props":847,"children":848},{},[849],{"type":45,"value":850},"    process.env.TWILIO_AUTH_TOKEN,\n",{"type":39,"tag":164,"props":852,"children":853},{"class":166,"line":203},[854],{"type":39,"tag":164,"props":855,"children":856},{},[857],{"type":45,"value":858},"    req.headers[\"x-twilio-signature\"],\n",{"type":39,"tag":164,"props":860,"children":861},{"class":166,"line":213},[862],{"type":39,"tag":164,"props":863,"children":864},{},[865],{"type":45,"value":866},"    `https:\u002F\u002F${req.headers.host}${req.originalUrl}`,\n",{"type":39,"tag":164,"props":868,"children":869},{"class":166,"line":27},[870],{"type":39,"tag":164,"props":871,"children":872},{},[873],{"type":45,"value":874},"    req.body\n",{"type":39,"tag":164,"props":876,"children":877},{"class":166,"line":230},[878],{"type":39,"tag":164,"props":879,"children":880},{},[881],{"type":45,"value":882},");\n",{"type":39,"tag":48,"props":884,"children":885},{},[886],{"type":39,"tag":147,"props":887,"children":888},{},[889,891,897],{"type":45,"value":890},"JSON requests (",{"type":39,"tag":74,"props":892,"children":894},{"className":893},[],[895],{"type":45,"value":896},"application\u002Fjson",{"type":45,"value":755},{"type":39,"tag":48,"props":899,"children":900},{},[901,903,909],{"type":45,"value":902},"Twilio appends a ",{"type":39,"tag":74,"props":904,"children":906},{"className":905},[],[907],{"type":45,"value":908},"bodySHA256",{"type":45,"value":910}," query parameter to your URL. Use the SDK's JSON-specific validation.",{"type":39,"tag":48,"props":912,"children":913},{},[914],{"type":39,"tag":147,"props":915,"children":916},{},[917],{"type":45,"value":768},{"type":39,"tag":153,"props":919,"children":921},{"className":155,"code":920,"language":157,"meta":158,"style":158},"from twilio.request_validator import RequestValidator\n\nvalidator = RequestValidator(os.environ[\"TWILIO_AUTH_TOKEN\"])\nis_valid = validator.validate_body(\n    request.url,\n    request.get_data(as_text=True),\n    request.headers.get(\"X-Twilio-Signature\", \"\")\n)\n",[922],{"type":39,"tag":74,"props":923,"children":924},{"__ignoreMap":158},[925,932,939,946,954,962,970,978],{"type":39,"tag":164,"props":926,"children":927},{"class":166,"line":167},[928],{"type":39,"tag":164,"props":929,"children":930},{},[931],{"type":45,"value":191},{"type":39,"tag":164,"props":933,"children":934},{"class":166,"line":176},[935],{"type":39,"tag":164,"props":936,"children":937},{"emptyLinePlaceholder":207},[938],{"type":45,"value":210},{"type":39,"tag":164,"props":940,"children":941},{"class":166,"line":185},[942],{"type":39,"tag":164,"props":943,"children":944},{},[945],{"type":45,"value":227},{"type":39,"tag":164,"props":947,"children":948},{"class":166,"line":194},[949],{"type":39,"tag":164,"props":950,"children":951},{},[952],{"type":45,"value":953},"is_valid = validator.validate_body(\n",{"type":39,"tag":164,"props":955,"children":956},{"class":166,"line":203},[957],{"type":39,"tag":164,"props":958,"children":959},{},[960],{"type":45,"value":961},"    request.url,\n",{"type":39,"tag":164,"props":963,"children":964},{"class":166,"line":213},[965],{"type":39,"tag":164,"props":966,"children":967},{},[968],{"type":45,"value":969},"    request.get_data(as_text=True),\n",{"type":39,"tag":164,"props":971,"children":972},{"class":166,"line":27},[973],{"type":39,"tag":164,"props":974,"children":975},{},[976],{"type":45,"value":977},"    request.headers.get(\"X-Twilio-Signature\", \"\")\n",{"type":39,"tag":164,"props":979,"children":980},{"class":166,"line":230},[981],{"type":39,"tag":164,"props":982,"children":983},{},[984],{"type":45,"value":985},")\n",{"type":39,"tag":48,"props":987,"children":988},{},[989],{"type":39,"tag":147,"props":990,"children":991},{},[992],{"type":45,"value":812},{"type":39,"tag":153,"props":994,"children":996},{"className":318,"code":995,"language":320,"meta":158,"style":158},"const twilio = require(\"twilio\");\n\n\u002F\u002F Use express.raw() or a verify callback to preserve the raw body\nconst isValid = twilio.validateRequestWithBody(\n    process.env.TWILIO_AUTH_TOKEN,\n    req.headers[\"x-twilio-signature\"],\n    `https:\u002F\u002F${req.headers.host}${req.originalUrl}`,\n    req.rawBody  \u002F\u002F must be the exact bytes Twilio sent, not JSON.stringify(req.body)\n);\n",[997],{"type":39,"tag":74,"props":998,"children":999},{"__ignoreMap":158},[1000,1007,1014,1022,1030,1037,1044,1051,1059],{"type":39,"tag":164,"props":1001,"children":1002},{"class":166,"line":167},[1003],{"type":39,"tag":164,"props":1004,"children":1005},{},[1006],{"type":45,"value":340},{"type":39,"tag":164,"props":1008,"children":1009},{"class":166,"line":176},[1010],{"type":39,"tag":164,"props":1011,"children":1012},{"emptyLinePlaceholder":207},[1013],{"type":45,"value":210},{"type":39,"tag":164,"props":1015,"children":1016},{"class":166,"line":185},[1017],{"type":39,"tag":164,"props":1018,"children":1019},{},[1020],{"type":45,"value":1021},"\u002F\u002F Use express.raw() or a verify callback to preserve the raw body\n",{"type":39,"tag":164,"props":1023,"children":1024},{"class":166,"line":194},[1025],{"type":39,"tag":164,"props":1026,"children":1027},{},[1028],{"type":45,"value":1029},"const isValid = twilio.validateRequestWithBody(\n",{"type":39,"tag":164,"props":1031,"children":1032},{"class":166,"line":203},[1033],{"type":39,"tag":164,"props":1034,"children":1035},{},[1036],{"type":45,"value":850},{"type":39,"tag":164,"props":1038,"children":1039},{"class":166,"line":213},[1040],{"type":39,"tag":164,"props":1041,"children":1042},{},[1043],{"type":45,"value":858},{"type":39,"tag":164,"props":1045,"children":1046},{"class":166,"line":27},[1047],{"type":39,"tag":164,"props":1048,"children":1049},{},[1050],{"type":45,"value":866},{"type":39,"tag":164,"props":1052,"children":1053},{"class":166,"line":230},[1054],{"type":39,"tag":164,"props":1055,"children":1056},{},[1057],{"type":45,"value":1058},"    req.rawBody  \u002F\u002F must be the exact bytes Twilio sent, not JSON.stringify(req.body)\n",{"type":39,"tag":164,"props":1060,"children":1061},{"class":166,"line":238},[1062],{"type":39,"tag":164,"props":1063,"children":1064},{},[1065],{"type":45,"value":882},{"type":39,"tag":48,"props":1067,"children":1068},{},[1069,1074],{"type":39,"tag":147,"props":1070,"children":1071},{},[1072],{"type":45,"value":1073},"Critical:",{"type":45,"value":1075}," Use the SDK validator. Do not implement your own -- Twilio may add parameters without notice, and the exact algorithm (including port handling) has edge cases the SDK handles.",{"type":39,"tag":483,"props":1077,"children":1079},{"id":1078},"_3-status-callback-handling",[1080],{"type":45,"value":1081},"3. Status Callback Handling",{"type":39,"tag":48,"props":1083,"children":1084},{},[1085,1087,1092,1093,1098],{"type":45,"value":1086},"Status callbacks are asynchronous POST requests Twilio sends when a resource changes state. They do not expect TwiML -- return ",{"type":39,"tag":74,"props":1088,"children":1090},{"className":1089},[],[1091],{"type":45,"value":571},{"type":45,"value":573},{"type":39,"tag":74,"props":1094,"children":1096},{"className":1095},[],[1097],{"type":45,"value":579},{"type":45,"value":472},{"type":39,"tag":48,"props":1100,"children":1101},{},[1102,1107,1109,1115,1117,1123,1124,1130,1132,1138,1139,1145],{"type":39,"tag":147,"props":1103,"children":1104},{},[1105],{"type":45,"value":1106},"Messaging status flow:",{"type":45,"value":1108}," ",{"type":39,"tag":74,"props":1110,"children":1112},{"className":1111},[],[1113],{"type":45,"value":1114},"queued",{"type":45,"value":1116}," -> ",{"type":39,"tag":74,"props":1118,"children":1120},{"className":1119},[],[1121],{"type":45,"value":1122},"sent",{"type":45,"value":1116},{"type":39,"tag":74,"props":1125,"children":1127},{"className":1126},[],[1128],{"type":45,"value":1129},"delivered",{"type":45,"value":1131}," (or ",{"type":39,"tag":74,"props":1133,"children":1135},{"className":1134},[],[1136],{"type":45,"value":1137},"undelivered",{"type":45,"value":117},{"type":39,"tag":74,"props":1140,"children":1142},{"className":1141},[],[1143],{"type":45,"value":1144},"failed",{"type":45,"value":615},{"type":39,"tag":48,"props":1147,"children":1148},{},[1149,1151,1157,1158,1163],{"type":45,"value":1150},"When using Messaging Services, the flow starts with ",{"type":39,"tag":74,"props":1152,"children":1154},{"className":1153},[],[1155],{"type":45,"value":1156},"accepted",{"type":45,"value":1116},{"type":39,"tag":74,"props":1159,"children":1161},{"className":1160},[],[1162],{"type":45,"value":1114},{"type":45,"value":1164}," -> ...",{"type":39,"tag":48,"props":1166,"children":1167},{},[1168,1173,1174,1180,1181,1187,1188,1194,1195],{"type":39,"tag":147,"props":1169,"children":1170},{},[1171],{"type":45,"value":1172},"Voice status events:",{"type":45,"value":1108},{"type":39,"tag":74,"props":1175,"children":1177},{"className":1176},[],[1178],{"type":45,"value":1179},"initiated",{"type":45,"value":607},{"type":39,"tag":74,"props":1182,"children":1184},{"className":1183},[],[1185],{"type":45,"value":1186},"ringing",{"type":45,"value":607},{"type":39,"tag":74,"props":1189,"children":1191},{"className":1190},[],[1192],{"type":45,"value":1193},"answered",{"type":45,"value":607},{"type":39,"tag":74,"props":1196,"children":1198},{"className":1197},[],[1199],{"type":45,"value":1200},"completed",{"type":39,"tag":48,"props":1202,"children":1203},{},[1204,1206,1212],{"type":45,"value":1205},"Subscribe to specific events via ",{"type":39,"tag":74,"props":1207,"children":1209},{"className":1208},[],[1210],{"type":45,"value":1211},"StatusCallbackEvent",{"type":45,"value":1213}," parameter.",{"type":39,"tag":48,"props":1215,"children":1216},{},[1217,1219,1224],{"type":45,"value":1218},"Status callbacks are signed with ",{"type":39,"tag":74,"props":1220,"children":1222},{"className":1221},[],[1223],{"type":45,"value":737},{"type":45,"value":1225}," like all Twilio webhooks. Validate before acting on the payload -- an unvalidated endpoint lets anyone forge delivery status and drive downstream logic.",{"type":39,"tag":48,"props":1227,"children":1228},{},[1229],{"type":39,"tag":147,"props":1230,"children":1231},{},[1232],{"type":45,"value":1233},"Python (Flask) -- messaging status handler",{"type":39,"tag":153,"props":1235,"children":1237},{"className":155,"code":1236,"language":157,"meta":158,"style":158},"@app.route(\"\u002Fstatus\", methods=[\"POST\"])\ndef message_status():\n    sig = request.headers.get(\"X-Twilio-Signature\", \"\")\n    if not validator.validate(request.url, request.form, sig):\n        return \"Forbidden\", 403\n    sid = request.form.get(\"MessageSid\")\n    status = request.form.get(\"MessageStatus\")\n    error_code = request.form.get(\"ErrorCode\")\n    if status in (\"failed\", \"undelivered\") and error_code:\n        print(f\"Delivery failed {sid}: error {error_code}\")\n    return \"\", 204\n",[1238],{"type":39,"tag":74,"props":1239,"children":1240},{"__ignoreMap":158},[1241,1249,1257,1264,1271,1279,1287,1295,1303,1311,1319],{"type":39,"tag":164,"props":1242,"children":1243},{"class":166,"line":167},[1244],{"type":39,"tag":164,"props":1245,"children":1246},{},[1247],{"type":45,"value":1248},"@app.route(\"\u002Fstatus\", methods=[\"POST\"])\n",{"type":39,"tag":164,"props":1250,"children":1251},{"class":166,"line":176},[1252],{"type":39,"tag":164,"props":1253,"children":1254},{},[1255],{"type":45,"value":1256},"def message_status():\n",{"type":39,"tag":164,"props":1258,"children":1259},{"class":166,"line":185},[1260],{"type":39,"tag":164,"props":1261,"children":1262},{},[1263],{"type":45,"value":262},{"type":39,"tag":164,"props":1265,"children":1266},{"class":166,"line":194},[1267],{"type":39,"tag":164,"props":1268,"children":1269},{},[1270],{"type":45,"value":271},{"type":39,"tag":164,"props":1272,"children":1273},{"class":166,"line":203},[1274],{"type":39,"tag":164,"props":1275,"children":1276},{},[1277],{"type":45,"value":1278},"        return \"Forbidden\", 403\n",{"type":39,"tag":164,"props":1280,"children":1281},{"class":166,"line":213},[1282],{"type":39,"tag":164,"props":1283,"children":1284},{},[1285],{"type":45,"value":1286},"    sid = request.form.get(\"MessageSid\")\n",{"type":39,"tag":164,"props":1288,"children":1289},{"class":166,"line":27},[1290],{"type":39,"tag":164,"props":1291,"children":1292},{},[1293],{"type":45,"value":1294},"    status = request.form.get(\"MessageStatus\")\n",{"type":39,"tag":164,"props":1296,"children":1297},{"class":166,"line":230},[1298],{"type":39,"tag":164,"props":1299,"children":1300},{},[1301],{"type":45,"value":1302},"    error_code = request.form.get(\"ErrorCode\")\n",{"type":39,"tag":164,"props":1304,"children":1305},{"class":166,"line":238},[1306],{"type":39,"tag":164,"props":1307,"children":1308},{},[1309],{"type":45,"value":1310},"    if status in (\"failed\", \"undelivered\") and error_code:\n",{"type":39,"tag":164,"props":1312,"children":1313},{"class":166,"line":247},[1314],{"type":39,"tag":164,"props":1315,"children":1316},{},[1317],{"type":45,"value":1318},"        print(f\"Delivery failed {sid}: error {error_code}\")\n",{"type":39,"tag":164,"props":1320,"children":1321},{"class":166,"line":256},[1322],{"type":39,"tag":164,"props":1323,"children":1324},{},[1325],{"type":45,"value":1326},"    return \"\", 204\n",{"type":39,"tag":48,"props":1328,"children":1329},{},[1330],{"type":39,"tag":147,"props":1331,"children":1332},{},[1333],{"type":45,"value":1334},"Node.js (Express) -- voice status handler",{"type":39,"tag":153,"props":1336,"children":1338},{"className":318,"code":1337,"language":320,"meta":158,"style":158},"app.post(\"\u002Fcall-status\", (req, res) => {\n    const valid = twilio.validateRequest(\n        process.env.TWILIO_AUTH_TOKEN,\n        req.headers[\"x-twilio-signature\"],\n        `https:\u002F\u002F${req.headers.host}${req.originalUrl}`,\n        req.body\n    );\n    if (!valid) return res.status(403).send(\"Forbidden\");\n    const { CallSid, CallStatus, Duration } = req.body;\n    console.log(`${CallSid}: ${CallStatus} (${Duration}s)`);\n    res.sendStatus(204);\n});\n",[1339],{"type":39,"tag":74,"props":1340,"children":1341},{"__ignoreMap":158},[1342,1350,1357,1364,1371,1378,1385,1392,1399,1407,1415,1423],{"type":39,"tag":164,"props":1343,"children":1344},{"class":166,"line":167},[1345],{"type":39,"tag":164,"props":1346,"children":1347},{},[1348],{"type":45,"value":1349},"app.post(\"\u002Fcall-status\", (req, res) => {\n",{"type":39,"tag":164,"props":1351,"children":1352},{"class":166,"line":176},[1353],{"type":39,"tag":164,"props":1354,"children":1355},{},[1356],{"type":45,"value":379},{"type":39,"tag":164,"props":1358,"children":1359},{"class":166,"line":185},[1360],{"type":39,"tag":164,"props":1361,"children":1362},{},[1363],{"type":45,"value":387},{"type":39,"tag":164,"props":1365,"children":1366},{"class":166,"line":194},[1367],{"type":39,"tag":164,"props":1368,"children":1369},{},[1370],{"type":45,"value":395},{"type":39,"tag":164,"props":1372,"children":1373},{"class":166,"line":203},[1374],{"type":39,"tag":164,"props":1375,"children":1376},{},[1377],{"type":45,"value":403},{"type":39,"tag":164,"props":1379,"children":1380},{"class":166,"line":213},[1381],{"type":39,"tag":164,"props":1382,"children":1383},{},[1384],{"type":45,"value":411},{"type":39,"tag":164,"props":1386,"children":1387},{"class":166,"line":27},[1388],{"type":39,"tag":164,"props":1389,"children":1390},{},[1391],{"type":45,"value":419},{"type":39,"tag":164,"props":1393,"children":1394},{"class":166,"line":230},[1395],{"type":39,"tag":164,"props":1396,"children":1397},{},[1398],{"type":45,"value":427},{"type":39,"tag":164,"props":1400,"children":1401},{"class":166,"line":238},[1402],{"type":39,"tag":164,"props":1403,"children":1404},{},[1405],{"type":45,"value":1406},"    const { CallSid, CallStatus, Duration } = req.body;\n",{"type":39,"tag":164,"props":1408,"children":1409},{"class":166,"line":247},[1410],{"type":39,"tag":164,"props":1411,"children":1412},{},[1413],{"type":45,"value":1414},"    console.log(`${CallSid}: ${CallStatus} (${Duration}s)`);\n",{"type":39,"tag":164,"props":1416,"children":1417},{"class":166,"line":256},[1418],{"type":39,"tag":164,"props":1419,"children":1420},{},[1421],{"type":45,"value":1422},"    res.sendStatus(204);\n",{"type":39,"tag":164,"props":1424,"children":1425},{"class":166,"line":265},[1426],{"type":39,"tag":164,"props":1427,"children":1428},{},[1429],{"type":45,"value":460},{"type":39,"tag":48,"props":1431,"children":1432},{},[1433],{"type":39,"tag":147,"props":1434,"children":1435},{},[1436],{"type":45,"value":1437},"Attach status callbacks when creating resources:",{"type":39,"tag":153,"props":1439,"children":1441},{"className":155,"code":1440,"language":157,"meta":158,"style":158},"# Messaging\nmessage = client.messages.create(\n    to=\"+15558675310\", from_=\"+15017122661\", body=\"Hello!\",\n    status_callback=\"https:\u002F\u002Fyourapp.com\u002Fstatus\"\n)\n\n# Voice\ncall = client.calls.create(\n    to=\"+15558675310\", from_=\"+15017122661\",\n    url=\"https:\u002F\u002Fyourapp.com\u002Fvoice\",\n    status_callback=\"https:\u002F\u002Fyourapp.com\u002Fcall-status\",\n    status_callback_event=[\"initiated\", \"ringing\", \"answered\", \"completed\"],\n    status_callback_method=\"POST\"\n)\n",[1442],{"type":39,"tag":74,"props":1443,"children":1444},{"__ignoreMap":158},[1445,1453,1461,1469,1477,1484,1491,1499,1507,1515,1523,1531,1539,1547],{"type":39,"tag":164,"props":1446,"children":1447},{"class":166,"line":167},[1448],{"type":39,"tag":164,"props":1449,"children":1450},{},[1451],{"type":45,"value":1452},"# Messaging\n",{"type":39,"tag":164,"props":1454,"children":1455},{"class":166,"line":176},[1456],{"type":39,"tag":164,"props":1457,"children":1458},{},[1459],{"type":45,"value":1460},"message = client.messages.create(\n",{"type":39,"tag":164,"props":1462,"children":1463},{"class":166,"line":185},[1464],{"type":39,"tag":164,"props":1465,"children":1466},{},[1467],{"type":45,"value":1468},"    to=\"+15558675310\", from_=\"+15017122661\", body=\"Hello!\",\n",{"type":39,"tag":164,"props":1470,"children":1471},{"class":166,"line":194},[1472],{"type":39,"tag":164,"props":1473,"children":1474},{},[1475],{"type":45,"value":1476},"    status_callback=\"https:\u002F\u002Fyourapp.com\u002Fstatus\"\n",{"type":39,"tag":164,"props":1478,"children":1479},{"class":166,"line":203},[1480],{"type":39,"tag":164,"props":1481,"children":1482},{},[1483],{"type":45,"value":985},{"type":39,"tag":164,"props":1485,"children":1486},{"class":166,"line":213},[1487],{"type":39,"tag":164,"props":1488,"children":1489},{"emptyLinePlaceholder":207},[1490],{"type":45,"value":210},{"type":39,"tag":164,"props":1492,"children":1493},{"class":166,"line":27},[1494],{"type":39,"tag":164,"props":1495,"children":1496},{},[1497],{"type":45,"value":1498},"# Voice\n",{"type":39,"tag":164,"props":1500,"children":1501},{"class":166,"line":230},[1502],{"type":39,"tag":164,"props":1503,"children":1504},{},[1505],{"type":45,"value":1506},"call = client.calls.create(\n",{"type":39,"tag":164,"props":1508,"children":1509},{"class":166,"line":238},[1510],{"type":39,"tag":164,"props":1511,"children":1512},{},[1513],{"type":45,"value":1514},"    to=\"+15558675310\", from_=\"+15017122661\",\n",{"type":39,"tag":164,"props":1516,"children":1517},{"class":166,"line":247},[1518],{"type":39,"tag":164,"props":1519,"children":1520},{},[1521],{"type":45,"value":1522},"    url=\"https:\u002F\u002Fyourapp.com\u002Fvoice\",\n",{"type":39,"tag":164,"props":1524,"children":1525},{"class":166,"line":256},[1526],{"type":39,"tag":164,"props":1527,"children":1528},{},[1529],{"type":45,"value":1530},"    status_callback=\"https:\u002F\u002Fyourapp.com\u002Fcall-status\",\n",{"type":39,"tag":164,"props":1532,"children":1533},{"class":166,"line":265},[1534],{"type":39,"tag":164,"props":1535,"children":1536},{},[1537],{"type":45,"value":1538},"    status_callback_event=[\"initiated\", \"ringing\", \"answered\", \"completed\"],\n",{"type":39,"tag":164,"props":1540,"children":1541},{"class":166,"line":274},[1542],{"type":39,"tag":164,"props":1543,"children":1544},{},[1545],{"type":45,"value":1546},"    status_callback_method=\"POST\"\n",{"type":39,"tag":164,"props":1548,"children":1549},{"class":166,"line":283},[1550],{"type":39,"tag":164,"props":1551,"children":1552},{},[1553],{"type":45,"value":985},{"type":39,"tag":483,"props":1555,"children":1557},{"id":1556},"_4-connection-overrides-retry-and-timeout-tuning",[1558],{"type":45,"value":1559},"4. Connection Overrides (Retry and Timeout Tuning)",{"type":39,"tag":48,"props":1561,"children":1562},{},[1563],{"type":45,"value":1564},"Append URL fragments to any webhook URL to override default connection behavior. Fragments are not included in signature computation.",{"type":39,"tag":48,"props":1566,"children":1567},{},[1568,1573,1574],{"type":39,"tag":147,"props":1569,"children":1570},{},[1571],{"type":45,"value":1572},"Format:",{"type":45,"value":1108},{"type":39,"tag":74,"props":1575,"children":1577},{"className":1576},[],[1578],{"type":45,"value":1579},"https:\u002F\u002Fyourapp.com\u002Fwebhook#key=value&key=value",{"type":39,"tag":490,"props":1581,"children":1582},{},[1583,1614],{"type":39,"tag":494,"props":1584,"children":1585},{},[1586],{"type":39,"tag":498,"props":1587,"children":1588},{},[1589,1594,1599,1604,1609],{"type":39,"tag":502,"props":1590,"children":1591},{},[1592],{"type":45,"value":1593},"Parameter",{"type":39,"tag":502,"props":1595,"children":1596},{},[1597],{"type":45,"value":1598},"Key",{"type":39,"tag":502,"props":1600,"children":1601},{},[1602],{"type":45,"value":1603},"Default",{"type":39,"tag":502,"props":1605,"children":1606},{},[1607],{"type":45,"value":1608},"Range",{"type":39,"tag":502,"props":1610,"children":1611},{},[1612],{"type":45,"value":1613},"Description",{"type":39,"tag":523,"props":1615,"children":1616},{},[1617,1649,1681,1711,1743,1808],{"type":39,"tag":498,"props":1618,"children":1619},{},[1620,1625,1634,1639,1644],{"type":39,"tag":530,"props":1621,"children":1622},{},[1623],{"type":45,"value":1624},"Connect Timeout",{"type":39,"tag":530,"props":1626,"children":1627},{},[1628],{"type":39,"tag":74,"props":1629,"children":1631},{"className":1630},[],[1632],{"type":45,"value":1633},"ct",{"type":39,"tag":530,"props":1635,"children":1636},{},[1637],{"type":45,"value":1638},"5000ms",{"type":39,"tag":530,"props":1640,"children":1641},{},[1642],{"type":45,"value":1643},"100-10000",{"type":39,"tag":530,"props":1645,"children":1646},{},[1647],{"type":45,"value":1648},"TCP connection timeout",{"type":39,"tag":498,"props":1650,"children":1651},{},[1652,1657,1666,1671,1676],{"type":39,"tag":530,"props":1653,"children":1654},{},[1655],{"type":45,"value":1656},"Read Timeout",{"type":39,"tag":530,"props":1658,"children":1659},{},[1660],{"type":39,"tag":74,"props":1661,"children":1663},{"className":1662},[],[1664],{"type":45,"value":1665},"rt",{"type":39,"tag":530,"props":1667,"children":1668},{},[1669],{"type":45,"value":1670},"15000ms",{"type":39,"tag":530,"props":1672,"children":1673},{},[1674],{"type":45,"value":1675},"100-15000",{"type":39,"tag":530,"props":1677,"children":1678},{},[1679],{"type":45,"value":1680},"Time to wait for first response byte",{"type":39,"tag":498,"props":1682,"children":1683},{},[1684,1689,1698,1702,1706],{"type":39,"tag":530,"props":1685,"children":1686},{},[1687],{"type":45,"value":1688},"Total Time",{"type":39,"tag":530,"props":1690,"children":1691},{},[1692],{"type":39,"tag":74,"props":1693,"children":1695},{"className":1694},[],[1696],{"type":45,"value":1697},"tt",{"type":39,"tag":530,"props":1699,"children":1700},{},[1701],{"type":45,"value":1670},{"type":39,"tag":530,"props":1703,"children":1704},{},[1705],{"type":45,"value":1675},{"type":39,"tag":530,"props":1707,"children":1708},{},[1709],{"type":45,"value":1710},"Total time for all retries",{"type":39,"tag":498,"props":1712,"children":1713},{},[1714,1719,1728,1733,1738],{"type":39,"tag":530,"props":1715,"children":1716},{},[1717],{"type":45,"value":1718},"Retry Count",{"type":39,"tag":530,"props":1720,"children":1721},{},[1722],{"type":39,"tag":74,"props":1723,"children":1725},{"className":1724},[],[1726],{"type":45,"value":1727},"rc",{"type":39,"tag":530,"props":1729,"children":1730},{},[1731],{"type":45,"value":1732},"1",{"type":39,"tag":530,"props":1734,"children":1735},{},[1736],{"type":45,"value":1737},"0-5",{"type":39,"tag":530,"props":1739,"children":1740},{},[1741],{"type":45,"value":1742},"Number of retry attempts",{"type":39,"tag":498,"props":1744,"children":1745},{},[1746,1751,1760,1768,1803],{"type":39,"tag":530,"props":1747,"children":1748},{},[1749],{"type":45,"value":1750},"Retry Policy",{"type":39,"tag":530,"props":1752,"children":1753},{},[1754],{"type":39,"tag":74,"props":1755,"children":1757},{"className":1756},[],[1758],{"type":45,"value":1759},"rp",{"type":39,"tag":530,"props":1761,"children":1762},{},[1763],{"type":39,"tag":74,"props":1764,"children":1766},{"className":1765},[],[1767],{"type":45,"value":1633},{"type":39,"tag":530,"props":1769,"children":1770},{},[1771,1777,1778,1784,1785,1790,1791,1796,1797],{"type":39,"tag":74,"props":1772,"children":1774},{"className":1773},[],[1775],{"type":45,"value":1776},"4xx",{"type":45,"value":607},{"type":39,"tag":74,"props":1779,"children":1781},{"className":1780},[],[1782],{"type":45,"value":1783},"5xx",{"type":45,"value":607},{"type":39,"tag":74,"props":1786,"children":1788},{"className":1787},[],[1789],{"type":45,"value":1633},{"type":45,"value":607},{"type":39,"tag":74,"props":1792,"children":1794},{"className":1793},[],[1795],{"type":45,"value":1665},{"type":45,"value":607},{"type":39,"tag":74,"props":1798,"children":1800},{"className":1799},[],[1801],{"type":45,"value":1802},"all",{"type":39,"tag":530,"props":1804,"children":1805},{},[1806],{"type":45,"value":1807},"What triggers a retry",{"type":39,"tag":498,"props":1809,"children":1810},{},[1811,1816,1825,1834,1891],{"type":39,"tag":530,"props":1812,"children":1813},{},[1814],{"type":45,"value":1815},"Edge Location",{"type":39,"tag":530,"props":1817,"children":1818},{},[1819],{"type":39,"tag":74,"props":1820,"children":1822},{"className":1821},[],[1823],{"type":45,"value":1824},"e",{"type":39,"tag":530,"props":1826,"children":1827},{},[1828],{"type":39,"tag":74,"props":1829,"children":1831},{"className":1830},[],[1832],{"type":45,"value":1833},"ashburn",{"type":39,"tag":530,"props":1835,"children":1836},{},[1837,1842,1843,1849,1850,1856,1857,1863,1864,1870,1871,1877,1878,1884,1885],{"type":39,"tag":74,"props":1838,"children":1840},{"className":1839},[],[1841],{"type":45,"value":1833},{"type":45,"value":607},{"type":39,"tag":74,"props":1844,"children":1846},{"className":1845},[],[1847],{"type":45,"value":1848},"dublin",{"type":45,"value":607},{"type":39,"tag":74,"props":1851,"children":1853},{"className":1852},[],[1854],{"type":45,"value":1855},"frankfurt",{"type":45,"value":607},{"type":39,"tag":74,"props":1858,"children":1860},{"className":1859},[],[1861],{"type":45,"value":1862},"sao-paulo",{"type":45,"value":607},{"type":39,"tag":74,"props":1865,"children":1867},{"className":1866},[],[1868],{"type":45,"value":1869},"singapore",{"type":45,"value":607},{"type":39,"tag":74,"props":1872,"children":1874},{"className":1873},[],[1875],{"type":45,"value":1876},"sydney",{"type":45,"value":607},{"type":39,"tag":74,"props":1879,"children":1881},{"className":1880},[],[1882],{"type":45,"value":1883},"tokyo",{"type":45,"value":607},{"type":39,"tag":74,"props":1886,"children":1888},{"className":1887},[],[1889],{"type":45,"value":1890},"umatilla",{"type":39,"tag":530,"props":1892,"children":1893},{},[1894],{"type":45,"value":1895},"Egress edge",{"type":39,"tag":48,"props":1897,"children":1898},{},[1899],{"type":39,"tag":147,"props":1900,"children":1901},{},[1902],{"type":45,"value":1903},"Examples:",{"type":39,"tag":153,"props":1905,"children":1909},{"className":1906,"code":1908,"language":45,"meta":158},[1907],"language-text","# Retry up to 3 times on connection or read timeout\nhttps:\u002F\u002Fyourapp.com\u002Fsms#rc=3&rp=ct,rt\n\n# Fast failover: 1s connect timeout, 2 retries\nhttps:\u002F\u002Fyourapp.com\u002Fvoice#ct=1000&rc=2\n\n# Rotate edge locations on retry\nhttps:\u002F\u002Fyourapp.com\u002Fstatus#e=ashburn,dublin&rc=1\n",[1910],{"type":39,"tag":74,"props":1911,"children":1912},{"__ignoreMap":158},[1913],{"type":45,"value":1908},{"type":39,"tag":48,"props":1915,"children":1916},{},[1917,1919,1925],{"type":45,"value":1918},"Twilio adds an ",{"type":39,"tag":74,"props":1920,"children":1922},{"className":1921},[],[1923],{"type":45,"value":1924},"I-Twilio-Idempotency-Token",{"type":45,"value":1926}," header on retries for deduplication.",{"type":39,"tag":48,"props":1928,"children":1929},{},[1930,1935],{"type":39,"tag":147,"props":1931,"children":1932},{},[1933],{"type":45,"value":1934},"Limitations:",{"type":45,"value":1936}," Connection overrides are not available on Twilio Conversations or Frontline webhooks. Voice webhooks have a hard 15-second ceiling regardless of override values.",{"type":39,"tag":483,"props":1938,"children":1940},{"id":1939},"_5-configure-webhook-urls-via-api",[1941],{"type":45,"value":1942},"5. Configure Webhook URLs via API",{"type":39,"tag":48,"props":1944,"children":1945},{},[1946],{"type":39,"tag":147,"props":1947,"children":1948},{},[1949],{"type":45,"value":768},{"type":39,"tag":153,"props":1951,"children":1953},{"className":155,"code":1952,"language":157,"meta":158,"style":158},"# Phone number -- messaging\nclient.incoming_phone_numbers(\"PNxxxxxxxxxx\").update(\n    sms_url=\"https:\u002F\u002Fyourapp.com\u002Fsms\",\n    sms_method=\"POST\",\n    sms_fallback_url=\"https:\u002F\u002Fyourapp.com\u002Fsms-fallback\",\n    sms_fallback_method=\"POST\"\n)\n\n# Phone number -- voice\nclient.incoming_phone_numbers(\"PNxxxxxxxxxx\").update(\n    voice_url=\"https:\u002F\u002Fyourapp.com\u002Fvoice\",\n    voice_method=\"POST\",\n    voice_fallback_url=\"https:\u002F\u002Fyourapp.com\u002Fvoice-fallback\",\n    voice_fallback_method=\"POST\",\n    status_callback=\"https:\u002F\u002Fyourapp.com\u002Fcall-status\",\n    status_callback_method=\"POST\"\n)\n",[1954],{"type":39,"tag":74,"props":1955,"children":1956},{"__ignoreMap":158},[1957,1965,1973,1981,1989,1997,2005,2012,2019,2027,2034,2042,2050,2058,2066,2073,2080],{"type":39,"tag":164,"props":1958,"children":1959},{"class":166,"line":167},[1960],{"type":39,"tag":164,"props":1961,"children":1962},{},[1963],{"type":45,"value":1964},"# Phone number -- messaging\n",{"type":39,"tag":164,"props":1966,"children":1967},{"class":166,"line":176},[1968],{"type":39,"tag":164,"props":1969,"children":1970},{},[1971],{"type":45,"value":1972},"client.incoming_phone_numbers(\"PNxxxxxxxxxx\").update(\n",{"type":39,"tag":164,"props":1974,"children":1975},{"class":166,"line":185},[1976],{"type":39,"tag":164,"props":1977,"children":1978},{},[1979],{"type":45,"value":1980},"    sms_url=\"https:\u002F\u002Fyourapp.com\u002Fsms\",\n",{"type":39,"tag":164,"props":1982,"children":1983},{"class":166,"line":194},[1984],{"type":39,"tag":164,"props":1985,"children":1986},{},[1987],{"type":45,"value":1988},"    sms_method=\"POST\",\n",{"type":39,"tag":164,"props":1990,"children":1991},{"class":166,"line":203},[1992],{"type":39,"tag":164,"props":1993,"children":1994},{},[1995],{"type":45,"value":1996},"    sms_fallback_url=\"https:\u002F\u002Fyourapp.com\u002Fsms-fallback\",\n",{"type":39,"tag":164,"props":1998,"children":1999},{"class":166,"line":213},[2000],{"type":39,"tag":164,"props":2001,"children":2002},{},[2003],{"type":45,"value":2004},"    sms_fallback_method=\"POST\"\n",{"type":39,"tag":164,"props":2006,"children":2007},{"class":166,"line":27},[2008],{"type":39,"tag":164,"props":2009,"children":2010},{},[2011],{"type":45,"value":985},{"type":39,"tag":164,"props":2013,"children":2014},{"class":166,"line":230},[2015],{"type":39,"tag":164,"props":2016,"children":2017},{"emptyLinePlaceholder":207},[2018],{"type":45,"value":210},{"type":39,"tag":164,"props":2020,"children":2021},{"class":166,"line":238},[2022],{"type":39,"tag":164,"props":2023,"children":2024},{},[2025],{"type":45,"value":2026},"# Phone number -- voice\n",{"type":39,"tag":164,"props":2028,"children":2029},{"class":166,"line":247},[2030],{"type":39,"tag":164,"props":2031,"children":2032},{},[2033],{"type":45,"value":1972},{"type":39,"tag":164,"props":2035,"children":2036},{"class":166,"line":256},[2037],{"type":39,"tag":164,"props":2038,"children":2039},{},[2040],{"type":45,"value":2041},"    voice_url=\"https:\u002F\u002Fyourapp.com\u002Fvoice\",\n",{"type":39,"tag":164,"props":2043,"children":2044},{"class":166,"line":265},[2045],{"type":39,"tag":164,"props":2046,"children":2047},{},[2048],{"type":45,"value":2049},"    voice_method=\"POST\",\n",{"type":39,"tag":164,"props":2051,"children":2052},{"class":166,"line":274},[2053],{"type":39,"tag":164,"props":2054,"children":2055},{},[2056],{"type":45,"value":2057},"    voice_fallback_url=\"https:\u002F\u002Fyourapp.com\u002Fvoice-fallback\",\n",{"type":39,"tag":164,"props":2059,"children":2060},{"class":166,"line":283},[2061],{"type":39,"tag":164,"props":2062,"children":2063},{},[2064],{"type":45,"value":2065},"    voice_fallback_method=\"POST\",\n",{"type":39,"tag":164,"props":2067,"children":2068},{"class":166,"line":292},[2069],{"type":39,"tag":164,"props":2070,"children":2071},{},[2072],{"type":45,"value":1530},{"type":39,"tag":164,"props":2074,"children":2075},{"class":166,"line":301},[2076],{"type":39,"tag":164,"props":2077,"children":2078},{},[2079],{"type":45,"value":1546},{"type":39,"tag":164,"props":2081,"children":2082},{"class":166,"line":454},[2083],{"type":39,"tag":164,"props":2084,"children":2085},{},[2086],{"type":45,"value":985},{"type":39,"tag":48,"props":2088,"children":2089},{},[2090],{"type":39,"tag":147,"props":2091,"children":2092},{},[2093],{"type":45,"value":812},{"type":39,"tag":153,"props":2095,"children":2097},{"className":318,"code":2096,"language":320,"meta":158,"style":158},"\u002F\u002F Phone number -- messaging\nawait client.incomingPhoneNumbers(\"PNxxxxxxxxxx\").update({\n    smsUrl: \"https:\u002F\u002Fyourapp.com\u002Fsms\",\n    smsMethod: \"POST\",\n    smsFallbackUrl: \"https:\u002F\u002Fyourapp.com\u002Fsms-fallback\",\n    smsFallbackMethod: \"POST\",\n});\n\n\u002F\u002F Phone number -- voice\nawait client.incomingPhoneNumbers(\"PNxxxxxxxxxx\").update({\n    voiceUrl: \"https:\u002F\u002Fyourapp.com\u002Fvoice\",\n    voiceMethod: \"POST\",\n    voiceFallbackUrl: \"https:\u002F\u002Fyourapp.com\u002Fvoice-fallback\",\n    voiceFallbackMethod: \"POST\",\n    statusCallback: \"https:\u002F\u002Fyourapp.com\u002Fcall-status\",\n    statusCallbackMethod: \"POST\",\n});\n",[2098],{"type":39,"tag":74,"props":2099,"children":2100},{"__ignoreMap":158},[2101,2109,2117,2125,2133,2141,2149,2156,2163,2171,2178,2186,2194,2202,2210,2218,2226],{"type":39,"tag":164,"props":2102,"children":2103},{"class":166,"line":167},[2104],{"type":39,"tag":164,"props":2105,"children":2106},{},[2107],{"type":45,"value":2108},"\u002F\u002F Phone number -- messaging\n",{"type":39,"tag":164,"props":2110,"children":2111},{"class":166,"line":176},[2112],{"type":39,"tag":164,"props":2113,"children":2114},{},[2115],{"type":45,"value":2116},"await client.incomingPhoneNumbers(\"PNxxxxxxxxxx\").update({\n",{"type":39,"tag":164,"props":2118,"children":2119},{"class":166,"line":185},[2120],{"type":39,"tag":164,"props":2121,"children":2122},{},[2123],{"type":45,"value":2124},"    smsUrl: \"https:\u002F\u002Fyourapp.com\u002Fsms\",\n",{"type":39,"tag":164,"props":2126,"children":2127},{"class":166,"line":194},[2128],{"type":39,"tag":164,"props":2129,"children":2130},{},[2131],{"type":45,"value":2132},"    smsMethod: \"POST\",\n",{"type":39,"tag":164,"props":2134,"children":2135},{"class":166,"line":203},[2136],{"type":39,"tag":164,"props":2137,"children":2138},{},[2139],{"type":45,"value":2140},"    smsFallbackUrl: \"https:\u002F\u002Fyourapp.com\u002Fsms-fallback\",\n",{"type":39,"tag":164,"props":2142,"children":2143},{"class":166,"line":213},[2144],{"type":39,"tag":164,"props":2145,"children":2146},{},[2147],{"type":45,"value":2148},"    smsFallbackMethod: \"POST\",\n",{"type":39,"tag":164,"props":2150,"children":2151},{"class":166,"line":27},[2152],{"type":39,"tag":164,"props":2153,"children":2154},{},[2155],{"type":45,"value":460},{"type":39,"tag":164,"props":2157,"children":2158},{"class":166,"line":230},[2159],{"type":39,"tag":164,"props":2160,"children":2161},{"emptyLinePlaceholder":207},[2162],{"type":45,"value":210},{"type":39,"tag":164,"props":2164,"children":2165},{"class":166,"line":238},[2166],{"type":39,"tag":164,"props":2167,"children":2168},{},[2169],{"type":45,"value":2170},"\u002F\u002F Phone number -- voice\n",{"type":39,"tag":164,"props":2172,"children":2173},{"class":166,"line":247},[2174],{"type":39,"tag":164,"props":2175,"children":2176},{},[2177],{"type":45,"value":2116},{"type":39,"tag":164,"props":2179,"children":2180},{"class":166,"line":256},[2181],{"type":39,"tag":164,"props":2182,"children":2183},{},[2184],{"type":45,"value":2185},"    voiceUrl: \"https:\u002F\u002Fyourapp.com\u002Fvoice\",\n",{"type":39,"tag":164,"props":2187,"children":2188},{"class":166,"line":265},[2189],{"type":39,"tag":164,"props":2190,"children":2191},{},[2192],{"type":45,"value":2193},"    voiceMethod: \"POST\",\n",{"type":39,"tag":164,"props":2195,"children":2196},{"class":166,"line":274},[2197],{"type":39,"tag":164,"props":2198,"children":2199},{},[2200],{"type":45,"value":2201},"    voiceFallbackUrl: \"https:\u002F\u002Fyourapp.com\u002Fvoice-fallback\",\n",{"type":39,"tag":164,"props":2203,"children":2204},{"class":166,"line":283},[2205],{"type":39,"tag":164,"props":2206,"children":2207},{},[2208],{"type":45,"value":2209},"    voiceFallbackMethod: \"POST\",\n",{"type":39,"tag":164,"props":2211,"children":2212},{"class":166,"line":292},[2213],{"type":39,"tag":164,"props":2214,"children":2215},{},[2216],{"type":45,"value":2217},"    statusCallback: \"https:\u002F\u002Fyourapp.com\u002Fcall-status\",\n",{"type":39,"tag":164,"props":2219,"children":2220},{"class":166,"line":301},[2221],{"type":39,"tag":164,"props":2222,"children":2223},{},[2224],{"type":45,"value":2225},"    statusCallbackMethod: \"POST\",\n",{"type":39,"tag":164,"props":2227,"children":2228},{"class":166,"line":454},[2229],{"type":39,"tag":164,"props":2230,"children":2231},{},[2232],{"type":45,"value":460},{"type":39,"tag":483,"props":2234,"children":2236},{"id":2235},"_6-local-development-with-tunnels",[2237],{"type":45,"value":2238},"6. Local Development with Tunnels",{"type":39,"tag":48,"props":2240,"children":2241},{},[2242,2244,2250],{"type":45,"value":2243},"Twilio cannot reach ",{"type":39,"tag":74,"props":2245,"children":2247},{"className":2246},[],[2248],{"type":45,"value":2249},"localhost",{"type":45,"value":2251},". Use a tunnel to expose your local server.",{"type":39,"tag":48,"props":2253,"children":2254},{},[2255],{"type":39,"tag":147,"props":2256,"children":2257},{},[2258],{"type":45,"value":2259},"ngrok (recommended for development):",{"type":39,"tag":153,"props":2261,"children":2265},{"className":2262,"code":2263,"language":2264,"meta":158,"style":158},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","ngrok http 5000\n# Copy the HTTPS URL, e.g. https:\u002F\u002Fabc123.ngrok-free.app\n","bash",[2266],{"type":39,"tag":74,"props":2267,"children":2268},{"__ignoreMap":158},[2269,2290],{"type":39,"tag":164,"props":2270,"children":2271},{"class":166,"line":167},[2272,2278,2284],{"type":39,"tag":164,"props":2273,"children":2275},{"style":2274},"--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B",[2276],{"type":45,"value":2277},"ngrok",{"type":39,"tag":164,"props":2279,"children":2281},{"style":2280},"--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D",[2282],{"type":45,"value":2283}," http",{"type":39,"tag":164,"props":2285,"children":2287},{"style":2286},"--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C",[2288],{"type":45,"value":2289}," 5000\n",{"type":39,"tag":164,"props":2291,"children":2292},{"class":166,"line":176},[2293],{"type":39,"tag":164,"props":2294,"children":2296},{"style":2295},"--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic",[2297],{"type":45,"value":2298},"# Copy the HTTPS URL, e.g. https:\u002F\u002Fabc123.ngrok-free.app\n",{"type":39,"tag":48,"props":2300,"children":2301},{},[2302],{"type":45,"value":2303},"Then set the ngrok URL as your webhook in Console or via API.",{"type":39,"tag":48,"props":2305,"children":2306},{},[2307],{"type":39,"tag":147,"props":2308,"children":2309},{},[2310],{"type":45,"value":2311},"Twilio CLI:",{"type":39,"tag":153,"props":2313,"children":2315},{"className":2262,"code":2314,"language":2264,"meta":158,"style":158},"# Install and use the CLI webhook plugin\ntwilio phone-numbers:update +15017122661 \\\n  --sms-url=\"https:\u002F\u002Fabc123.ngrok-free.app\u002Fsms\"\n",[2316],{"type":39,"tag":74,"props":2317,"children":2318},{"__ignoreMap":158},[2319,2327,2350],{"type":39,"tag":164,"props":2320,"children":2321},{"class":166,"line":167},[2322],{"type":39,"tag":164,"props":2323,"children":2324},{"style":2295},[2325],{"type":45,"value":2326},"# Install and use the CLI webhook plugin\n",{"type":39,"tag":164,"props":2328,"children":2329},{"class":166,"line":176},[2330,2334,2339,2344],{"type":39,"tag":164,"props":2331,"children":2332},{"style":2274},[2333],{"type":45,"value":8},{"type":39,"tag":164,"props":2335,"children":2336},{"style":2280},[2337],{"type":45,"value":2338}," phone-numbers:update",{"type":39,"tag":164,"props":2340,"children":2341},{"style":2280},[2342],{"type":45,"value":2343}," +15017122661",{"type":39,"tag":164,"props":2345,"children":2347},{"style":2346},"--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8",[2348],{"type":45,"value":2349}," \\\n",{"type":39,"tag":164,"props":2351,"children":2352},{"class":166,"line":185},[2353,2358,2364,2369],{"type":39,"tag":164,"props":2354,"children":2355},{"style":2280},[2356],{"type":45,"value":2357},"  --sms-url=",{"type":39,"tag":164,"props":2359,"children":2361},{"style":2360},"--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF",[2362],{"type":45,"value":2363},"\"",{"type":39,"tag":164,"props":2365,"children":2366},{"style":2280},[2367],{"type":45,"value":2368},"https:\u002F\u002Fabc123.ngrok-free.app\u002Fsms",{"type":39,"tag":164,"props":2370,"children":2371},{"style":2360},[2372],{"type":45,"value":2373},"\"\n",{"type":39,"tag":48,"props":2375,"children":2376},{},[2377],{"type":39,"tag":147,"props":2378,"children":2379},{},[2380],{"type":45,"value":2381},"ngrok caveats:",{"type":39,"tag":64,"props":2383,"children":2384},{},[2385,2390,2395],{"type":39,"tag":68,"props":2386,"children":2387},{},[2388],{"type":45,"value":2389},"Free tier URLs change on restart -- update Twilio config each time",{"type":39,"tag":68,"props":2391,"children":2392},{},[2393],{"type":45,"value":2394},"Free tier sessions expire after hours -- use a stable host for anything beyond quick tests",{"type":39,"tag":68,"props":2396,"children":2397},{},[2398],{"type":45,"value":2399},"For persistent local dev, use ngrok with a custom domain (paid) or deploy to a cloud host",{"type":39,"tag":483,"props":2401,"children":2403},{"id":2402},"_7-event-streams-webhook-sink",[2404],{"type":45,"value":2405},"7. Event Streams (Webhook Sink)",{"type":39,"tag":48,"props":2407,"children":2408},{},[2409,2411,2417,2418,2424],{"type":45,"value":2410},"For high-volume or cross-product event delivery, use Event Streams instead of per-resource status callbacks. Event Streams deliver events to a Sink (webhook, Kinesis, or Segment). The Twilio SDK does not wrap Event Streams -- use ",{"type":39,"tag":74,"props":2412,"children":2414},{"className":2413},[],[2415],{"type":45,"value":2416},"requests",{"type":45,"value":117},{"type":39,"tag":74,"props":2419,"children":2421},{"className":2420},[],[2422],{"type":45,"value":2423},"fetch",{"type":45,"value":2425}," directly.",{"type":39,"tag":48,"props":2427,"children":2428},{},[2429],{"type":39,"tag":147,"props":2430,"children":2431},{},[2432],{"type":45,"value":2433},"Python -- create a webhook sink and subscribe to error events",{"type":39,"tag":153,"props":2435,"children":2437},{"className":155,"code":2436,"language":157,"meta":158,"style":158},"import os, requests\n\naccount_sid = os.environ[\"TWILIO_ACCOUNT_SID\"]\nauth_token = os.environ[\"TWILIO_AUTH_TOKEN\"]\n\n# Create a webhook sink\nsink = requests.post(\n    \"https:\u002F\u002Fevents.twilio.com\u002Fv1\u002FSinks\",\n    auth=(account_sid, auth_token),\n    data={\n        \"Description\": \"Error log sink\",\n        \"SinkType\": \"webhook\",\n        \"SinkConfiguration\": '{\"destination\": \"https:\u002F\u002Fyourapp.com\u002Fevents\", \"method\": \"POST\"}'\n    }\n).json()\n\n# Subscribe to error log events\nrequests.post(\n    \"https:\u002F\u002Fevents.twilio.com\u002Fv1\u002FSubscriptions\",\n    auth=(account_sid, auth_token),\n    data={\n        \"Description\": \"Error log subscription\",\n        \"SinkSid\": sink[\"sid\"],\n        \"Types\": '[{\"type\": \"com.twilio.error-logs.error.logged\"}]'\n    }\n)\n",[2438],{"type":39,"tag":74,"props":2439,"children":2440},{"__ignoreMap":158},[2441,2449,2456,2464,2472,2479,2487,2495,2503,2511,2519,2527,2535,2543,2551,2559,2566,2574,2583,2592,2600,2608,2617,2626,2635,2642],{"type":39,"tag":164,"props":2442,"children":2443},{"class":166,"line":167},[2444],{"type":39,"tag":164,"props":2445,"children":2446},{},[2447],{"type":45,"value":2448},"import os, requests\n",{"type":39,"tag":164,"props":2450,"children":2451},{"class":166,"line":176},[2452],{"type":39,"tag":164,"props":2453,"children":2454},{"emptyLinePlaceholder":207},[2455],{"type":45,"value":210},{"type":39,"tag":164,"props":2457,"children":2458},{"class":166,"line":185},[2459],{"type":39,"tag":164,"props":2460,"children":2461},{},[2462],{"type":45,"value":2463},"account_sid = os.environ[\"TWILIO_ACCOUNT_SID\"]\n",{"type":39,"tag":164,"props":2465,"children":2466},{"class":166,"line":194},[2467],{"type":39,"tag":164,"props":2468,"children":2469},{},[2470],{"type":45,"value":2471},"auth_token = os.environ[\"TWILIO_AUTH_TOKEN\"]\n",{"type":39,"tag":164,"props":2473,"children":2474},{"class":166,"line":203},[2475],{"type":39,"tag":164,"props":2476,"children":2477},{"emptyLinePlaceholder":207},[2478],{"type":45,"value":210},{"type":39,"tag":164,"props":2480,"children":2481},{"class":166,"line":213},[2482],{"type":39,"tag":164,"props":2483,"children":2484},{},[2485],{"type":45,"value":2486},"# Create a webhook sink\n",{"type":39,"tag":164,"props":2488,"children":2489},{"class":166,"line":27},[2490],{"type":39,"tag":164,"props":2491,"children":2492},{},[2493],{"type":45,"value":2494},"sink = requests.post(\n",{"type":39,"tag":164,"props":2496,"children":2497},{"class":166,"line":230},[2498],{"type":39,"tag":164,"props":2499,"children":2500},{},[2501],{"type":45,"value":2502},"    \"https:\u002F\u002Fevents.twilio.com\u002Fv1\u002FSinks\",\n",{"type":39,"tag":164,"props":2504,"children":2505},{"class":166,"line":238},[2506],{"type":39,"tag":164,"props":2507,"children":2508},{},[2509],{"type":45,"value":2510},"    auth=(account_sid, auth_token),\n",{"type":39,"tag":164,"props":2512,"children":2513},{"class":166,"line":247},[2514],{"type":39,"tag":164,"props":2515,"children":2516},{},[2517],{"type":45,"value":2518},"    data={\n",{"type":39,"tag":164,"props":2520,"children":2521},{"class":166,"line":256},[2522],{"type":39,"tag":164,"props":2523,"children":2524},{},[2525],{"type":45,"value":2526},"        \"Description\": \"Error log sink\",\n",{"type":39,"tag":164,"props":2528,"children":2529},{"class":166,"line":265},[2530],{"type":39,"tag":164,"props":2531,"children":2532},{},[2533],{"type":45,"value":2534},"        \"SinkType\": \"webhook\",\n",{"type":39,"tag":164,"props":2536,"children":2537},{"class":166,"line":274},[2538],{"type":39,"tag":164,"props":2539,"children":2540},{},[2541],{"type":45,"value":2542},"        \"SinkConfiguration\": '{\"destination\": \"https:\u002F\u002Fyourapp.com\u002Fevents\", \"method\": \"POST\"}'\n",{"type":39,"tag":164,"props":2544,"children":2545},{"class":166,"line":283},[2546],{"type":39,"tag":164,"props":2547,"children":2548},{},[2549],{"type":45,"value":2550},"    }\n",{"type":39,"tag":164,"props":2552,"children":2553},{"class":166,"line":292},[2554],{"type":39,"tag":164,"props":2555,"children":2556},{},[2557],{"type":45,"value":2558},").json()\n",{"type":39,"tag":164,"props":2560,"children":2561},{"class":166,"line":301},[2562],{"type":39,"tag":164,"props":2563,"children":2564},{"emptyLinePlaceholder":207},[2565],{"type":45,"value":210},{"type":39,"tag":164,"props":2567,"children":2568},{"class":166,"line":454},[2569],{"type":39,"tag":164,"props":2570,"children":2571},{},[2572],{"type":45,"value":2573},"# Subscribe to error log events\n",{"type":39,"tag":164,"props":2575,"children":2577},{"class":166,"line":2576},18,[2578],{"type":39,"tag":164,"props":2579,"children":2580},{},[2581],{"type":45,"value":2582},"requests.post(\n",{"type":39,"tag":164,"props":2584,"children":2586},{"class":166,"line":2585},19,[2587],{"type":39,"tag":164,"props":2588,"children":2589},{},[2590],{"type":45,"value":2591},"    \"https:\u002F\u002Fevents.twilio.com\u002Fv1\u002FSubscriptions\",\n",{"type":39,"tag":164,"props":2593,"children":2595},{"class":166,"line":2594},20,[2596],{"type":39,"tag":164,"props":2597,"children":2598},{},[2599],{"type":45,"value":2510},{"type":39,"tag":164,"props":2601,"children":2603},{"class":166,"line":2602},21,[2604],{"type":39,"tag":164,"props":2605,"children":2606},{},[2607],{"type":45,"value":2518},{"type":39,"tag":164,"props":2609,"children":2611},{"class":166,"line":2610},22,[2612],{"type":39,"tag":164,"props":2613,"children":2614},{},[2615],{"type":45,"value":2616},"        \"Description\": \"Error log subscription\",\n",{"type":39,"tag":164,"props":2618,"children":2620},{"class":166,"line":2619},23,[2621],{"type":39,"tag":164,"props":2622,"children":2623},{},[2624],{"type":45,"value":2625},"        \"SinkSid\": sink[\"sid\"],\n",{"type":39,"tag":164,"props":2627,"children":2629},{"class":166,"line":2628},24,[2630],{"type":39,"tag":164,"props":2631,"children":2632},{},[2633],{"type":45,"value":2634},"        \"Types\": '[{\"type\": \"com.twilio.error-logs.error.logged\"}]'\n",{"type":39,"tag":164,"props":2636,"children":2637},{"class":166,"line":23},[2638],{"type":39,"tag":164,"props":2639,"children":2640},{},[2641],{"type":45,"value":2550},{"type":39,"tag":164,"props":2643,"children":2645},{"class":166,"line":2644},26,[2646],{"type":39,"tag":164,"props":2647,"children":2648},{},[2649],{"type":45,"value":985},{"type":39,"tag":48,"props":2651,"children":2652},{},[2653,2655,2661,2662,2668,2669,2675],{"type":45,"value":2654},"Sink types: ",{"type":39,"tag":74,"props":2656,"children":2658},{"className":2657},[],[2659],{"type":45,"value":2660},"webhook",{"type":45,"value":607},{"type":39,"tag":74,"props":2663,"children":2665},{"className":2664},[],[2666],{"type":45,"value":2667},"kinesis",{"type":45,"value":607},{"type":39,"tag":74,"props":2670,"children":2672},{"className":2671},[],[2673],{"type":45,"value":2674},"segment",{"type":45,"value":2676},". Subscriptions filter which event types route to which sinks.",{"type":39,"tag":483,"props":2678,"children":2680},{"id":2679},"_8-http-authentication-for-webhook-urls",[2681],{"type":45,"value":2682},"8. HTTP Authentication for Webhook URLs",{"type":39,"tag":48,"props":2684,"children":2685},{},[2686],{"type":45,"value":2687},"Twilio supports HTTP Basic and Digest authentication. Embed credentials in the URL:",{"type":39,"tag":153,"props":2689,"children":2692},{"className":2690,"code":2691,"language":45,"meta":158},[1907],"https:\u002F\u002Fusername:password@yourapp.com\u002Fsms\n",[2693],{"type":39,"tag":74,"props":2694,"children":2695},{"__ignoreMap":158},[2696],{"type":45,"value":2691},{"type":39,"tag":48,"props":2698,"children":2699},{},[2700],{"type":45,"value":2701},"This provides an additional layer of protection beyond signature validation. Note: these credentials are visible in Console webhook configuration and may appear in server access logs -- rotate them independently of your Auth Token.",{"type":39,"tag":54,"props":2703,"children":2704},{},[],{"type":39,"tag":40,"props":2706,"children":2708},{"id":2707},"common-webhook-parameters",[2709],{"type":45,"value":2710},"Common Webhook Parameters",{"type":39,"tag":483,"props":2712,"children":2714},{"id":2713},"inbound-sms",[2715],{"type":45,"value":2716},"Inbound SMS",{"type":39,"tag":490,"props":2718,"children":2719},{},[2720,2734],{"type":39,"tag":494,"props":2721,"children":2722},{},[2723],{"type":39,"tag":498,"props":2724,"children":2725},{},[2726,2730],{"type":39,"tag":502,"props":2727,"children":2728},{},[2729],{"type":45,"value":1593},{"type":39,"tag":502,"props":2731,"children":2732},{},[2733],{"type":45,"value":1613},{"type":39,"tag":523,"props":2735,"children":2736},{},[2737,2754,2771,2788,2805,2822,2839,2856],{"type":39,"tag":498,"props":2738,"children":2739},{},[2740,2749],{"type":39,"tag":530,"props":2741,"children":2742},{},[2743],{"type":39,"tag":74,"props":2744,"children":2746},{"className":2745},[],[2747],{"type":45,"value":2748},"MessageSid",{"type":39,"tag":530,"props":2750,"children":2751},{},[2752],{"type":45,"value":2753},"Unique message identifier",{"type":39,"tag":498,"props":2755,"children":2756},{},[2757,2766],{"type":39,"tag":530,"props":2758,"children":2759},{},[2760],{"type":39,"tag":74,"props":2761,"children":2763},{"className":2762},[],[2764],{"type":45,"value":2765},"AccountSid",{"type":39,"tag":530,"props":2767,"children":2768},{},[2769],{"type":45,"value":2770},"Your Twilio account SID",{"type":39,"tag":498,"props":2772,"children":2773},{},[2774,2783],{"type":39,"tag":530,"props":2775,"children":2776},{},[2777],{"type":39,"tag":74,"props":2778,"children":2780},{"className":2779},[],[2781],{"type":45,"value":2782},"From",{"type":39,"tag":530,"props":2784,"children":2785},{},[2786],{"type":45,"value":2787},"Sender phone number (E.164)",{"type":39,"tag":498,"props":2789,"children":2790},{},[2791,2800],{"type":39,"tag":530,"props":2792,"children":2793},{},[2794],{"type":39,"tag":74,"props":2795,"children":2797},{"className":2796},[],[2798],{"type":45,"value":2799},"To",{"type":39,"tag":530,"props":2801,"children":2802},{},[2803],{"type":45,"value":2804},"Your Twilio number",{"type":39,"tag":498,"props":2806,"children":2807},{},[2808,2817],{"type":39,"tag":530,"props":2809,"children":2810},{},[2811],{"type":39,"tag":74,"props":2812,"children":2814},{"className":2813},[],[2815],{"type":45,"value":2816},"Body",{"type":39,"tag":530,"props":2818,"children":2819},{},[2820],{"type":45,"value":2821},"Message text",{"type":39,"tag":498,"props":2823,"children":2824},{},[2825,2834],{"type":39,"tag":530,"props":2826,"children":2827},{},[2828],{"type":39,"tag":74,"props":2829,"children":2831},{"className":2830},[],[2832],{"type":45,"value":2833},"NumMedia",{"type":39,"tag":530,"props":2835,"children":2836},{},[2837],{"type":45,"value":2838},"Number of media attachments",{"type":39,"tag":498,"props":2840,"children":2841},{},[2842,2851],{"type":39,"tag":530,"props":2843,"children":2844},{},[2845],{"type":39,"tag":74,"props":2846,"children":2848},{"className":2847},[],[2849],{"type":45,"value":2850},"MediaUrl0..N",{"type":39,"tag":530,"props":2852,"children":2853},{},[2854],{"type":45,"value":2855},"URL of each media attachment",{"type":39,"tag":498,"props":2857,"children":2858},{},[2859,2868],{"type":39,"tag":530,"props":2860,"children":2861},{},[2862],{"type":39,"tag":74,"props":2863,"children":2865},{"className":2864},[],[2866],{"type":45,"value":2867},"MediaContentType0..N",{"type":39,"tag":530,"props":2869,"children":2870},{},[2871],{"type":45,"value":2872},"MIME type of each attachment",{"type":39,"tag":483,"props":2874,"children":2876},{"id":2875},"inbound-voice-call",[2877],{"type":45,"value":2878},"Inbound Voice Call",{"type":39,"tag":490,"props":2880,"children":2881},{},[2882,2896],{"type":39,"tag":494,"props":2883,"children":2884},{},[2885],{"type":39,"tag":498,"props":2886,"children":2887},{},[2888,2892],{"type":39,"tag":502,"props":2889,"children":2890},{},[2891],{"type":45,"value":1593},{"type":39,"tag":502,"props":2893,"children":2894},{},[2895],{"type":45,"value":1613},{"type":39,"tag":523,"props":2897,"children":2898},{},[2899,2916,2931,2947,2962,3028,3049],{"type":39,"tag":498,"props":2900,"children":2901},{},[2902,2911],{"type":39,"tag":530,"props":2903,"children":2904},{},[2905],{"type":39,"tag":74,"props":2906,"children":2908},{"className":2907},[],[2909],{"type":45,"value":2910},"CallSid",{"type":39,"tag":530,"props":2912,"children":2913},{},[2914],{"type":45,"value":2915},"Unique call identifier",{"type":39,"tag":498,"props":2917,"children":2918},{},[2919,2927],{"type":39,"tag":530,"props":2920,"children":2921},{},[2922],{"type":39,"tag":74,"props":2923,"children":2925},{"className":2924},[],[2926],{"type":45,"value":2765},{"type":39,"tag":530,"props":2928,"children":2929},{},[2930],{"type":45,"value":2770},{"type":39,"tag":498,"props":2932,"children":2933},{},[2934,2942],{"type":39,"tag":530,"props":2935,"children":2936},{},[2937],{"type":39,"tag":74,"props":2938,"children":2940},{"className":2939},[],[2941],{"type":45,"value":2782},{"type":39,"tag":530,"props":2943,"children":2944},{},[2945],{"type":45,"value":2946},"Caller phone number (E.164)",{"type":39,"tag":498,"props":2948,"children":2949},{},[2950,2958],{"type":39,"tag":530,"props":2951,"children":2952},{},[2953],{"type":39,"tag":74,"props":2954,"children":2956},{"className":2955},[],[2957],{"type":45,"value":2799},{"type":39,"tag":530,"props":2959,"children":2960},{},[2961],{"type":45,"value":2804},{"type":39,"tag":498,"props":2963,"children":2964},{},[2965,2974],{"type":39,"tag":530,"props":2966,"children":2967},{},[2968],{"type":39,"tag":74,"props":2969,"children":2971},{"className":2970},[],[2972],{"type":45,"value":2973},"CallStatus",{"type":39,"tag":530,"props":2975,"children":2976},{},[2977,2982,2983,2988,2989,2995,2996,3001,3002,3008,3009,3014,3015,3021,3022],{"type":39,"tag":74,"props":2978,"children":2980},{"className":2979},[],[2981],{"type":45,"value":1114},{"type":45,"value":607},{"type":39,"tag":74,"props":2984,"children":2986},{"className":2985},[],[2987],{"type":45,"value":1186},{"type":45,"value":607},{"type":39,"tag":74,"props":2990,"children":2992},{"className":2991},[],[2993],{"type":45,"value":2994},"in-progress",{"type":45,"value":607},{"type":39,"tag":74,"props":2997,"children":2999},{"className":2998},[],[3000],{"type":45,"value":1200},{"type":45,"value":607},{"type":39,"tag":74,"props":3003,"children":3005},{"className":3004},[],[3006],{"type":45,"value":3007},"busy",{"type":45,"value":607},{"type":39,"tag":74,"props":3010,"children":3012},{"className":3011},[],[3013],{"type":45,"value":1144},{"type":45,"value":607},{"type":39,"tag":74,"props":3016,"children":3018},{"className":3017},[],[3019],{"type":45,"value":3020},"no-answer",{"type":45,"value":607},{"type":39,"tag":74,"props":3023,"children":3025},{"className":3024},[],[3026],{"type":45,"value":3027},"canceled",{"type":39,"tag":498,"props":3029,"children":3030},{},[3031,3040],{"type":39,"tag":530,"props":3032,"children":3033},{},[3034],{"type":39,"tag":74,"props":3035,"children":3037},{"className":3036},[],[3038],{"type":45,"value":3039},"Direction",{"type":39,"tag":530,"props":3041,"children":3042},{},[3043],{"type":39,"tag":74,"props":3044,"children":3046},{"className":3045},[],[3047],{"type":45,"value":3048},"inbound",{"type":39,"tag":498,"props":3050,"children":3051},{},[3052,3061],{"type":39,"tag":530,"props":3053,"children":3054},{},[3055],{"type":39,"tag":74,"props":3056,"children":3058},{"className":3057},[],[3059],{"type":45,"value":3060},"ForwardedFrom",{"type":39,"tag":530,"props":3062,"children":3063},{},[3064],{"type":45,"value":3065},"Number that forwarded the call (if applicable)",{"type":39,"tag":483,"props":3067,"children":3069},{"id":3068},"message-status-callback",[3070],{"type":45,"value":3071},"Message Status Callback",{"type":39,"tag":490,"props":3073,"children":3074},{},[3075,3089],{"type":39,"tag":494,"props":3076,"children":3077},{},[3078],{"type":39,"tag":498,"props":3079,"children":3080},{},[3081,3085],{"type":39,"tag":502,"props":3082,"children":3083},{},[3084],{"type":45,"value":1593},{"type":39,"tag":502,"props":3086,"children":3087},{},[3088],{"type":45,"value":1613},{"type":39,"tag":523,"props":3090,"children":3091},{},[3092,3107,3171,3201],{"type":39,"tag":498,"props":3093,"children":3094},{},[3095,3103],{"type":39,"tag":530,"props":3096,"children":3097},{},[3098],{"type":39,"tag":74,"props":3099,"children":3101},{"className":3100},[],[3102],{"type":45,"value":2748},{"type":39,"tag":530,"props":3104,"children":3105},{},[3106],{"type":45,"value":2753},{"type":39,"tag":498,"props":3108,"children":3109},{},[3110,3119],{"type":39,"tag":530,"props":3111,"children":3112},{},[3113],{"type":39,"tag":74,"props":3114,"children":3116},{"className":3115},[],[3117],{"type":45,"value":3118},"MessageStatus",{"type":39,"tag":530,"props":3120,"children":3121},{},[3122,3127,3128,3133,3134,3140,3141,3146,3147,3152,3153,3158,3159,3164,3165],{"type":39,"tag":74,"props":3123,"children":3125},{"className":3124},[],[3126],{"type":45,"value":1156},{"type":45,"value":607},{"type":39,"tag":74,"props":3129,"children":3131},{"className":3130},[],[3132],{"type":45,"value":1114},{"type":45,"value":607},{"type":39,"tag":74,"props":3135,"children":3137},{"className":3136},[],[3138],{"type":45,"value":3139},"sending",{"type":45,"value":607},{"type":39,"tag":74,"props":3142,"children":3144},{"className":3143},[],[3145],{"type":45,"value":1122},{"type":45,"value":607},{"type":39,"tag":74,"props":3148,"children":3150},{"className":3149},[],[3151],{"type":45,"value":1129},{"type":45,"value":607},{"type":39,"tag":74,"props":3154,"children":3156},{"className":3155},[],[3157],{"type":45,"value":1137},{"type":45,"value":607},{"type":39,"tag":74,"props":3160,"children":3162},{"className":3161},[],[3163],{"type":45,"value":1144},{"type":45,"value":607},{"type":39,"tag":74,"props":3166,"children":3168},{"className":3167},[],[3169],{"type":45,"value":3170},"read",{"type":39,"tag":498,"props":3172,"children":3173},{},[3174,3183],{"type":39,"tag":530,"props":3175,"children":3176},{},[3177],{"type":39,"tag":74,"props":3178,"children":3180},{"className":3179},[],[3181],{"type":45,"value":3182},"ErrorCode",{"type":39,"tag":530,"props":3184,"children":3185},{},[3186,3188,3193,3195,3200],{"type":45,"value":3187},"Twilio error code (present on ",{"type":39,"tag":74,"props":3189,"children":3191},{"className":3190},[],[3192],{"type":45,"value":1144},{"type":45,"value":3194},"\u002F",{"type":39,"tag":74,"props":3196,"children":3198},{"className":3197},[],[3199],{"type":45,"value":1137},{"type":45,"value":615},{"type":39,"tag":498,"props":3202,"children":3203},{},[3204,3213],{"type":39,"tag":530,"props":3205,"children":3206},{},[3207],{"type":39,"tag":74,"props":3208,"children":3210},{"className":3209},[],[3211],{"type":45,"value":3212},"ErrorMessage",{"type":39,"tag":530,"props":3214,"children":3215},{},[3216],{"type":45,"value":3217},"Human-readable error description",{"type":39,"tag":483,"props":3219,"children":3221},{"id":3220},"debugger-event-callback",[3222],{"type":45,"value":3223},"Debugger Event Callback",{"type":39,"tag":490,"props":3225,"children":3226},{},[3227,3241],{"type":39,"tag":494,"props":3228,"children":3229},{},[3230],{"type":39,"tag":498,"props":3231,"children":3232},{},[3233,3237],{"type":39,"tag":502,"props":3234,"children":3235},{},[3236],{"type":45,"value":1593},{"type":39,"tag":502,"props":3238,"children":3239},{},[3240],{"type":45,"value":1613},{"type":39,"tag":523,"props":3242,"children":3243},{},[3244,3261,3277,3305,3322],{"type":39,"tag":498,"props":3245,"children":3246},{},[3247,3256],{"type":39,"tag":530,"props":3248,"children":3249},{},[3250],{"type":39,"tag":74,"props":3251,"children":3253},{"className":3252},[],[3254],{"type":45,"value":3255},"Sid",{"type":39,"tag":530,"props":3257,"children":3258},{},[3259],{"type":45,"value":3260},"Debugger event identifier",{"type":39,"tag":498,"props":3262,"children":3263},{},[3264,3272],{"type":39,"tag":530,"props":3265,"children":3266},{},[3267],{"type":39,"tag":74,"props":3268,"children":3270},{"className":3269},[],[3271],{"type":45,"value":2765},{"type":39,"tag":530,"props":3273,"children":3274},{},[3275],{"type":45,"value":3276},"Account that generated the event",{"type":39,"tag":498,"props":3278,"children":3279},{},[3280,3289],{"type":39,"tag":530,"props":3281,"children":3282},{},[3283],{"type":39,"tag":74,"props":3284,"children":3286},{"className":3285},[],[3287],{"type":45,"value":3288},"Level",{"type":39,"tag":530,"props":3290,"children":3291},{},[3292,3298,3299],{"type":39,"tag":74,"props":3293,"children":3295},{"className":3294},[],[3296],{"type":45,"value":3297},"Error",{"type":45,"value":573},{"type":39,"tag":74,"props":3300,"children":3302},{"className":3301},[],[3303],{"type":45,"value":3304},"Warning",{"type":39,"tag":498,"props":3306,"children":3307},{},[3308,3317],{"type":39,"tag":530,"props":3309,"children":3310},{},[3311],{"type":39,"tag":74,"props":3312,"children":3314},{"className":3313},[],[3315],{"type":45,"value":3316},"Timestamp",{"type":39,"tag":530,"props":3318,"children":3319},{},[3320],{"type":45,"value":3321},"ISO 8601 time of occurrence",{"type":39,"tag":498,"props":3323,"children":3324},{},[3325,3334],{"type":39,"tag":530,"props":3326,"children":3327},{},[3328],{"type":39,"tag":74,"props":3329,"children":3331},{"className":3330},[],[3332],{"type":45,"value":3333},"Payload",{"type":39,"tag":530,"props":3335,"children":3336},{},[3337,3339,3345,3346,3352,3353,3359,3360,3365],{"type":45,"value":3338},"JSON with ",{"type":39,"tag":74,"props":3340,"children":3342},{"className":3341},[],[3343],{"type":45,"value":3344},"resource_sid",{"type":45,"value":607},{"type":39,"tag":74,"props":3347,"children":3349},{"className":3348},[],[3350],{"type":45,"value":3351},"error_code",{"type":45,"value":607},{"type":39,"tag":74,"props":3354,"children":3356},{"className":3355},[],[3357],{"type":45,"value":3358},"more_info",{"type":45,"value":607},{"type":39,"tag":74,"props":3361,"children":3363},{"className":3362},[],[3364],{"type":45,"value":2660},{"type":45,"value":3366}," (request\u002Fresponse details)",{"type":39,"tag":54,"props":3368,"children":3369},{},[],{"type":39,"tag":40,"props":3371,"children":3373},{"id":3372},"cannot",[3374],{"type":45,"value":3375},"CANNOT",{"type":39,"tag":64,"props":3377,"children":3378},{},[3379,3389,3399,3409,3445,3470],{"type":39,"tag":68,"props":3380,"children":3381},{},[3382,3387],{"type":39,"tag":147,"props":3383,"children":3384},{},[3385],{"type":45,"value":3386},"Cannot exceed 15-second voice webhook response time",{"type":45,"value":3388}," — Twilio hangs up or falls back. Messaging webhooks retry on timeout.",{"type":39,"tag":68,"props":3390,"children":3391},{},[3392,3397],{"type":39,"tag":147,"props":3393,"children":3394},{},[3395],{"type":45,"value":3396},"Cannot use HTTP in production",{"type":45,"value":3398}," — HTTPS required. No self-signed certificates. Do not pin Twilio certificates — they rotate without notice.",{"type":39,"tag":68,"props":3400,"children":3401},{},[3402,3407],{"type":39,"tag":147,"props":3403,"children":3404},{},[3405],{"type":45,"value":3406},"Cannot allowlist Twilio by IP",{"type":45,"value":3408}," — Webhooks come from dynamic IPs. Use signature validation instead.",{"type":39,"tag":68,"props":3410,"children":3411},{},[3412,3417,3419,3424,3426,3431,3432,3437,3438,3443],{"type":39,"tag":147,"props":3413,"children":3414},{},[3415],{"type":45,"value":3416},"Cannot guarantee status callback delivery or order",{"type":45,"value":3418}," — Best-effort. Implement idempotency using ",{"type":39,"tag":74,"props":3420,"children":3422},{"className":3421},[],[3423],{"type":45,"value":2748},{"type":45,"value":3425}," + ",{"type":39,"tag":74,"props":3427,"children":3429},{"className":3428},[],[3430],{"type":45,"value":3118},{"type":45,"value":573},{"type":39,"tag":74,"props":3433,"children":3435},{"className":3434},[],[3436],{"type":45,"value":2910},{"type":45,"value":3425},{"type":39,"tag":74,"props":3439,"children":3441},{"className":3440},[],[3442],{"type":45,"value":2973},{"type":45,"value":3444}," as composite keys.",{"type":39,"tag":68,"props":3446,"children":3447},{},[3448,3453,3455,3461,3462,3468],{"type":39,"tag":147,"props":3449,"children":3450},{},[3451],{"type":45,"value":3452},"Cannot redirect without losing POST parameters",{"type":45,"value":3454}," — HTTP 301\u002F302 redirects cause Twilio to follow with GET, dropping ",{"type":39,"tag":74,"props":3456,"children":3458},{"className":3457},[],[3459],{"type":45,"value":3460},"Digits",{"type":45,"value":607},{"type":39,"tag":74,"props":3463,"children":3465},{"className":3464},[],[3466],{"type":45,"value":3467},"RecordingUrl",{"type":45,"value":3469},", etc.",{"type":39,"tag":68,"props":3471,"children":3472},{},[3473,3478],{"type":39,"tag":147,"props":3474,"children":3475},{},[3476],{"type":45,"value":3477},"Cannot use connection overrides on Conversations or Frontline webhooks",{"type":45,"value":3479}," — Not supported for these products",{"type":39,"tag":54,"props":3481,"children":3482},{},[],{"type":39,"tag":40,"props":3484,"children":3486},{"id":3485},"next-steps",[3487],{"type":45,"value":3488},"Next Steps",{"type":39,"tag":64,"props":3490,"children":3491},{},[3492,3507,3522,3537,3552],{"type":39,"tag":68,"props":3493,"children":3494},{},[3495,3500,3501],{"type":39,"tag":147,"props":3496,"children":3497},{},[3498],{"type":45,"value":3499},"Receive inbound SMS:",{"type":45,"value":1108},{"type":39,"tag":74,"props":3502,"children":3504},{"className":3503},[],[3505],{"type":45,"value":3506},"twilio-messaging-webhooks",{"type":39,"tag":68,"props":3508,"children":3509},{},[3510,3515,3516],{"type":39,"tag":147,"props":3511,"children":3512},{},[3513],{"type":45,"value":3514},"Voice call handling:",{"type":45,"value":1108},{"type":39,"tag":74,"props":3517,"children":3519},{"className":3518},[],[3520],{"type":45,"value":3521},"twilio-voice-twiml",{"type":39,"tag":68,"props":3523,"children":3524},{},[3525,3530,3531],{"type":39,"tag":147,"props":3526,"children":3527},{},[3528],{"type":45,"value":3529},"Scale webhook handling:",{"type":45,"value":1108},{"type":39,"tag":74,"props":3532,"children":3534},{"className":3533},[],[3535],{"type":45,"value":3536},"twilio-reliability-patterns",{"type":39,"tag":68,"props":3538,"children":3539},{},[3540,3545,3546],{"type":39,"tag":147,"props":3541,"children":3542},{},[3543],{"type":45,"value":3544},"Debug webhook failures:",{"type":45,"value":1108},{"type":39,"tag":74,"props":3547,"children":3549},{"className":3548},[],[3550],{"type":45,"value":3551},"twilio-debugging-observability",{"type":39,"tag":68,"props":3553,"children":3554},{},[3555,3560,3561],{"type":39,"tag":147,"props":3556,"children":3557},{},[3558],{"type":45,"value":3559},"Secure credentials:",{"type":45,"value":1108},{"type":39,"tag":74,"props":3562,"children":3564},{"className":3563},[],[3565],{"type":45,"value":104},{"type":39,"tag":3567,"props":3568,"children":3569},"style",{},[3570],{"type":45,"value":3571},"html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"items":3573,"total":3751},[3574,3587,3607,3618,3630,3645,3662,3678,3692,3705,3721,3739],{"slug":79,"name":79,"fn":3575,"description":3576,"org":3577,"tags":3578,"stars":23,"repoUrl":24,"updatedAt":3586},"configure Twilio accounts and credentials","Create and configure a Twilio account from scratch. Covers free trial signup, trial limitations, getting credentials (Account SID and Auth Token), buying a phone number, verifying recipient numbers for trial use, SDK installation, first API call, subaccount management (creation, inheritance, credential isolation, limits), and enabling specific products (AI Assistants, Conversations, Verify, ConversationRelay, WhatsApp). Use this skill before any other Twilio skill if you do not yet have a Twilio account or need to enable a product. For Organization-level governance (SSO, SCIM, multi-team), see `twilio-organizations-setup`.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3579,3580,3583],{"name":17,"slug":18,"type":15},{"name":3581,"slug":3582,"type":15},"Communications","communications",{"name":3584,"slug":3585,"type":15},"SMS","sms","2026-08-01T05:43:28.968968",{"slug":3588,"name":3588,"fn":3589,"description":3590,"org":3591,"tags":3592,"stars":23,"repoUrl":24,"updatedAt":3606},"twilio-agent-augmentation-architect","augment human agents with AI intelligence","Planning skill for augmenting human agents with real-time AI intelligence. Qualifies the developer's use case across coaching, compliance, QA, and routing to recommend the right Conversation Intelligence + Conversation Memory + TaskRouter architecture. Handles both \"I want to add AI coaching to my call center\" and \"configure Conversation Intelligence operators for script adherence.\"\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3593,3596,3599,3602,3605],{"name":3594,"slug":3595,"type":15},"Agents","agents",{"name":3597,"slug":3598,"type":15},"AI","ai",{"name":3600,"slug":3601,"type":15},"Coaching","coaching",{"name":3603,"slug":3604,"type":15},"QA","qa",{"name":9,"slug":8,"type":15},"2026-07-17T06:07:58.250609",{"slug":3608,"name":3608,"fn":3609,"description":3610,"org":3611,"tags":3612,"stars":23,"repoUrl":24,"updatedAt":3617},"twilio-agent-connect","connect AI agents to Twilio channels","Connect third-party AI agents (OpenAI, Bedrock, LangChain, Microsoft Foundry) to Twilio's communication channels using the Twilio Agent Connect SDK. Covers identity resolution, memory and context management via Conversation Memory, conversation orchestration via Conversation Orchestrator, multi-channel handling (Voice, SMS, RCS, WhatsApp, Chat), and AI-to-human escalation. Use this skill when integrating an existing LLM agent with Twilio services.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3613,3614,3615,3616],{"name":3594,"slug":3595,"type":15},{"name":17,"slug":18,"type":15},{"name":3581,"slug":3582,"type":15},{"name":9,"slug":8,"type":15},"2026-07-17T06:06:05.217098",{"slug":3619,"name":3619,"fn":3620,"description":3621,"org":3622,"tags":3623,"stars":23,"repoUrl":24,"updatedAt":3629},"twilio-ai-agent-architect","plan Twilio conversational AI agents","Planning skill for AI-powered conversational agents. Qualifies the developer's use case across outcome sophistication, entry point, and customer profile to recommend the right Twilio Conversations architecture and implementation skills. Handles both high-level requests (\"build me a voice AI assistant\") and specific ones (\"integrate ConversationRelay with my OpenAI backend\").\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3624,3625,3628],{"name":3594,"slug":3595,"type":15},{"name":3626,"slug":3627,"type":15},"Architecture","architecture",{"name":9,"slug":8,"type":15},"2026-07-17T06:07:48.883723",{"slug":3631,"name":3631,"fn":3632,"description":3633,"org":3634,"tags":3635,"stars":23,"repoUrl":24,"updatedAt":3644},"twilio-call-recordings","record and manage Twilio voice calls","Record Twilio voice calls correctly. Covers the critical distinction between Record verb (voicemail) and Dial record (call recording), dual-channel for QA, mid-call pause for PCI, Conference recording, and the ConversationRelay workaround. Use this skill whenever you need to capture call audio for compliance, QA, or analytics.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3636,3639,3642,3643],{"name":3637,"slug":3638,"type":15},"Audio","audio",{"name":3640,"slug":3641,"type":15},"Compliance","compliance",{"name":3603,"slug":3604,"type":15},{"name":9,"slug":8,"type":15},"2026-07-17T06:07:55.268412",{"slug":3646,"name":3646,"fn":3647,"description":3648,"org":3649,"tags":3650,"stars":23,"repoUrl":24,"updatedAt":3661},"twilio-cli-reference","manage Twilio resources via CLI","Twilio CLI reference for managing Twilio resources from the terminal. Covers installation, credential profiles, phone number provisioning, sending SMS and email, webhook configuration, local development with a tunneling service, debugging with watch and logs, serverless deployment, and plugin ecosystem. Use when the developer asks to \"just do it\", \"set this up\", \"run a command\", mentions \"CLI\", \"command line\", or \"terminal\", or when an AI agent can execute a task directly instead of writing application code.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3651,3654,3657,3660],{"name":3652,"slug":3653,"type":15},"CLI","cli",{"name":3655,"slug":3656,"type":15},"Local Development","local-development",{"name":3658,"slug":3659,"type":15},"Operations","operations",{"name":9,"slug":8,"type":15},"2026-07-17T06:07:54.925664",{"slug":3663,"name":3663,"fn":3664,"description":3665,"org":3666,"tags":3667,"stars":23,"repoUrl":24,"updatedAt":3677},"twilio-compliance-onboarding","manage Twilio messaging and voice compliance","Registrations required BEFORE Twilio traffic works. Covers messaging programs (A2P 10DLC, toll-free verification, WhatsApp WABA, RCS, short code, alphanumeric sender) and voice trust programs (STIR\u002FSHAKEN, Voice Integrity, Branded Calling, CNAM). Each number\u002Fsender type has its own program — registration blocks traffic until complete.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3668,3669,3672,3673,3674],{"name":3640,"slug":3641,"type":15},{"name":3670,"slug":3671,"type":15},"Messaging","messaging",{"name":3584,"slug":3585,"type":15},{"name":9,"slug":8,"type":15},{"name":3675,"slug":3676,"type":15},"WhatsApp","whatsapp","2026-07-17T06:05:47.897229",{"slug":3679,"name":3679,"fn":3680,"description":3681,"org":3682,"tags":3683,"stars":23,"repoUrl":24,"updatedAt":3691},"twilio-compliance-traffic","ensure compliance for Twilio messaging traffic","Rules you must follow for Twilio messaging and voice traffic. Covers TCPA (consent tiers, quiet hours, DNC), GDPR (EU consent, right to deletion), PCI DSS (payment recording, Pay verb), HIPAA (BAA, PHI), FDCPA (debt collection limits), CAN-SPAM, WhatsApp policies, SHAKEN\u002FSTIR, and consent management patterns. Use this skill proactively when developers have working traffic to ensure they follow the rules.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3684,3685,3686,3689,3690],{"name":3640,"slug":3641,"type":15},{"name":3670,"slug":3671,"type":15},{"name":3687,"slug":3688,"type":15},"Regulatory Compliance","regulatory-compliance",{"name":13,"slug":14,"type":15},{"name":9,"slug":8,"type":15},"2026-07-17T06:07:55.952779",{"slug":3693,"name":3693,"fn":3694,"description":3695,"org":3696,"tags":3697,"stars":23,"repoUrl":24,"updatedAt":3704},"twilio-conference-calls","build multi-party calls with Twilio Conference","Build multi-party calls using Twilio Conference. Covers warm transfer, cold transfer, coaching (whisper), hold vs mute, participant modes, and supervisor barge. Use this skill for any contact center, support line, or scenario requiring transfers, holds, or multi-party calls.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3698,3699,3700,3703],{"name":3637,"slug":3638,"type":15},{"name":3581,"slug":3582,"type":15},{"name":3701,"slug":3702,"type":15},"Meetings","meetings",{"name":9,"slug":8,"type":15},"2026-07-17T06:07:55.603708",{"slug":3706,"name":3706,"fn":3707,"description":3708,"org":3709,"tags":3710,"stars":23,"repoUrl":24,"updatedAt":3720},"twilio-content-template-builder","create and send message templates with Twilio","Create, manage, and send message templates using Twilio's Content API. Covers template creation for WhatsApp, SMS, RCS, and MMS; variable usage; WhatsApp Meta approval; and sending templates via ContentSid. Use this skill when building structured messages that require pre-approval or consistent formatting across channels.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3711,3714,3715,3716,3719],{"name":3712,"slug":3713,"type":15},"Email","email",{"name":3670,"slug":3671,"type":15},{"name":3584,"slug":3585,"type":15},{"name":3717,"slug":3718,"type":15},"Templates","templates",{"name":9,"slug":8,"type":15},"2026-07-17T06:04:26.637309",{"slug":3722,"name":3722,"fn":3723,"description":3724,"org":3725,"tags":3726,"stars":23,"repoUrl":24,"updatedAt":3738},"twilio-conversation-intelligence","build conversation intelligence pipelines","Twilio Conversation Intelligence development guide. Use when building real-time or post-call conversation analysis, language operator pipelines, sentiment analysis, agent assist, cross-channel analytics, or querying aggregated conversation insights (sentiment trends, escalation rates, dashboards).",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3727,3728,3731,3734,3737],{"name":3594,"slug":3595,"type":15},{"name":3729,"slug":3730,"type":15},"Analytics","analytics",{"name":3732,"slug":3733,"type":15},"Monitoring","monitoring",{"name":3735,"slug":3736,"type":15},"NLP","nlp",{"name":9,"slug":8,"type":15},"2026-07-17T06:07:52.545387",{"slug":3740,"name":3740,"fn":3741,"description":3742,"org":3743,"tags":3744,"stars":23,"repoUrl":24,"updatedAt":3750},"twilio-conversation-memory","manage conversation memory with Twilio","Store and retrieve conversation context using Twilio Conversation Memory. Covers Memory Store provisioning, profile management, traits, observations, conversation summaries, and semantic Recall. Use this skill to give AI agents or human agents persistent memory of conversations across sessions and channels.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3745,3746,3749],{"name":3594,"slug":3595,"type":15},{"name":3747,"slug":3748,"type":15},"Memory","memory",{"name":9,"slug":8,"type":15},"2026-07-17T06:04:19.526724",57,{"items":3753,"total":3751},[3754,3760,3768,3775,3781,3788,3795],{"slug":79,"name":79,"fn":3575,"description":3576,"org":3755,"tags":3756,"stars":23,"repoUrl":24,"updatedAt":3586},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3757,3758,3759],{"name":17,"slug":18,"type":15},{"name":3581,"slug":3582,"type":15},{"name":3584,"slug":3585,"type":15},{"slug":3588,"name":3588,"fn":3589,"description":3590,"org":3761,"tags":3762,"stars":23,"repoUrl":24,"updatedAt":3606},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3763,3764,3765,3766,3767],{"name":3594,"slug":3595,"type":15},{"name":3597,"slug":3598,"type":15},{"name":3600,"slug":3601,"type":15},{"name":3603,"slug":3604,"type":15},{"name":9,"slug":8,"type":15},{"slug":3608,"name":3608,"fn":3609,"description":3610,"org":3769,"tags":3770,"stars":23,"repoUrl":24,"updatedAt":3617},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3771,3772,3773,3774],{"name":3594,"slug":3595,"type":15},{"name":17,"slug":18,"type":15},{"name":3581,"slug":3582,"type":15},{"name":9,"slug":8,"type":15},{"slug":3619,"name":3619,"fn":3620,"description":3621,"org":3776,"tags":3777,"stars":23,"repoUrl":24,"updatedAt":3629},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3778,3779,3780],{"name":3594,"slug":3595,"type":15},{"name":3626,"slug":3627,"type":15},{"name":9,"slug":8,"type":15},{"slug":3631,"name":3631,"fn":3632,"description":3633,"org":3782,"tags":3783,"stars":23,"repoUrl":24,"updatedAt":3644},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3784,3785,3786,3787],{"name":3637,"slug":3638,"type":15},{"name":3640,"slug":3641,"type":15},{"name":3603,"slug":3604,"type":15},{"name":9,"slug":8,"type":15},{"slug":3646,"name":3646,"fn":3647,"description":3648,"org":3789,"tags":3790,"stars":23,"repoUrl":24,"updatedAt":3661},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3791,3792,3793,3794],{"name":3652,"slug":3653,"type":15},{"name":3655,"slug":3656,"type":15},{"name":3658,"slug":3659,"type":15},{"name":9,"slug":8,"type":15},{"slug":3663,"name":3663,"fn":3664,"description":3665,"org":3796,"tags":3797,"stars":23,"repoUrl":24,"updatedAt":3677},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3798,3799,3800,3801,3802],{"name":3640,"slug":3641,"type":15},{"name":3670,"slug":3671,"type":15},{"name":3584,"slug":3585,"type":15},{"name":9,"slug":8,"type":15},{"name":3675,"slug":3676,"type":15}]