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