[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-openai-twilio-reliability-patterns":3,"mdc-qjbqwz-key":30,"related-org-openai-twilio-reliability-patterns":2077,"related-repo-openai-twilio-reliability-patterns":2282},{"slug":4,"name":4,"fn":5,"description":6,"org":7,"tags":11,"stars":19,"repoUrl":20,"updatedAt":21,"license":22,"forks":23,"topics":24,"repo":25,"sourceUrl":28,"mdContent":29},"twilio-reliability-patterns","implement Twilio reliability and resilience patterns","Handle rate limits, retries, and failures when building on Twilio at scale. Covers 429 exponential backoff with jitter, per-number throughput limits, StatusCallback resilience, thin-receiver pattern, and fallback chains. Use this skill whenever sending messages or making calls at volume, or when building production-grade Twilio integrations.\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],{"name":13,"slug":14,"type":15},"API Development","api-development","tag",{"name":17,"slug":18,"type":15},"Twilio","twilio",3992,"https:\u002F\u002Fgithub.com\u002Fopenai\u002Fplugins","2026-06-30T19:00:57.102",null,465,[],{"repoUrl":20,"stars":19,"forks":23,"topics":26,"description":27},[],"OpenAI Plugins","https:\u002F\u002Fgithub.com\u002Fopenai\u002Fplugins\u002Ftree\u002FHEAD\u002Fplugins\u002Ftwilio-developer-kit\u002Fskills\u002Ftwilio-reliability-patterns","---\nname: twilio-reliability-patterns\ndescription: >\n  Handle rate limits, retries, and failures when building on Twilio at\n  scale. Covers 429 exponential backoff with jitter, per-number throughput\n  limits, StatusCallback resilience, thin-receiver pattern, and fallback\n  chains. Use this skill whenever sending messages or making calls at\n  volume, or when building production-grade Twilio integrations.\n---\n\n## Overview\n\nTwilio enforces per-resource rate limits. At scale, 429 errors are expected behavior — not bugs. This skill teaches the patterns that prevent production failures: exponential backoff, throughput management, and resilient callback handling.\n\n429 concurrency errors are not well documented — implement exponential backoff with ±10% jitter.\n\n---\n\n## Prerequisites\n\n- A working Twilio integration (any product)\n- Understanding of your expected volume (messages\u002Fsec, calls\u002Fsec)\n- StatusCallback URLs configured — see `twilio-messaging-services`, `twilio-sms-send-message`\n\n---\n\n## Key Patterns\n\n### 1. Exponential Backoff with Jitter\n\nWhen you receive a 429 (Too Many Requests), wait and retry. Naive fixed-interval retry creates thundering herds. Use exponential backoff with randomized jitter.\n\n**Python**\n```python\nimport time, random, requests\n\ndef send_with_backoff(client, to, body, messaging_service_sid, max_retries=5):\n    for attempt in range(max_retries):\n        try:\n            message = client.messages.create(\n                to=to,\n                body=body,\n                messaging_service_sid=messaging_service_sid,\n                status_callback=\"https:\u002F\u002Fyourapp.com\u002Fstatus\"\n            )\n            return message\n        except Exception as e:\n            if hasattr(e, 'status') and e.status == 429:\n                # Exponential backoff: 100ms, 200ms, 400ms, 800ms, 1600ms\n                base_delay = 0.1 * (2 ** attempt)\n                # Add ±10% jitter to prevent thundering herd\n                jitter = base_delay * 0.1 * (2 * random.random() - 1)\n                delay = min(base_delay + jitter, 30)  # cap at 30 seconds\n                time.sleep(delay)\n            else:\n                raise  # Non-429 errors: don't retry, investigate\n    raise Exception(f\"Failed after {max_retries} retries\")\n```\n\n**Node.js**\n```node\nasync function sendWithBackoff(client, to, body, messagingServiceSid, maxRetries = 5) {\n    for (let attempt = 0; attempt \u003C maxRetries; attempt++) {\n        try {\n            return await client.messages.create({\n                to,\n                body,\n                messagingServiceSid,\n                statusCallback: \"https:\u002F\u002Fyourapp.com\u002Fstatus\",\n            });\n        } catch (err) {\n            if (err.status === 429) {\n                \u002F\u002F Exponential backoff: 100ms, 200ms, 400ms, 800ms, 1600ms\n                const baseDelay = 100 * Math.pow(2, attempt);\n                \u002F\u002F Add ±10% jitter\n                const jitter = baseDelay * 0.1 * (2 * Math.random() - 1);\n                const delay = Math.min(baseDelay + jitter, 30000); \u002F\u002F cap at 30s\n                await new Promise(r => setTimeout(r, delay));\n            } else {\n                throw err; \u002F\u002F Non-429: don't retry\n            }\n        }\n    }\n    throw new Error(`Failed after ${maxRetries} retries`);\n}\n```\n\n**Parameters:**\n- Initial delay: 100ms\n- Multiplier: 2x per attempt\n- Jitter: ±10% of base delay (randomized)\n- Max delay: 30 seconds\n- Max retries: 5 (covers up to ~3.2 second base delay)\n\n### 2. Per-Number Throughput Limits\n\nThese limits are not prominently documented:\n\n| Number type | SMS throughput | Voice throughput | Notes |\n|-------------|---------------|-----------------|-------|\n| Local (long code) | ~1 SMS\u002Fsec | 1 concurrent call | Lowest cost, lowest throughput |\n| Toll-free | ~3 SMS\u002Fsec | — | Faster verification (3-5 days) |\n| Short code | 10-100 SMS\u002Fsec | — | Highest throughput, 8-12 week provisioning, expensive |\n| Messaging Service (pool) | Sum of all numbers in pool | — | Multiply throughput by adding numbers |\n\n**Throughput opacity:** Sending velocity and queue depth are opaque — there is no dashboard showing messages per second. Use Messaging Services to multiply throughput by pooling numbers. A pool of 10 long codes = ~10 SMS\u002Fsec.\n\n### 3. Bulk Send Pattern\n\nFor sending to large lists, use a rate-limited dispatch loop:\n\n**Python**\n```python\nimport asyncio\nfrom collections import deque\n\nasync def bulk_send(client, recipients, body, messaging_service_sid, rate_per_second=10):\n    \"\"\"Send to a list of recipients with rate limiting and backoff.\"\"\"\n    queue = deque(recipients)\n    results = []\n    \n    while queue:\n        batch = []\n        for _ in range(min(rate_per_second, len(queue))):\n            batch.append(queue.popleft())\n        \n        for recipient in batch:\n            try:\n                msg = send_with_backoff(client, recipient, body, messaging_service_sid)\n                results.append({\"to\": recipient, \"sid\": msg.sid, \"status\": \"sent\"})\n            except Exception as e:\n                results.append({\"to\": recipient, \"error\": str(e), \"status\": \"failed\"})\n        \n        if queue:  # Don't sleep after last batch\n            await asyncio.sleep(1)  # 1 second between batches\n    \n    return results\n```\n\n**Key:** Set `rate_per_second` based on your number pool size, not your desired speed. Sending faster than your pool supports just generates 429s.\n\n> **Compliance:** Before bulk sending, verify recipient consent (opt-in records), respect quiet hours, and implement maximum batch size limits. Monitor for anomalous send patterns that could indicate abuse.\n\n### 4. StatusCallback Resilience\n\nAt scale, StatusCallbacks create their own load problem.\n\n**The math:** 50 concurrent calls × 6 status events per call = 300 webhook invocations per second. Twilio Functions allow 30 concurrent executions per service.\n\n**Thin-receiver pattern** — receive, queue, respond immediately:\n\n**Node.js (Express)**\n```node\nconst { Queue } = require(\"bullmq\");\nconst statusQueue = new Queue(\"twilio-status\");\n\n\u002F\u002F Thin receiver: accept callback, queue it, respond 200 immediately\napp.post(\"\u002Fstatus\", async (req, res) => {\n    await statusQueue.add(\"status-event\", {\n        callSid: req.body.CallSid,\n        callStatus: req.body.CallStatus,\n        timestamp: Date.now(),\n    });\n    res.sendStatus(200);  \u002F\u002F Respond FAST — Twilio will retry on timeout\n});\n\n\u002F\u002F Process asynchronously\nconst worker = new Worker(\"twilio-status\", async (job) => {\n    const { callSid, callStatus } = job.data;\n    await updateDatabase(callSid, callStatus);\n});\n```\n\n**Python (Flask + Celery)**\n```python\n@app.route(\"\u002Fstatus\", methods=[\"POST\"])\ndef status_callback():\n    # Queue for async processing\n    process_status.delay(\n        call_sid=request.form[\"CallSid\"],\n        call_status=request.form[\"CallStatus\"]\n    )\n    return \"\", 200  # Respond FAST\n\n@celery.task\ndef process_status(call_sid, call_status):\n    update_database(call_sid, call_status)\n```\n\n**Idempotency key:** Use `{CallSid}-{CallStatus}` as a composite key. Twilio retries on timeout, which can cause duplicate callbacks. Deduplicate before processing.\n\n### 5. Fallback Chains\n\nWhen delivery on one channel fails, escalate to the next:\n\n**Python**\n```python\nasync def send_with_fallback(client, to, message, messaging_service_sid):\n    \"\"\"Try SMS → Voice → Email fallback chain.\"\"\"\n    \n    # Try SMS first\n    try:\n        msg = client.messages.create(\n            to=to, body=message, messaging_service_sid=messaging_service_sid,\n            status_callback=\"https:\u002F\u002Fyourapp.com\u002Fstatus\"\n        )\n        # Wait for delivery confirmation via StatusCallback\n        # If undelivered after timeout, fall through to voice\n        return {\"channel\": \"sms\", \"sid\": msg.sid}\n    except Exception:\n        pass  # SMS failed, try voice\n    \n    # Fallback to voice\n    try:\n        call = client.calls.create(\n            to=to, from_=\"+15551234567\",\n            twiml=f\"\u003CResponse>\u003CSay>{message}\u003C\u002FSay>\u003C\u002FResponse>\",\n            status_callback=\"https:\u002F\u002Fyourapp.com\u002Fcall-status\"\n        )\n        return {\"channel\": \"voice\", \"sid\": call.sid}\n    except Exception:\n        pass  # Voice failed, try email\n    \n    # Last resort: email\n    # Use SendGrid — see twilio-sendgrid-email\n    return {\"channel\": \"email\", \"status\": \"queued\"}\n```\n\n### 6. Voice Concurrency Limits\n\n| Resource | Default limit | Notes |\n|----------|--------------|-------|\n| Concurrent calls per account | 1 (trial) \u002F variable (paid) | Request increase via support |\n| Calls per second (CPS) | 1 CPS (default) | Increase via support for outbound campaigns |\n| Conference participants | 250 per conference | |\n| Twilio Functions concurrent | 30 per service | Use thin-receiver pattern above |\n\nFor outbound campaigns, request CPS increase before launch — not during.\n\n### 7. Webhook Timeout Handling\n\nTwilio expects a response within **15 seconds** for voice webhooks and **15 seconds** for messaging webhooks. If your endpoint doesn't respond:\n- Voice: Twilio hangs up or falls back to `voiceFallbackUrl`\n- Messaging: Twilio retries the callback\n\n**Always configure fallback URLs:**\n```python\n# On phone number configuration\nnumber = client.incoming_phone_numbers(phone_sid).update(\n    voice_url=\"https:\u002F\u002Fyourapp.com\u002Fvoice\",\n    voice_fallback_url=\"https:\u002F\u002Fyourapp.com\u002Fvoice-fallback\",  # backup endpoint\n    sms_url=\"https:\u002F\u002Fyourapp.com\u002Fsms\",\n    sms_fallback_url=\"https:\u002F\u002Fyourapp.com\u002Fsms-fallback\"\n)\n```\n\n---\n\n## Monitoring Checklist\n\nSet up these alerts before going to production:\n\n| Metric | Alert threshold | How to track |\n|--------|----------------|-------------|\n| 429 error rate | > 5% of requests | Count 429s in your backoff handler |\n| Delivery failure rate | > 2% of messages | StatusCallback `failed`\u002F`undelivered` events |\n| Webhook response time | > 5 seconds p95 | Your APM tool (DataDog, New Relic) |\n| Queue depth | Growing over 5 minutes | Your message queue metrics |\n| Concurrent calls | > 80% of limit | Twilio Usage API or Event Streams |\n\nTwilio's built-in alerting systems are under-used — end-users often discover issues before developers do. Configure StatusCallbacks + Event Streams for delivery failure alerts on every integration.\n\n---\n\n## CANNOT\n\n- **Cannot avoid 429 errors on any Twilio API** — Backoff patterns apply to all APIs (Messaging, Voice, Verify, Lookup)\n- **Cannot increase per-number throughput** — Add more numbers via Messaging Services instead\n- **Cannot configure StatusCallback retry behavior** — Twilio retries on timeout automatically; not configurable\n- **Cannot exceed Twilio Functions limits** — 30 concurrent executions\u002Fservice, 10-second timeout, 256 MB memory\n- **Cannot use a native Twilio rate limiting API** — You must implement rate limiting in your application\n\n---\n\n## Next Steps\n\n- **Messaging at scale:** `twilio-messaging-services`\n- **Monitor delivery:** `twilio-sms-send-message` (StatusCallbacks)\n- **Debug failures:** `twilio-debugging-observability`\n- **Compliance for bulk sends:** `twilio-compliance-traffic`\n",{"data":31,"body":32},{"name":4,"description":6},{"type":33,"children":34},"root",[35,44,50,55,59,65,100,103,109,116,121,130,351,359,561,569,597,603,608,736,746,752,757,764,960,978,992,998,1003,1013,1023,1031,1179,1187,1289,1307,1313,1318,1325,1563,1569,1665,1670,1676,1694,1713,1721,1784,1787,1793,1798,1931,1936,1939,1945,1998,2001,2007,2071],{"type":36,"tag":37,"props":38,"children":40},"element","h2",{"id":39},"overview",[41],{"type":42,"value":43},"text","Overview",{"type":36,"tag":45,"props":46,"children":47},"p",{},[48],{"type":42,"value":49},"Twilio enforces per-resource rate limits. At scale, 429 errors are expected behavior — not bugs. This skill teaches the patterns that prevent production failures: exponential backoff, throughput management, and resilient callback handling.",{"type":36,"tag":45,"props":51,"children":52},{},[53],{"type":42,"value":54},"429 concurrency errors are not well documented — implement exponential backoff with ±10% jitter.",{"type":36,"tag":56,"props":57,"children":58},"hr",{},[],{"type":36,"tag":37,"props":60,"children":62},{"id":61},"prerequisites",[63],{"type":42,"value":64},"Prerequisites",{"type":36,"tag":66,"props":67,"children":68},"ul",{},[69,75,80],{"type":36,"tag":70,"props":71,"children":72},"li",{},[73],{"type":42,"value":74},"A working Twilio integration (any product)",{"type":36,"tag":70,"props":76,"children":77},{},[78],{"type":42,"value":79},"Understanding of your expected volume (messages\u002Fsec, calls\u002Fsec)",{"type":36,"tag":70,"props":81,"children":82},{},[83,85,92,94],{"type":42,"value":84},"StatusCallback URLs configured — see ",{"type":36,"tag":86,"props":87,"children":89},"code",{"className":88},[],[90],{"type":42,"value":91},"twilio-messaging-services",{"type":42,"value":93},", ",{"type":36,"tag":86,"props":95,"children":97},{"className":96},[],[98],{"type":42,"value":99},"twilio-sms-send-message",{"type":36,"tag":56,"props":101,"children":102},{},[],{"type":36,"tag":37,"props":104,"children":106},{"id":105},"key-patterns",[107],{"type":42,"value":108},"Key Patterns",{"type":36,"tag":110,"props":111,"children":113},"h3",{"id":112},"_1-exponential-backoff-with-jitter",[114],{"type":42,"value":115},"1. Exponential Backoff with Jitter",{"type":36,"tag":45,"props":117,"children":118},{},[119],{"type":42,"value":120},"When you receive a 429 (Too Many Requests), wait and retry. Naive fixed-interval retry creates thundering herds. Use exponential backoff with randomized jitter.",{"type":36,"tag":45,"props":122,"children":123},{},[124],{"type":36,"tag":125,"props":126,"children":127},"strong",{},[128],{"type":42,"value":129},"Python",{"type":36,"tag":131,"props":132,"children":137},"pre",{"className":133,"code":134,"language":135,"meta":136,"style":136},"language-python shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import time, random, requests\n\ndef send_with_backoff(client, to, body, messaging_service_sid, max_retries=5):\n    for attempt in range(max_retries):\n        try:\n            message = client.messages.create(\n                to=to,\n                body=body,\n                messaging_service_sid=messaging_service_sid,\n                status_callback=\"https:\u002F\u002Fyourapp.com\u002Fstatus\"\n            )\n            return message\n        except Exception as e:\n            if hasattr(e, 'status') and e.status == 429:\n                # Exponential backoff: 100ms, 200ms, 400ms, 800ms, 1600ms\n                base_delay = 0.1 * (2 ** attempt)\n                # Add ±10% jitter to prevent thundering herd\n                jitter = base_delay * 0.1 * (2 * random.random() - 1)\n                delay = min(base_delay + jitter, 30)  # cap at 30 seconds\n                time.sleep(delay)\n            else:\n                raise  # Non-429 errors: don't retry, investigate\n    raise Exception(f\"Failed after {max_retries} retries\")\n","python","",[138],{"type":36,"tag":86,"props":139,"children":140},{"__ignoreMap":136},[141,152,162,171,180,189,198,207,216,225,234,243,252,261,270,279,288,297,306,315,324,333,342],{"type":36,"tag":142,"props":143,"children":146},"span",{"class":144,"line":145},"line",1,[147],{"type":36,"tag":142,"props":148,"children":149},{},[150],{"type":42,"value":151},"import time, random, requests\n",{"type":36,"tag":142,"props":153,"children":155},{"class":144,"line":154},2,[156],{"type":36,"tag":142,"props":157,"children":159},{"emptyLinePlaceholder":158},true,[160],{"type":42,"value":161},"\n",{"type":36,"tag":142,"props":163,"children":165},{"class":144,"line":164},3,[166],{"type":36,"tag":142,"props":167,"children":168},{},[169],{"type":42,"value":170},"def send_with_backoff(client, to, body, messaging_service_sid, max_retries=5):\n",{"type":36,"tag":142,"props":172,"children":174},{"class":144,"line":173},4,[175],{"type":36,"tag":142,"props":176,"children":177},{},[178],{"type":42,"value":179},"    for attempt in range(max_retries):\n",{"type":36,"tag":142,"props":181,"children":183},{"class":144,"line":182},5,[184],{"type":36,"tag":142,"props":185,"children":186},{},[187],{"type":42,"value":188},"        try:\n",{"type":36,"tag":142,"props":190,"children":192},{"class":144,"line":191},6,[193],{"type":36,"tag":142,"props":194,"children":195},{},[196],{"type":42,"value":197},"            message = client.messages.create(\n",{"type":36,"tag":142,"props":199,"children":201},{"class":144,"line":200},7,[202],{"type":36,"tag":142,"props":203,"children":204},{},[205],{"type":42,"value":206},"                to=to,\n",{"type":36,"tag":142,"props":208,"children":210},{"class":144,"line":209},8,[211],{"type":36,"tag":142,"props":212,"children":213},{},[214],{"type":42,"value":215},"                body=body,\n",{"type":36,"tag":142,"props":217,"children":219},{"class":144,"line":218},9,[220],{"type":36,"tag":142,"props":221,"children":222},{},[223],{"type":42,"value":224},"                messaging_service_sid=messaging_service_sid,\n",{"type":36,"tag":142,"props":226,"children":228},{"class":144,"line":227},10,[229],{"type":36,"tag":142,"props":230,"children":231},{},[232],{"type":42,"value":233},"                status_callback=\"https:\u002F\u002Fyourapp.com\u002Fstatus\"\n",{"type":36,"tag":142,"props":235,"children":237},{"class":144,"line":236},11,[238],{"type":36,"tag":142,"props":239,"children":240},{},[241],{"type":42,"value":242},"            )\n",{"type":36,"tag":142,"props":244,"children":246},{"class":144,"line":245},12,[247],{"type":36,"tag":142,"props":248,"children":249},{},[250],{"type":42,"value":251},"            return message\n",{"type":36,"tag":142,"props":253,"children":255},{"class":144,"line":254},13,[256],{"type":36,"tag":142,"props":257,"children":258},{},[259],{"type":42,"value":260},"        except Exception as e:\n",{"type":36,"tag":142,"props":262,"children":264},{"class":144,"line":263},14,[265],{"type":36,"tag":142,"props":266,"children":267},{},[268],{"type":42,"value":269},"            if hasattr(e, 'status') and e.status == 429:\n",{"type":36,"tag":142,"props":271,"children":273},{"class":144,"line":272},15,[274],{"type":36,"tag":142,"props":275,"children":276},{},[277],{"type":42,"value":278},"                # Exponential backoff: 100ms, 200ms, 400ms, 800ms, 1600ms\n",{"type":36,"tag":142,"props":280,"children":282},{"class":144,"line":281},16,[283],{"type":36,"tag":142,"props":284,"children":285},{},[286],{"type":42,"value":287},"                base_delay = 0.1 * (2 ** attempt)\n",{"type":36,"tag":142,"props":289,"children":291},{"class":144,"line":290},17,[292],{"type":36,"tag":142,"props":293,"children":294},{},[295],{"type":42,"value":296},"                # Add ±10% jitter to prevent thundering herd\n",{"type":36,"tag":142,"props":298,"children":300},{"class":144,"line":299},18,[301],{"type":36,"tag":142,"props":302,"children":303},{},[304],{"type":42,"value":305},"                jitter = base_delay * 0.1 * (2 * random.random() - 1)\n",{"type":36,"tag":142,"props":307,"children":309},{"class":144,"line":308},19,[310],{"type":36,"tag":142,"props":311,"children":312},{},[313],{"type":42,"value":314},"                delay = min(base_delay + jitter, 30)  # cap at 30 seconds\n",{"type":36,"tag":142,"props":316,"children":318},{"class":144,"line":317},20,[319],{"type":36,"tag":142,"props":320,"children":321},{},[322],{"type":42,"value":323},"                time.sleep(delay)\n",{"type":36,"tag":142,"props":325,"children":327},{"class":144,"line":326},21,[328],{"type":36,"tag":142,"props":329,"children":330},{},[331],{"type":42,"value":332},"            else:\n",{"type":36,"tag":142,"props":334,"children":336},{"class":144,"line":335},22,[337],{"type":36,"tag":142,"props":338,"children":339},{},[340],{"type":42,"value":341},"                raise  # Non-429 errors: don't retry, investigate\n",{"type":36,"tag":142,"props":343,"children":345},{"class":144,"line":344},23,[346],{"type":36,"tag":142,"props":347,"children":348},{},[349],{"type":42,"value":350},"    raise Exception(f\"Failed after {max_retries} retries\")\n",{"type":36,"tag":45,"props":352,"children":353},{},[354],{"type":36,"tag":125,"props":355,"children":356},{},[357],{"type":42,"value":358},"Node.js",{"type":36,"tag":131,"props":360,"children":364},{"className":361,"code":362,"language":363,"meta":136,"style":136},"language-node shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","async function sendWithBackoff(client, to, body, messagingServiceSid, maxRetries = 5) {\n    for (let attempt = 0; attempt \u003C maxRetries; attempt++) {\n        try {\n            return await client.messages.create({\n                to,\n                body,\n                messagingServiceSid,\n                statusCallback: \"https:\u002F\u002Fyourapp.com\u002Fstatus\",\n            });\n        } catch (err) {\n            if (err.status === 429) {\n                \u002F\u002F Exponential backoff: 100ms, 200ms, 400ms, 800ms, 1600ms\n                const baseDelay = 100 * Math.pow(2, attempt);\n                \u002F\u002F Add ±10% jitter\n                const jitter = baseDelay * 0.1 * (2 * Math.random() - 1);\n                const delay = Math.min(baseDelay + jitter, 30000); \u002F\u002F cap at 30s\n                await new Promise(r => setTimeout(r, delay));\n            } else {\n                throw err; \u002F\u002F Non-429: don't retry\n            }\n        }\n    }\n    throw new Error(`Failed after ${maxRetries} retries`);\n}\n","node",[365],{"type":36,"tag":86,"props":366,"children":367},{"__ignoreMap":136},[368,376,384,392,400,408,416,424,432,440,448,456,464,472,480,488,496,504,512,520,528,536,544,552],{"type":36,"tag":142,"props":369,"children":370},{"class":144,"line":145},[371],{"type":36,"tag":142,"props":372,"children":373},{},[374],{"type":42,"value":375},"async function sendWithBackoff(client, to, body, messagingServiceSid, maxRetries = 5) {\n",{"type":36,"tag":142,"props":377,"children":378},{"class":144,"line":154},[379],{"type":36,"tag":142,"props":380,"children":381},{},[382],{"type":42,"value":383},"    for (let attempt = 0; attempt \u003C maxRetries; attempt++) {\n",{"type":36,"tag":142,"props":385,"children":386},{"class":144,"line":164},[387],{"type":36,"tag":142,"props":388,"children":389},{},[390],{"type":42,"value":391},"        try {\n",{"type":36,"tag":142,"props":393,"children":394},{"class":144,"line":173},[395],{"type":36,"tag":142,"props":396,"children":397},{},[398],{"type":42,"value":399},"            return await client.messages.create({\n",{"type":36,"tag":142,"props":401,"children":402},{"class":144,"line":182},[403],{"type":36,"tag":142,"props":404,"children":405},{},[406],{"type":42,"value":407},"                to,\n",{"type":36,"tag":142,"props":409,"children":410},{"class":144,"line":191},[411],{"type":36,"tag":142,"props":412,"children":413},{},[414],{"type":42,"value":415},"                body,\n",{"type":36,"tag":142,"props":417,"children":418},{"class":144,"line":200},[419],{"type":36,"tag":142,"props":420,"children":421},{},[422],{"type":42,"value":423},"                messagingServiceSid,\n",{"type":36,"tag":142,"props":425,"children":426},{"class":144,"line":209},[427],{"type":36,"tag":142,"props":428,"children":429},{},[430],{"type":42,"value":431},"                statusCallback: \"https:\u002F\u002Fyourapp.com\u002Fstatus\",\n",{"type":36,"tag":142,"props":433,"children":434},{"class":144,"line":218},[435],{"type":36,"tag":142,"props":436,"children":437},{},[438],{"type":42,"value":439},"            });\n",{"type":36,"tag":142,"props":441,"children":442},{"class":144,"line":227},[443],{"type":36,"tag":142,"props":444,"children":445},{},[446],{"type":42,"value":447},"        } catch (err) {\n",{"type":36,"tag":142,"props":449,"children":450},{"class":144,"line":236},[451],{"type":36,"tag":142,"props":452,"children":453},{},[454],{"type":42,"value":455},"            if (err.status === 429) {\n",{"type":36,"tag":142,"props":457,"children":458},{"class":144,"line":245},[459],{"type":36,"tag":142,"props":460,"children":461},{},[462],{"type":42,"value":463},"                \u002F\u002F Exponential backoff: 100ms, 200ms, 400ms, 800ms, 1600ms\n",{"type":36,"tag":142,"props":465,"children":466},{"class":144,"line":254},[467],{"type":36,"tag":142,"props":468,"children":469},{},[470],{"type":42,"value":471},"                const baseDelay = 100 * Math.pow(2, attempt);\n",{"type":36,"tag":142,"props":473,"children":474},{"class":144,"line":263},[475],{"type":36,"tag":142,"props":476,"children":477},{},[478],{"type":42,"value":479},"                \u002F\u002F Add ±10% jitter\n",{"type":36,"tag":142,"props":481,"children":482},{"class":144,"line":272},[483],{"type":36,"tag":142,"props":484,"children":485},{},[486],{"type":42,"value":487},"                const jitter = baseDelay * 0.1 * (2 * Math.random() - 1);\n",{"type":36,"tag":142,"props":489,"children":490},{"class":144,"line":281},[491],{"type":36,"tag":142,"props":492,"children":493},{},[494],{"type":42,"value":495},"                const delay = Math.min(baseDelay + jitter, 30000); \u002F\u002F cap at 30s\n",{"type":36,"tag":142,"props":497,"children":498},{"class":144,"line":290},[499],{"type":36,"tag":142,"props":500,"children":501},{},[502],{"type":42,"value":503},"                await new Promise(r => setTimeout(r, delay));\n",{"type":36,"tag":142,"props":505,"children":506},{"class":144,"line":299},[507],{"type":36,"tag":142,"props":508,"children":509},{},[510],{"type":42,"value":511},"            } else {\n",{"type":36,"tag":142,"props":513,"children":514},{"class":144,"line":308},[515],{"type":36,"tag":142,"props":516,"children":517},{},[518],{"type":42,"value":519},"                throw err; \u002F\u002F Non-429: don't retry\n",{"type":36,"tag":142,"props":521,"children":522},{"class":144,"line":317},[523],{"type":36,"tag":142,"props":524,"children":525},{},[526],{"type":42,"value":527},"            }\n",{"type":36,"tag":142,"props":529,"children":530},{"class":144,"line":326},[531],{"type":36,"tag":142,"props":532,"children":533},{},[534],{"type":42,"value":535},"        }\n",{"type":36,"tag":142,"props":537,"children":538},{"class":144,"line":335},[539],{"type":36,"tag":142,"props":540,"children":541},{},[542],{"type":42,"value":543},"    }\n",{"type":36,"tag":142,"props":545,"children":546},{"class":144,"line":344},[547],{"type":36,"tag":142,"props":548,"children":549},{},[550],{"type":42,"value":551},"    throw new Error(`Failed after ${maxRetries} retries`);\n",{"type":36,"tag":142,"props":553,"children":555},{"class":144,"line":554},24,[556],{"type":36,"tag":142,"props":557,"children":558},{},[559],{"type":42,"value":560},"}\n",{"type":36,"tag":45,"props":562,"children":563},{},[564],{"type":36,"tag":125,"props":565,"children":566},{},[567],{"type":42,"value":568},"Parameters:",{"type":36,"tag":66,"props":570,"children":571},{},[572,577,582,587,592],{"type":36,"tag":70,"props":573,"children":574},{},[575],{"type":42,"value":576},"Initial delay: 100ms",{"type":36,"tag":70,"props":578,"children":579},{},[580],{"type":42,"value":581},"Multiplier: 2x per attempt",{"type":36,"tag":70,"props":583,"children":584},{},[585],{"type":42,"value":586},"Jitter: ±10% of base delay (randomized)",{"type":36,"tag":70,"props":588,"children":589},{},[590],{"type":42,"value":591},"Max delay: 30 seconds",{"type":36,"tag":70,"props":593,"children":594},{},[595],{"type":42,"value":596},"Max retries: 5 (covers up to ~3.2 second base delay)",{"type":36,"tag":110,"props":598,"children":600},{"id":599},"_2-per-number-throughput-limits",[601],{"type":42,"value":602},"2. Per-Number Throughput Limits",{"type":36,"tag":45,"props":604,"children":605},{},[606],{"type":42,"value":607},"These limits are not prominently documented:",{"type":36,"tag":609,"props":610,"children":611},"table",{},[612,641],{"type":36,"tag":613,"props":614,"children":615},"thead",{},[616],{"type":36,"tag":617,"props":618,"children":619},"tr",{},[620,626,631,636],{"type":36,"tag":621,"props":622,"children":623},"th",{},[624],{"type":42,"value":625},"Number type",{"type":36,"tag":621,"props":627,"children":628},{},[629],{"type":42,"value":630},"SMS throughput",{"type":36,"tag":621,"props":632,"children":633},{},[634],{"type":42,"value":635},"Voice throughput",{"type":36,"tag":621,"props":637,"children":638},{},[639],{"type":42,"value":640},"Notes",{"type":36,"tag":642,"props":643,"children":644},"tbody",{},[645,669,692,714],{"type":36,"tag":617,"props":646,"children":647},{},[648,654,659,664],{"type":36,"tag":649,"props":650,"children":651},"td",{},[652],{"type":42,"value":653},"Local (long code)",{"type":36,"tag":649,"props":655,"children":656},{},[657],{"type":42,"value":658},"~1 SMS\u002Fsec",{"type":36,"tag":649,"props":660,"children":661},{},[662],{"type":42,"value":663},"1 concurrent call",{"type":36,"tag":649,"props":665,"children":666},{},[667],{"type":42,"value":668},"Lowest cost, lowest throughput",{"type":36,"tag":617,"props":670,"children":671},{},[672,677,682,687],{"type":36,"tag":649,"props":673,"children":674},{},[675],{"type":42,"value":676},"Toll-free",{"type":36,"tag":649,"props":678,"children":679},{},[680],{"type":42,"value":681},"~3 SMS\u002Fsec",{"type":36,"tag":649,"props":683,"children":684},{},[685],{"type":42,"value":686},"—",{"type":36,"tag":649,"props":688,"children":689},{},[690],{"type":42,"value":691},"Faster verification (3-5 days)",{"type":36,"tag":617,"props":693,"children":694},{},[695,700,705,709],{"type":36,"tag":649,"props":696,"children":697},{},[698],{"type":42,"value":699},"Short code",{"type":36,"tag":649,"props":701,"children":702},{},[703],{"type":42,"value":704},"10-100 SMS\u002Fsec",{"type":36,"tag":649,"props":706,"children":707},{},[708],{"type":42,"value":686},{"type":36,"tag":649,"props":710,"children":711},{},[712],{"type":42,"value":713},"Highest throughput, 8-12 week provisioning, expensive",{"type":36,"tag":617,"props":715,"children":716},{},[717,722,727,731],{"type":36,"tag":649,"props":718,"children":719},{},[720],{"type":42,"value":721},"Messaging Service (pool)",{"type":36,"tag":649,"props":723,"children":724},{},[725],{"type":42,"value":726},"Sum of all numbers in pool",{"type":36,"tag":649,"props":728,"children":729},{},[730],{"type":42,"value":686},{"type":36,"tag":649,"props":732,"children":733},{},[734],{"type":42,"value":735},"Multiply throughput by adding numbers",{"type":36,"tag":45,"props":737,"children":738},{},[739,744],{"type":36,"tag":125,"props":740,"children":741},{},[742],{"type":42,"value":743},"Throughput opacity:",{"type":42,"value":745}," Sending velocity and queue depth are opaque — there is no dashboard showing messages per second. Use Messaging Services to multiply throughput by pooling numbers. A pool of 10 long codes = ~10 SMS\u002Fsec.",{"type":36,"tag":110,"props":747,"children":749},{"id":748},"_3-bulk-send-pattern",[750],{"type":42,"value":751},"3. Bulk Send Pattern",{"type":36,"tag":45,"props":753,"children":754},{},[755],{"type":42,"value":756},"For sending to large lists, use a rate-limited dispatch loop:",{"type":36,"tag":45,"props":758,"children":759},{},[760],{"type":36,"tag":125,"props":761,"children":762},{},[763],{"type":42,"value":129},{"type":36,"tag":131,"props":765,"children":767},{"className":133,"code":766,"language":135,"meta":136,"style":136},"import asyncio\nfrom collections import deque\n\nasync def bulk_send(client, recipients, body, messaging_service_sid, rate_per_second=10):\n    \"\"\"Send to a list of recipients with rate limiting and backoff.\"\"\"\n    queue = deque(recipients)\n    results = []\n    \n    while queue:\n        batch = []\n        for _ in range(min(rate_per_second, len(queue))):\n            batch.append(queue.popleft())\n        \n        for recipient in batch:\n            try:\n                msg = send_with_backoff(client, recipient, body, messaging_service_sid)\n                results.append({\"to\": recipient, \"sid\": msg.sid, \"status\": \"sent\"})\n            except Exception as e:\n                results.append({\"to\": recipient, \"error\": str(e), \"status\": \"failed\"})\n        \n        if queue:  # Don't sleep after last batch\n            await asyncio.sleep(1)  # 1 second between batches\n    \n    return results\n",[768],{"type":36,"tag":86,"props":769,"children":770},{"__ignoreMap":136},[771,779,787,794,802,810,818,826,834,842,850,858,866,874,882,890,898,906,914,922,929,937,945,952],{"type":36,"tag":142,"props":772,"children":773},{"class":144,"line":145},[774],{"type":36,"tag":142,"props":775,"children":776},{},[777],{"type":42,"value":778},"import asyncio\n",{"type":36,"tag":142,"props":780,"children":781},{"class":144,"line":154},[782],{"type":36,"tag":142,"props":783,"children":784},{},[785],{"type":42,"value":786},"from collections import deque\n",{"type":36,"tag":142,"props":788,"children":789},{"class":144,"line":164},[790],{"type":36,"tag":142,"props":791,"children":792},{"emptyLinePlaceholder":158},[793],{"type":42,"value":161},{"type":36,"tag":142,"props":795,"children":796},{"class":144,"line":173},[797],{"type":36,"tag":142,"props":798,"children":799},{},[800],{"type":42,"value":801},"async def bulk_send(client, recipients, body, messaging_service_sid, rate_per_second=10):\n",{"type":36,"tag":142,"props":803,"children":804},{"class":144,"line":182},[805],{"type":36,"tag":142,"props":806,"children":807},{},[808],{"type":42,"value":809},"    \"\"\"Send to a list of recipients with rate limiting and backoff.\"\"\"\n",{"type":36,"tag":142,"props":811,"children":812},{"class":144,"line":191},[813],{"type":36,"tag":142,"props":814,"children":815},{},[816],{"type":42,"value":817},"    queue = deque(recipients)\n",{"type":36,"tag":142,"props":819,"children":820},{"class":144,"line":200},[821],{"type":36,"tag":142,"props":822,"children":823},{},[824],{"type":42,"value":825},"    results = []\n",{"type":36,"tag":142,"props":827,"children":828},{"class":144,"line":209},[829],{"type":36,"tag":142,"props":830,"children":831},{},[832],{"type":42,"value":833},"    \n",{"type":36,"tag":142,"props":835,"children":836},{"class":144,"line":218},[837],{"type":36,"tag":142,"props":838,"children":839},{},[840],{"type":42,"value":841},"    while queue:\n",{"type":36,"tag":142,"props":843,"children":844},{"class":144,"line":227},[845],{"type":36,"tag":142,"props":846,"children":847},{},[848],{"type":42,"value":849},"        batch = []\n",{"type":36,"tag":142,"props":851,"children":852},{"class":144,"line":236},[853],{"type":36,"tag":142,"props":854,"children":855},{},[856],{"type":42,"value":857},"        for _ in range(min(rate_per_second, len(queue))):\n",{"type":36,"tag":142,"props":859,"children":860},{"class":144,"line":245},[861],{"type":36,"tag":142,"props":862,"children":863},{},[864],{"type":42,"value":865},"            batch.append(queue.popleft())\n",{"type":36,"tag":142,"props":867,"children":868},{"class":144,"line":254},[869],{"type":36,"tag":142,"props":870,"children":871},{},[872],{"type":42,"value":873},"        \n",{"type":36,"tag":142,"props":875,"children":876},{"class":144,"line":263},[877],{"type":36,"tag":142,"props":878,"children":879},{},[880],{"type":42,"value":881},"        for recipient in batch:\n",{"type":36,"tag":142,"props":883,"children":884},{"class":144,"line":272},[885],{"type":36,"tag":142,"props":886,"children":887},{},[888],{"type":42,"value":889},"            try:\n",{"type":36,"tag":142,"props":891,"children":892},{"class":144,"line":281},[893],{"type":36,"tag":142,"props":894,"children":895},{},[896],{"type":42,"value":897},"                msg = send_with_backoff(client, recipient, body, messaging_service_sid)\n",{"type":36,"tag":142,"props":899,"children":900},{"class":144,"line":290},[901],{"type":36,"tag":142,"props":902,"children":903},{},[904],{"type":42,"value":905},"                results.append({\"to\": recipient, \"sid\": msg.sid, \"status\": \"sent\"})\n",{"type":36,"tag":142,"props":907,"children":908},{"class":144,"line":299},[909],{"type":36,"tag":142,"props":910,"children":911},{},[912],{"type":42,"value":913},"            except Exception as e:\n",{"type":36,"tag":142,"props":915,"children":916},{"class":144,"line":308},[917],{"type":36,"tag":142,"props":918,"children":919},{},[920],{"type":42,"value":921},"                results.append({\"to\": recipient, \"error\": str(e), \"status\": \"failed\"})\n",{"type":36,"tag":142,"props":923,"children":924},{"class":144,"line":317},[925],{"type":36,"tag":142,"props":926,"children":927},{},[928],{"type":42,"value":873},{"type":36,"tag":142,"props":930,"children":931},{"class":144,"line":326},[932],{"type":36,"tag":142,"props":933,"children":934},{},[935],{"type":42,"value":936},"        if queue:  # Don't sleep after last batch\n",{"type":36,"tag":142,"props":938,"children":939},{"class":144,"line":335},[940],{"type":36,"tag":142,"props":941,"children":942},{},[943],{"type":42,"value":944},"            await asyncio.sleep(1)  # 1 second between batches\n",{"type":36,"tag":142,"props":946,"children":947},{"class":144,"line":344},[948],{"type":36,"tag":142,"props":949,"children":950},{},[951],{"type":42,"value":833},{"type":36,"tag":142,"props":953,"children":954},{"class":144,"line":554},[955],{"type":36,"tag":142,"props":956,"children":957},{},[958],{"type":42,"value":959},"    return results\n",{"type":36,"tag":45,"props":961,"children":962},{},[963,968,970,976],{"type":36,"tag":125,"props":964,"children":965},{},[966],{"type":42,"value":967},"Key:",{"type":42,"value":969}," Set ",{"type":36,"tag":86,"props":971,"children":973},{"className":972},[],[974],{"type":42,"value":975},"rate_per_second",{"type":42,"value":977}," based on your number pool size, not your desired speed. Sending faster than your pool supports just generates 429s.",{"type":36,"tag":979,"props":980,"children":981},"blockquote",{},[982],{"type":36,"tag":45,"props":983,"children":984},{},[985,990],{"type":36,"tag":125,"props":986,"children":987},{},[988],{"type":42,"value":989},"Compliance:",{"type":42,"value":991}," Before bulk sending, verify recipient consent (opt-in records), respect quiet hours, and implement maximum batch size limits. Monitor for anomalous send patterns that could indicate abuse.",{"type":36,"tag":110,"props":993,"children":995},{"id":994},"_4-statuscallback-resilience",[996],{"type":42,"value":997},"4. StatusCallback Resilience",{"type":36,"tag":45,"props":999,"children":1000},{},[1001],{"type":42,"value":1002},"At scale, StatusCallbacks create their own load problem.",{"type":36,"tag":45,"props":1004,"children":1005},{},[1006,1011],{"type":36,"tag":125,"props":1007,"children":1008},{},[1009],{"type":42,"value":1010},"The math:",{"type":42,"value":1012}," 50 concurrent calls × 6 status events per call = 300 webhook invocations per second. Twilio Functions allow 30 concurrent executions per service.",{"type":36,"tag":45,"props":1014,"children":1015},{},[1016,1021],{"type":36,"tag":125,"props":1017,"children":1018},{},[1019],{"type":42,"value":1020},"Thin-receiver pattern",{"type":42,"value":1022}," — receive, queue, respond immediately:",{"type":36,"tag":45,"props":1024,"children":1025},{},[1026],{"type":36,"tag":125,"props":1027,"children":1028},{},[1029],{"type":42,"value":1030},"Node.js (Express)",{"type":36,"tag":131,"props":1032,"children":1034},{"className":361,"code":1033,"language":363,"meta":136,"style":136},"const { Queue } = require(\"bullmq\");\nconst statusQueue = new Queue(\"twilio-status\");\n\n\u002F\u002F Thin receiver: accept callback, queue it, respond 200 immediately\napp.post(\"\u002Fstatus\", async (req, res) => {\n    await statusQueue.add(\"status-event\", {\n        callSid: req.body.CallSid,\n        callStatus: req.body.CallStatus,\n        timestamp: Date.now(),\n    });\n    res.sendStatus(200);  \u002F\u002F Respond FAST — Twilio will retry on timeout\n});\n\n\u002F\u002F Process asynchronously\nconst worker = new Worker(\"twilio-status\", async (job) => {\n    const { callSid, callStatus } = job.data;\n    await updateDatabase(callSid, callStatus);\n});\n",[1035],{"type":36,"tag":86,"props":1036,"children":1037},{"__ignoreMap":136},[1038,1046,1054,1061,1069,1077,1085,1093,1101,1109,1117,1125,1133,1140,1148,1156,1164,1172],{"type":36,"tag":142,"props":1039,"children":1040},{"class":144,"line":145},[1041],{"type":36,"tag":142,"props":1042,"children":1043},{},[1044],{"type":42,"value":1045},"const { Queue } = require(\"bullmq\");\n",{"type":36,"tag":142,"props":1047,"children":1048},{"class":144,"line":154},[1049],{"type":36,"tag":142,"props":1050,"children":1051},{},[1052],{"type":42,"value":1053},"const statusQueue = new Queue(\"twilio-status\");\n",{"type":36,"tag":142,"props":1055,"children":1056},{"class":144,"line":164},[1057],{"type":36,"tag":142,"props":1058,"children":1059},{"emptyLinePlaceholder":158},[1060],{"type":42,"value":161},{"type":36,"tag":142,"props":1062,"children":1063},{"class":144,"line":173},[1064],{"type":36,"tag":142,"props":1065,"children":1066},{},[1067],{"type":42,"value":1068},"\u002F\u002F Thin receiver: accept callback, queue it, respond 200 immediately\n",{"type":36,"tag":142,"props":1070,"children":1071},{"class":144,"line":182},[1072],{"type":36,"tag":142,"props":1073,"children":1074},{},[1075],{"type":42,"value":1076},"app.post(\"\u002Fstatus\", async (req, res) => {\n",{"type":36,"tag":142,"props":1078,"children":1079},{"class":144,"line":191},[1080],{"type":36,"tag":142,"props":1081,"children":1082},{},[1083],{"type":42,"value":1084},"    await statusQueue.add(\"status-event\", {\n",{"type":36,"tag":142,"props":1086,"children":1087},{"class":144,"line":200},[1088],{"type":36,"tag":142,"props":1089,"children":1090},{},[1091],{"type":42,"value":1092},"        callSid: req.body.CallSid,\n",{"type":36,"tag":142,"props":1094,"children":1095},{"class":144,"line":209},[1096],{"type":36,"tag":142,"props":1097,"children":1098},{},[1099],{"type":42,"value":1100},"        callStatus: req.body.CallStatus,\n",{"type":36,"tag":142,"props":1102,"children":1103},{"class":144,"line":218},[1104],{"type":36,"tag":142,"props":1105,"children":1106},{},[1107],{"type":42,"value":1108},"        timestamp: Date.now(),\n",{"type":36,"tag":142,"props":1110,"children":1111},{"class":144,"line":227},[1112],{"type":36,"tag":142,"props":1113,"children":1114},{},[1115],{"type":42,"value":1116},"    });\n",{"type":36,"tag":142,"props":1118,"children":1119},{"class":144,"line":236},[1120],{"type":36,"tag":142,"props":1121,"children":1122},{},[1123],{"type":42,"value":1124},"    res.sendStatus(200);  \u002F\u002F Respond FAST — Twilio will retry on timeout\n",{"type":36,"tag":142,"props":1126,"children":1127},{"class":144,"line":245},[1128],{"type":36,"tag":142,"props":1129,"children":1130},{},[1131],{"type":42,"value":1132},"});\n",{"type":36,"tag":142,"props":1134,"children":1135},{"class":144,"line":254},[1136],{"type":36,"tag":142,"props":1137,"children":1138},{"emptyLinePlaceholder":158},[1139],{"type":42,"value":161},{"type":36,"tag":142,"props":1141,"children":1142},{"class":144,"line":263},[1143],{"type":36,"tag":142,"props":1144,"children":1145},{},[1146],{"type":42,"value":1147},"\u002F\u002F Process asynchronously\n",{"type":36,"tag":142,"props":1149,"children":1150},{"class":144,"line":272},[1151],{"type":36,"tag":142,"props":1152,"children":1153},{},[1154],{"type":42,"value":1155},"const worker = new Worker(\"twilio-status\", async (job) => {\n",{"type":36,"tag":142,"props":1157,"children":1158},{"class":144,"line":281},[1159],{"type":36,"tag":142,"props":1160,"children":1161},{},[1162],{"type":42,"value":1163},"    const { callSid, callStatus } = job.data;\n",{"type":36,"tag":142,"props":1165,"children":1166},{"class":144,"line":290},[1167],{"type":36,"tag":142,"props":1168,"children":1169},{},[1170],{"type":42,"value":1171},"    await updateDatabase(callSid, callStatus);\n",{"type":36,"tag":142,"props":1173,"children":1174},{"class":144,"line":299},[1175],{"type":36,"tag":142,"props":1176,"children":1177},{},[1178],{"type":42,"value":1132},{"type":36,"tag":45,"props":1180,"children":1181},{},[1182],{"type":36,"tag":125,"props":1183,"children":1184},{},[1185],{"type":42,"value":1186},"Python (Flask + Celery)",{"type":36,"tag":131,"props":1188,"children":1190},{"className":133,"code":1189,"language":135,"meta":136,"style":136},"@app.route(\"\u002Fstatus\", methods=[\"POST\"])\ndef status_callback():\n    # Queue for async processing\n    process_status.delay(\n        call_sid=request.form[\"CallSid\"],\n        call_status=request.form[\"CallStatus\"]\n    )\n    return \"\", 200  # Respond FAST\n\n@celery.task\ndef process_status(call_sid, call_status):\n    update_database(call_sid, call_status)\n",[1191],{"type":36,"tag":86,"props":1192,"children":1193},{"__ignoreMap":136},[1194,1202,1210,1218,1226,1234,1242,1250,1258,1265,1273,1281],{"type":36,"tag":142,"props":1195,"children":1196},{"class":144,"line":145},[1197],{"type":36,"tag":142,"props":1198,"children":1199},{},[1200],{"type":42,"value":1201},"@app.route(\"\u002Fstatus\", methods=[\"POST\"])\n",{"type":36,"tag":142,"props":1203,"children":1204},{"class":144,"line":154},[1205],{"type":36,"tag":142,"props":1206,"children":1207},{},[1208],{"type":42,"value":1209},"def status_callback():\n",{"type":36,"tag":142,"props":1211,"children":1212},{"class":144,"line":164},[1213],{"type":36,"tag":142,"props":1214,"children":1215},{},[1216],{"type":42,"value":1217},"    # Queue for async processing\n",{"type":36,"tag":142,"props":1219,"children":1220},{"class":144,"line":173},[1221],{"type":36,"tag":142,"props":1222,"children":1223},{},[1224],{"type":42,"value":1225},"    process_status.delay(\n",{"type":36,"tag":142,"props":1227,"children":1228},{"class":144,"line":182},[1229],{"type":36,"tag":142,"props":1230,"children":1231},{},[1232],{"type":42,"value":1233},"        call_sid=request.form[\"CallSid\"],\n",{"type":36,"tag":142,"props":1235,"children":1236},{"class":144,"line":191},[1237],{"type":36,"tag":142,"props":1238,"children":1239},{},[1240],{"type":42,"value":1241},"        call_status=request.form[\"CallStatus\"]\n",{"type":36,"tag":142,"props":1243,"children":1244},{"class":144,"line":200},[1245],{"type":36,"tag":142,"props":1246,"children":1247},{},[1248],{"type":42,"value":1249},"    )\n",{"type":36,"tag":142,"props":1251,"children":1252},{"class":144,"line":209},[1253],{"type":36,"tag":142,"props":1254,"children":1255},{},[1256],{"type":42,"value":1257},"    return \"\", 200  # Respond FAST\n",{"type":36,"tag":142,"props":1259,"children":1260},{"class":144,"line":218},[1261],{"type":36,"tag":142,"props":1262,"children":1263},{"emptyLinePlaceholder":158},[1264],{"type":42,"value":161},{"type":36,"tag":142,"props":1266,"children":1267},{"class":144,"line":227},[1268],{"type":36,"tag":142,"props":1269,"children":1270},{},[1271],{"type":42,"value":1272},"@celery.task\n",{"type":36,"tag":142,"props":1274,"children":1275},{"class":144,"line":236},[1276],{"type":36,"tag":142,"props":1277,"children":1278},{},[1279],{"type":42,"value":1280},"def process_status(call_sid, call_status):\n",{"type":36,"tag":142,"props":1282,"children":1283},{"class":144,"line":245},[1284],{"type":36,"tag":142,"props":1285,"children":1286},{},[1287],{"type":42,"value":1288},"    update_database(call_sid, call_status)\n",{"type":36,"tag":45,"props":1290,"children":1291},{},[1292,1297,1299,1305],{"type":36,"tag":125,"props":1293,"children":1294},{},[1295],{"type":42,"value":1296},"Idempotency key:",{"type":42,"value":1298}," Use ",{"type":36,"tag":86,"props":1300,"children":1302},{"className":1301},[],[1303],{"type":42,"value":1304},"{CallSid}-{CallStatus}",{"type":42,"value":1306}," as a composite key. Twilio retries on timeout, which can cause duplicate callbacks. Deduplicate before processing.",{"type":36,"tag":110,"props":1308,"children":1310},{"id":1309},"_5-fallback-chains",[1311],{"type":42,"value":1312},"5. Fallback Chains",{"type":36,"tag":45,"props":1314,"children":1315},{},[1316],{"type":42,"value":1317},"When delivery on one channel fails, escalate to the next:",{"type":36,"tag":45,"props":1319,"children":1320},{},[1321],{"type":36,"tag":125,"props":1322,"children":1323},{},[1324],{"type":42,"value":129},{"type":36,"tag":131,"props":1326,"children":1328},{"className":133,"code":1327,"language":135,"meta":136,"style":136},"async def send_with_fallback(client, to, message, messaging_service_sid):\n    \"\"\"Try SMS → Voice → Email fallback chain.\"\"\"\n    \n    # Try SMS first\n    try:\n        msg = client.messages.create(\n            to=to, body=message, messaging_service_sid=messaging_service_sid,\n            status_callback=\"https:\u002F\u002Fyourapp.com\u002Fstatus\"\n        )\n        # Wait for delivery confirmation via StatusCallback\n        # If undelivered after timeout, fall through to voice\n        return {\"channel\": \"sms\", \"sid\": msg.sid}\n    except Exception:\n        pass  # SMS failed, try voice\n    \n    # Fallback to voice\n    try:\n        call = client.calls.create(\n            to=to, from_=\"+15551234567\",\n            twiml=f\"\u003CResponse>\u003CSay>{message}\u003C\u002FSay>\u003C\u002FResponse>\",\n            status_callback=\"https:\u002F\u002Fyourapp.com\u002Fcall-status\"\n        )\n        return {\"channel\": \"voice\", \"sid\": call.sid}\n    except Exception:\n        pass  # Voice failed, try email\n    \n    # Last resort: email\n    # Use SendGrid — see twilio-sendgrid-email\n    return {\"channel\": \"email\", \"status\": \"queued\"}\n",[1329],{"type":36,"tag":86,"props":1330,"children":1331},{"__ignoreMap":136},[1332,1340,1348,1355,1363,1371,1379,1387,1395,1403,1411,1419,1427,1435,1443,1450,1458,1465,1473,1481,1489,1497,1504,1512,1519,1528,1536,1545,1554],{"type":36,"tag":142,"props":1333,"children":1334},{"class":144,"line":145},[1335],{"type":36,"tag":142,"props":1336,"children":1337},{},[1338],{"type":42,"value":1339},"async def send_with_fallback(client, to, message, messaging_service_sid):\n",{"type":36,"tag":142,"props":1341,"children":1342},{"class":144,"line":154},[1343],{"type":36,"tag":142,"props":1344,"children":1345},{},[1346],{"type":42,"value":1347},"    \"\"\"Try SMS → Voice → Email fallback chain.\"\"\"\n",{"type":36,"tag":142,"props":1349,"children":1350},{"class":144,"line":164},[1351],{"type":36,"tag":142,"props":1352,"children":1353},{},[1354],{"type":42,"value":833},{"type":36,"tag":142,"props":1356,"children":1357},{"class":144,"line":173},[1358],{"type":36,"tag":142,"props":1359,"children":1360},{},[1361],{"type":42,"value":1362},"    # Try SMS first\n",{"type":36,"tag":142,"props":1364,"children":1365},{"class":144,"line":182},[1366],{"type":36,"tag":142,"props":1367,"children":1368},{},[1369],{"type":42,"value":1370},"    try:\n",{"type":36,"tag":142,"props":1372,"children":1373},{"class":144,"line":191},[1374],{"type":36,"tag":142,"props":1375,"children":1376},{},[1377],{"type":42,"value":1378},"        msg = client.messages.create(\n",{"type":36,"tag":142,"props":1380,"children":1381},{"class":144,"line":200},[1382],{"type":36,"tag":142,"props":1383,"children":1384},{},[1385],{"type":42,"value":1386},"            to=to, body=message, messaging_service_sid=messaging_service_sid,\n",{"type":36,"tag":142,"props":1388,"children":1389},{"class":144,"line":209},[1390],{"type":36,"tag":142,"props":1391,"children":1392},{},[1393],{"type":42,"value":1394},"            status_callback=\"https:\u002F\u002Fyourapp.com\u002Fstatus\"\n",{"type":36,"tag":142,"props":1396,"children":1397},{"class":144,"line":218},[1398],{"type":36,"tag":142,"props":1399,"children":1400},{},[1401],{"type":42,"value":1402},"        )\n",{"type":36,"tag":142,"props":1404,"children":1405},{"class":144,"line":227},[1406],{"type":36,"tag":142,"props":1407,"children":1408},{},[1409],{"type":42,"value":1410},"        # Wait for delivery confirmation via StatusCallback\n",{"type":36,"tag":142,"props":1412,"children":1413},{"class":144,"line":236},[1414],{"type":36,"tag":142,"props":1415,"children":1416},{},[1417],{"type":42,"value":1418},"        # If undelivered after timeout, fall through to voice\n",{"type":36,"tag":142,"props":1420,"children":1421},{"class":144,"line":245},[1422],{"type":36,"tag":142,"props":1423,"children":1424},{},[1425],{"type":42,"value":1426},"        return {\"channel\": \"sms\", \"sid\": msg.sid}\n",{"type":36,"tag":142,"props":1428,"children":1429},{"class":144,"line":254},[1430],{"type":36,"tag":142,"props":1431,"children":1432},{},[1433],{"type":42,"value":1434},"    except Exception:\n",{"type":36,"tag":142,"props":1436,"children":1437},{"class":144,"line":263},[1438],{"type":36,"tag":142,"props":1439,"children":1440},{},[1441],{"type":42,"value":1442},"        pass  # SMS failed, try voice\n",{"type":36,"tag":142,"props":1444,"children":1445},{"class":144,"line":272},[1446],{"type":36,"tag":142,"props":1447,"children":1448},{},[1449],{"type":42,"value":833},{"type":36,"tag":142,"props":1451,"children":1452},{"class":144,"line":281},[1453],{"type":36,"tag":142,"props":1454,"children":1455},{},[1456],{"type":42,"value":1457},"    # Fallback to voice\n",{"type":36,"tag":142,"props":1459,"children":1460},{"class":144,"line":290},[1461],{"type":36,"tag":142,"props":1462,"children":1463},{},[1464],{"type":42,"value":1370},{"type":36,"tag":142,"props":1466,"children":1467},{"class":144,"line":299},[1468],{"type":36,"tag":142,"props":1469,"children":1470},{},[1471],{"type":42,"value":1472},"        call = client.calls.create(\n",{"type":36,"tag":142,"props":1474,"children":1475},{"class":144,"line":308},[1476],{"type":36,"tag":142,"props":1477,"children":1478},{},[1479],{"type":42,"value":1480},"            to=to, from_=\"+15551234567\",\n",{"type":36,"tag":142,"props":1482,"children":1483},{"class":144,"line":317},[1484],{"type":36,"tag":142,"props":1485,"children":1486},{},[1487],{"type":42,"value":1488},"            twiml=f\"\u003CResponse>\u003CSay>{message}\u003C\u002FSay>\u003C\u002FResponse>\",\n",{"type":36,"tag":142,"props":1490,"children":1491},{"class":144,"line":326},[1492],{"type":36,"tag":142,"props":1493,"children":1494},{},[1495],{"type":42,"value":1496},"            status_callback=\"https:\u002F\u002Fyourapp.com\u002Fcall-status\"\n",{"type":36,"tag":142,"props":1498,"children":1499},{"class":144,"line":335},[1500],{"type":36,"tag":142,"props":1501,"children":1502},{},[1503],{"type":42,"value":1402},{"type":36,"tag":142,"props":1505,"children":1506},{"class":144,"line":344},[1507],{"type":36,"tag":142,"props":1508,"children":1509},{},[1510],{"type":42,"value":1511},"        return {\"channel\": \"voice\", \"sid\": call.sid}\n",{"type":36,"tag":142,"props":1513,"children":1514},{"class":144,"line":554},[1515],{"type":36,"tag":142,"props":1516,"children":1517},{},[1518],{"type":42,"value":1434},{"type":36,"tag":142,"props":1520,"children":1522},{"class":144,"line":1521},25,[1523],{"type":36,"tag":142,"props":1524,"children":1525},{},[1526],{"type":42,"value":1527},"        pass  # Voice failed, try email\n",{"type":36,"tag":142,"props":1529,"children":1531},{"class":144,"line":1530},26,[1532],{"type":36,"tag":142,"props":1533,"children":1534},{},[1535],{"type":42,"value":833},{"type":36,"tag":142,"props":1537,"children":1539},{"class":144,"line":1538},27,[1540],{"type":36,"tag":142,"props":1541,"children":1542},{},[1543],{"type":42,"value":1544},"    # Last resort: email\n",{"type":36,"tag":142,"props":1546,"children":1548},{"class":144,"line":1547},28,[1549],{"type":36,"tag":142,"props":1550,"children":1551},{},[1552],{"type":42,"value":1553},"    # Use SendGrid — see twilio-sendgrid-email\n",{"type":36,"tag":142,"props":1555,"children":1557},{"class":144,"line":1556},29,[1558],{"type":36,"tag":142,"props":1559,"children":1560},{},[1561],{"type":42,"value":1562},"    return {\"channel\": \"email\", \"status\": \"queued\"}\n",{"type":36,"tag":110,"props":1564,"children":1566},{"id":1565},"_6-voice-concurrency-limits",[1567],{"type":42,"value":1568},"6. Voice Concurrency Limits",{"type":36,"tag":609,"props":1570,"children":1571},{},[1572,1592],{"type":36,"tag":613,"props":1573,"children":1574},{},[1575],{"type":36,"tag":617,"props":1576,"children":1577},{},[1578,1583,1588],{"type":36,"tag":621,"props":1579,"children":1580},{},[1581],{"type":42,"value":1582},"Resource",{"type":36,"tag":621,"props":1584,"children":1585},{},[1586],{"type":42,"value":1587},"Default limit",{"type":36,"tag":621,"props":1589,"children":1590},{},[1591],{"type":42,"value":640},{"type":36,"tag":642,"props":1593,"children":1594},{},[1595,1613,1631,1647],{"type":36,"tag":617,"props":1596,"children":1597},{},[1598,1603,1608],{"type":36,"tag":649,"props":1599,"children":1600},{},[1601],{"type":42,"value":1602},"Concurrent calls per account",{"type":36,"tag":649,"props":1604,"children":1605},{},[1606],{"type":42,"value":1607},"1 (trial) \u002F variable (paid)",{"type":36,"tag":649,"props":1609,"children":1610},{},[1611],{"type":42,"value":1612},"Request increase via support",{"type":36,"tag":617,"props":1614,"children":1615},{},[1616,1621,1626],{"type":36,"tag":649,"props":1617,"children":1618},{},[1619],{"type":42,"value":1620},"Calls per second (CPS)",{"type":36,"tag":649,"props":1622,"children":1623},{},[1624],{"type":42,"value":1625},"1 CPS (default)",{"type":36,"tag":649,"props":1627,"children":1628},{},[1629],{"type":42,"value":1630},"Increase via support for outbound campaigns",{"type":36,"tag":617,"props":1632,"children":1633},{},[1634,1639,1644],{"type":36,"tag":649,"props":1635,"children":1636},{},[1637],{"type":42,"value":1638},"Conference participants",{"type":36,"tag":649,"props":1640,"children":1641},{},[1642],{"type":42,"value":1643},"250 per conference",{"type":36,"tag":649,"props":1645,"children":1646},{},[],{"type":36,"tag":617,"props":1648,"children":1649},{},[1650,1655,1660],{"type":36,"tag":649,"props":1651,"children":1652},{},[1653],{"type":42,"value":1654},"Twilio Functions concurrent",{"type":36,"tag":649,"props":1656,"children":1657},{},[1658],{"type":42,"value":1659},"30 per service",{"type":36,"tag":649,"props":1661,"children":1662},{},[1663],{"type":42,"value":1664},"Use thin-receiver pattern above",{"type":36,"tag":45,"props":1666,"children":1667},{},[1668],{"type":42,"value":1669},"For outbound campaigns, request CPS increase before launch — not during.",{"type":36,"tag":110,"props":1671,"children":1673},{"id":1672},"_7-webhook-timeout-handling",[1674],{"type":42,"value":1675},"7. Webhook Timeout Handling",{"type":36,"tag":45,"props":1677,"children":1678},{},[1679,1681,1686,1688,1692],{"type":42,"value":1680},"Twilio expects a response within ",{"type":36,"tag":125,"props":1682,"children":1683},{},[1684],{"type":42,"value":1685},"15 seconds",{"type":42,"value":1687}," for voice webhooks and ",{"type":36,"tag":125,"props":1689,"children":1690},{},[1691],{"type":42,"value":1685},{"type":42,"value":1693}," for messaging webhooks. If your endpoint doesn't respond:",{"type":36,"tag":66,"props":1695,"children":1696},{},[1697,1708],{"type":36,"tag":70,"props":1698,"children":1699},{},[1700,1702],{"type":42,"value":1701},"Voice: Twilio hangs up or falls back to ",{"type":36,"tag":86,"props":1703,"children":1705},{"className":1704},[],[1706],{"type":42,"value":1707},"voiceFallbackUrl",{"type":36,"tag":70,"props":1709,"children":1710},{},[1711],{"type":42,"value":1712},"Messaging: Twilio retries the callback",{"type":36,"tag":45,"props":1714,"children":1715},{},[1716],{"type":36,"tag":125,"props":1717,"children":1718},{},[1719],{"type":42,"value":1720},"Always configure fallback URLs:",{"type":36,"tag":131,"props":1722,"children":1724},{"className":133,"code":1723,"language":135,"meta":136,"style":136},"# On phone number configuration\nnumber = client.incoming_phone_numbers(phone_sid).update(\n    voice_url=\"https:\u002F\u002Fyourapp.com\u002Fvoice\",\n    voice_fallback_url=\"https:\u002F\u002Fyourapp.com\u002Fvoice-fallback\",  # backup endpoint\n    sms_url=\"https:\u002F\u002Fyourapp.com\u002Fsms\",\n    sms_fallback_url=\"https:\u002F\u002Fyourapp.com\u002Fsms-fallback\"\n)\n",[1725],{"type":36,"tag":86,"props":1726,"children":1727},{"__ignoreMap":136},[1728,1736,1744,1752,1760,1768,1776],{"type":36,"tag":142,"props":1729,"children":1730},{"class":144,"line":145},[1731],{"type":36,"tag":142,"props":1732,"children":1733},{},[1734],{"type":42,"value":1735},"# On phone number configuration\n",{"type":36,"tag":142,"props":1737,"children":1738},{"class":144,"line":154},[1739],{"type":36,"tag":142,"props":1740,"children":1741},{},[1742],{"type":42,"value":1743},"number = client.incoming_phone_numbers(phone_sid).update(\n",{"type":36,"tag":142,"props":1745,"children":1746},{"class":144,"line":164},[1747],{"type":36,"tag":142,"props":1748,"children":1749},{},[1750],{"type":42,"value":1751},"    voice_url=\"https:\u002F\u002Fyourapp.com\u002Fvoice\",\n",{"type":36,"tag":142,"props":1753,"children":1754},{"class":144,"line":173},[1755],{"type":36,"tag":142,"props":1756,"children":1757},{},[1758],{"type":42,"value":1759},"    voice_fallback_url=\"https:\u002F\u002Fyourapp.com\u002Fvoice-fallback\",  # backup endpoint\n",{"type":36,"tag":142,"props":1761,"children":1762},{"class":144,"line":182},[1763],{"type":36,"tag":142,"props":1764,"children":1765},{},[1766],{"type":42,"value":1767},"    sms_url=\"https:\u002F\u002Fyourapp.com\u002Fsms\",\n",{"type":36,"tag":142,"props":1769,"children":1770},{"class":144,"line":191},[1771],{"type":36,"tag":142,"props":1772,"children":1773},{},[1774],{"type":42,"value":1775},"    sms_fallback_url=\"https:\u002F\u002Fyourapp.com\u002Fsms-fallback\"\n",{"type":36,"tag":142,"props":1777,"children":1778},{"class":144,"line":200},[1779],{"type":36,"tag":142,"props":1780,"children":1781},{},[1782],{"type":42,"value":1783},")\n",{"type":36,"tag":56,"props":1785,"children":1786},{},[],{"type":36,"tag":37,"props":1788,"children":1790},{"id":1789},"monitoring-checklist",[1791],{"type":42,"value":1792},"Monitoring Checklist",{"type":36,"tag":45,"props":1794,"children":1795},{},[1796],{"type":42,"value":1797},"Set up these alerts before going to production:",{"type":36,"tag":609,"props":1799,"children":1800},{},[1801,1822],{"type":36,"tag":613,"props":1802,"children":1803},{},[1804],{"type":36,"tag":617,"props":1805,"children":1806},{},[1807,1812,1817],{"type":36,"tag":621,"props":1808,"children":1809},{},[1810],{"type":42,"value":1811},"Metric",{"type":36,"tag":621,"props":1813,"children":1814},{},[1815],{"type":42,"value":1816},"Alert threshold",{"type":36,"tag":621,"props":1818,"children":1819},{},[1820],{"type":42,"value":1821},"How to track",{"type":36,"tag":642,"props":1823,"children":1824},{},[1825,1843,1877,1895,1913],{"type":36,"tag":617,"props":1826,"children":1827},{},[1828,1833,1838],{"type":36,"tag":649,"props":1829,"children":1830},{},[1831],{"type":42,"value":1832},"429 error rate",{"type":36,"tag":649,"props":1834,"children":1835},{},[1836],{"type":42,"value":1837},"> 5% of requests",{"type":36,"tag":649,"props":1839,"children":1840},{},[1841],{"type":42,"value":1842},"Count 429s in your backoff handler",{"type":36,"tag":617,"props":1844,"children":1845},{},[1846,1851,1856],{"type":36,"tag":649,"props":1847,"children":1848},{},[1849],{"type":42,"value":1850},"Delivery failure rate",{"type":36,"tag":649,"props":1852,"children":1853},{},[1854],{"type":42,"value":1855},"> 2% of messages",{"type":36,"tag":649,"props":1857,"children":1858},{},[1859,1861,1867,1869,1875],{"type":42,"value":1860},"StatusCallback ",{"type":36,"tag":86,"props":1862,"children":1864},{"className":1863},[],[1865],{"type":42,"value":1866},"failed",{"type":42,"value":1868},"\u002F",{"type":36,"tag":86,"props":1870,"children":1872},{"className":1871},[],[1873],{"type":42,"value":1874},"undelivered",{"type":42,"value":1876}," events",{"type":36,"tag":617,"props":1878,"children":1879},{},[1880,1885,1890],{"type":36,"tag":649,"props":1881,"children":1882},{},[1883],{"type":42,"value":1884},"Webhook response time",{"type":36,"tag":649,"props":1886,"children":1887},{},[1888],{"type":42,"value":1889},"> 5 seconds p95",{"type":36,"tag":649,"props":1891,"children":1892},{},[1893],{"type":42,"value":1894},"Your APM tool (DataDog, New Relic)",{"type":36,"tag":617,"props":1896,"children":1897},{},[1898,1903,1908],{"type":36,"tag":649,"props":1899,"children":1900},{},[1901],{"type":42,"value":1902},"Queue depth",{"type":36,"tag":649,"props":1904,"children":1905},{},[1906],{"type":42,"value":1907},"Growing over 5 minutes",{"type":36,"tag":649,"props":1909,"children":1910},{},[1911],{"type":42,"value":1912},"Your message queue metrics",{"type":36,"tag":617,"props":1914,"children":1915},{},[1916,1921,1926],{"type":36,"tag":649,"props":1917,"children":1918},{},[1919],{"type":42,"value":1920},"Concurrent calls",{"type":36,"tag":649,"props":1922,"children":1923},{},[1924],{"type":42,"value":1925},"> 80% of limit",{"type":36,"tag":649,"props":1927,"children":1928},{},[1929],{"type":42,"value":1930},"Twilio Usage API or Event Streams",{"type":36,"tag":45,"props":1932,"children":1933},{},[1934],{"type":42,"value":1935},"Twilio's built-in alerting systems are under-used — end-users often discover issues before developers do. Configure StatusCallbacks + Event Streams for delivery failure alerts on every integration.",{"type":36,"tag":56,"props":1937,"children":1938},{},[],{"type":36,"tag":37,"props":1940,"children":1942},{"id":1941},"cannot",[1943],{"type":42,"value":1944},"CANNOT",{"type":36,"tag":66,"props":1946,"children":1947},{},[1948,1958,1968,1978,1988],{"type":36,"tag":70,"props":1949,"children":1950},{},[1951,1956],{"type":36,"tag":125,"props":1952,"children":1953},{},[1954],{"type":42,"value":1955},"Cannot avoid 429 errors on any Twilio API",{"type":42,"value":1957}," — Backoff patterns apply to all APIs (Messaging, Voice, Verify, Lookup)",{"type":36,"tag":70,"props":1959,"children":1960},{},[1961,1966],{"type":36,"tag":125,"props":1962,"children":1963},{},[1964],{"type":42,"value":1965},"Cannot increase per-number throughput",{"type":42,"value":1967}," — Add more numbers via Messaging Services instead",{"type":36,"tag":70,"props":1969,"children":1970},{},[1971,1976],{"type":36,"tag":125,"props":1972,"children":1973},{},[1974],{"type":42,"value":1975},"Cannot configure StatusCallback retry behavior",{"type":42,"value":1977}," — Twilio retries on timeout automatically; not configurable",{"type":36,"tag":70,"props":1979,"children":1980},{},[1981,1986],{"type":36,"tag":125,"props":1982,"children":1983},{},[1984],{"type":42,"value":1985},"Cannot exceed Twilio Functions limits",{"type":42,"value":1987}," — 30 concurrent executions\u002Fservice, 10-second timeout, 256 MB memory",{"type":36,"tag":70,"props":1989,"children":1990},{},[1991,1996],{"type":36,"tag":125,"props":1992,"children":1993},{},[1994],{"type":42,"value":1995},"Cannot use a native Twilio rate limiting API",{"type":42,"value":1997}," — You must implement rate limiting in your application",{"type":36,"tag":56,"props":1999,"children":2000},{},[],{"type":36,"tag":37,"props":2002,"children":2004},{"id":2003},"next-steps",[2005],{"type":42,"value":2006},"Next Steps",{"type":36,"tag":66,"props":2008,"children":2009},{},[2010,2025,2041,2056],{"type":36,"tag":70,"props":2011,"children":2012},{},[2013,2018,2020],{"type":36,"tag":125,"props":2014,"children":2015},{},[2016],{"type":42,"value":2017},"Messaging at scale:",{"type":42,"value":2019}," ",{"type":36,"tag":86,"props":2021,"children":2023},{"className":2022},[],[2024],{"type":42,"value":91},{"type":36,"tag":70,"props":2026,"children":2027},{},[2028,2033,2034,2039],{"type":36,"tag":125,"props":2029,"children":2030},{},[2031],{"type":42,"value":2032},"Monitor delivery:",{"type":42,"value":2019},{"type":36,"tag":86,"props":2035,"children":2037},{"className":2036},[],[2038],{"type":42,"value":99},{"type":42,"value":2040}," (StatusCallbacks)",{"type":36,"tag":70,"props":2042,"children":2043},{},[2044,2049,2050],{"type":36,"tag":125,"props":2045,"children":2046},{},[2047],{"type":42,"value":2048},"Debug failures:",{"type":42,"value":2019},{"type":36,"tag":86,"props":2051,"children":2053},{"className":2052},[],[2054],{"type":42,"value":2055},"twilio-debugging-observability",{"type":36,"tag":70,"props":2057,"children":2058},{},[2059,2064,2065],{"type":36,"tag":125,"props":2060,"children":2061},{},[2062],{"type":42,"value":2063},"Compliance for bulk sends:",{"type":42,"value":2019},{"type":36,"tag":86,"props":2066,"children":2068},{"className":2067},[],[2069],{"type":42,"value":2070},"twilio-compliance-traffic",{"type":36,"tag":2072,"props":2073,"children":2074},"style",{},[2075],{"type":42,"value":2076},"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":2078,"total":2281},[2079,2100,2123,2140,2154,2173,2192,2208,2224,2238,2250,2265],{"slug":2080,"name":2080,"fn":2081,"description":2082,"org":2083,"tags":2084,"stars":2097,"repoUrl":2098,"updatedAt":2099},"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},[2085,2088,2091,2094],{"name":2086,"slug":2087,"type":15},"Documents","documents",{"name":2089,"slug":2090,"type":15},"Healthcare","healthcare",{"name":2092,"slug":2093,"type":15},"Insurance","insurance",{"name":2095,"slug":2096,"type":15},"Regulatory Compliance","regulatory-compliance",28169,"https:\u002F\u002Fgithub.com\u002Fopenai\u002Fopenai-agents-python","2026-04-16T05:11:39.180399",{"slug":2101,"name":2101,"fn":2102,"description":2103,"org":2104,"tags":2105,"stars":2120,"repoUrl":2121,"updatedAt":2122},"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},[2106,2109,2111,2114,2117],{"name":2107,"slug":2108,"type":15},".NET","dotnet",{"name":2110,"slug":2101,"type":15},"ASP.NET Core",{"name":2112,"slug":2113,"type":15},"Blazor","blazor",{"name":2115,"slug":2116,"type":15},"C#","csharp",{"name":2118,"slug":2119,"type":15},"Web Development","web-development",23787,"https:\u002F\u002Fgithub.com\u002Fopenai\u002Fskills","2026-04-12T05:07:02.819491",{"slug":2124,"name":2124,"fn":2125,"description":2126,"org":2127,"tags":2128,"stars":2120,"repoUrl":2121,"updatedAt":2139},"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},[2129,2132,2135,2138],{"name":2130,"slug":2131,"type":15},"Apps SDK","apps-sdk",{"name":2133,"slug":2134,"type":15},"ChatGPT","chatgpt",{"name":2136,"slug":2137,"type":15},"MCP","mcp",{"name":9,"slug":8,"type":15},"2026-04-12T05:07:05.468097",{"slug":2141,"name":2141,"fn":2142,"description":2143,"org":2144,"tags":2145,"stars":2120,"repoUrl":2121,"updatedAt":2153},"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},[2146,2147,2150],{"name":13,"slug":14,"type":15},{"name":2148,"slug":2149,"type":15},"CLI","cli",{"name":2151,"slug":2152,"type":15},"Codex","codex","2026-04-12T05:07:04.132762",{"slug":2155,"name":2155,"fn":2156,"description":2157,"org":2158,"tags":2159,"stars":2120,"repoUrl":2121,"updatedAt":2172},"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},[2160,2163,2166,2169],{"name":2161,"slug":2162,"type":15},"Cloudflare","cloudflare",{"name":2164,"slug":2165,"type":15},"Cloudflare Pages","cloudflare-pages",{"name":2167,"slug":2168,"type":15},"Cloudflare Workers","cloudflare-workers",{"name":2170,"slug":2171,"type":15},"Deployment","deployment","2026-04-12T05:07:14.275118",{"slug":2174,"name":2174,"fn":2175,"description":2176,"org":2177,"tags":2178,"stars":2120,"repoUrl":2121,"updatedAt":2191},"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},[2179,2182,2185,2188],{"name":2180,"slug":2181,"type":15},"Productivity","productivity",{"name":2183,"slug":2184,"type":15},"Project Management","project-management",{"name":2186,"slug":2187,"type":15},"Strategy","strategy",{"name":2189,"slug":2190,"type":15},"Task Management","task-management","2026-05-23T06:17:16.870838",{"slug":2193,"name":2193,"fn":2194,"description":2195,"org":2196,"tags":2197,"stars":2120,"repoUrl":2121,"updatedAt":2207},"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},[2198,2201,2203,2206],{"name":2199,"slug":2200,"type":15},"Design","design",{"name":2202,"slug":2193,"type":15},"Figma",{"name":2204,"slug":2205,"type":15},"Frontend","frontend",{"name":2136,"slug":2137,"type":15},"2026-04-12T05:06:47.939943",{"slug":2209,"name":2209,"fn":2210,"description":2211,"org":2212,"tags":2213,"stars":2120,"repoUrl":2121,"updatedAt":2223},"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},[2214,2215,2218,2219,2220],{"name":2199,"slug":2200,"type":15},{"name":2216,"slug":2217,"type":15},"Design System","design-system",{"name":2202,"slug":2193,"type":15},{"name":2204,"slug":2205,"type":15},{"name":2221,"slug":2222,"type":15},"UI Components","ui-components","2026-05-10T05:59:52.971881",{"slug":2225,"name":2225,"fn":2226,"description":2227,"org":2228,"tags":2229,"stars":2120,"repoUrl":2121,"updatedAt":2237},"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},[2230,2231,2232,2235,2236],{"name":2199,"slug":2200,"type":15},{"name":2216,"slug":2217,"type":15},{"name":2233,"slug":2234,"type":15},"Documentation","documentation",{"name":2202,"slug":2193,"type":15},{"name":2204,"slug":2205,"type":15},"2026-05-16T06:07:47.821474",{"slug":2239,"name":2239,"fn":2240,"description":2241,"org":2242,"tags":2243,"stars":2120,"repoUrl":2121,"updatedAt":2249},"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},[2244,2245,2246,2247,2248],{"name":2199,"slug":2200,"type":15},{"name":2202,"slug":2193,"type":15},{"name":2204,"slug":2205,"type":15},{"name":2221,"slug":2222,"type":15},{"name":2118,"slug":2119,"type":15},"2026-05-16T06:07:40.583615",{"slug":2251,"name":2251,"fn":2252,"description":2253,"org":2254,"tags":2255,"stars":2120,"repoUrl":2121,"updatedAt":2264},"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},[2256,2259,2260,2263],{"name":2257,"slug":2258,"type":15},"Animation","animation",{"name":2151,"slug":2152,"type":15},{"name":2261,"slug":2262,"type":15},"Creative","creative",{"name":2199,"slug":2200,"type":15},"2026-05-02T05:31:48.48485",{"slug":2266,"name":2266,"fn":2267,"description":2268,"org":2269,"tags":2270,"stars":2120,"repoUrl":2121,"updatedAt":2280},"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},[2271,2272,2273,2276,2279],{"name":2261,"slug":2262,"type":15},{"name":2199,"slug":2200,"type":15},{"name":2274,"slug":2275,"type":15},"Image Generation","image-generation",{"name":2277,"slug":2278,"type":15},"Images","images",{"name":9,"slug":8,"type":15},"2026-05-15T06:23:24.312127",675,{"items":2283,"total":2396},[2284,2300,2316,2328,2346,2364,2384],{"slug":2285,"name":2285,"fn":2286,"description":2287,"org":2288,"tags":2289,"stars":19,"repoUrl":20,"updatedAt":21},"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},[2290,2293,2296,2299],{"name":2291,"slug":2292,"type":15},"Accessibility","accessibility",{"name":2294,"slug":2295,"type":15},"Charts","charts",{"name":2297,"slug":2298,"type":15},"Data Visualization","data-visualization",{"name":2199,"slug":2200,"type":15},{"slug":2301,"name":2301,"fn":2302,"description":2303,"org":2304,"tags":2305,"stars":19,"repoUrl":20,"updatedAt":2315},"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},[2306,2309,2312],{"name":2307,"slug":2308,"type":15},"Agents","agents",{"name":2310,"slug":2311,"type":15},"Browser Automation","browser-automation",{"name":2313,"slug":2314,"type":15},"Testing","testing","2026-04-06T18:41:03.44016",{"slug":2317,"name":2317,"fn":2318,"description":2319,"org":2320,"tags":2321,"stars":19,"repoUrl":20,"updatedAt":2327},"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},[2322,2323,2326],{"name":2310,"slug":2311,"type":15},{"name":2324,"slug":2325,"type":15},"Local Development","local-development",{"name":2313,"slug":2314,"type":15},"2026-04-06T18:41:17.526867",{"slug":2329,"name":2329,"fn":2330,"description":2331,"org":2332,"tags":2333,"stars":19,"repoUrl":20,"updatedAt":2345},"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},[2334,2335,2336,2339,2342],{"name":2307,"slug":2308,"type":15},{"name":2167,"slug":2168,"type":15},{"name":2337,"slug":2338,"type":15},"SDK","sdk",{"name":2340,"slug":2341,"type":15},"Serverless","serverless",{"name":2343,"slug":2344,"type":15},"WebSockets","websockets","2026-04-06T18:39:51.717063",{"slug":2347,"name":2347,"fn":2348,"description":2349,"org":2350,"tags":2351,"stars":19,"repoUrl":20,"updatedAt":2363},"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},[2352,2353,2356,2359,2360],{"name":2204,"slug":2205,"type":15},{"name":2354,"slug":2355,"type":15},"React","react",{"name":2357,"slug":2358,"type":15},"shadcn\u002Fui","shadcn-ui",{"name":2221,"slug":2222,"type":15},{"name":2361,"slug":2362,"type":15},"Vercel","vercel","2026-04-06T18:40:59.619419",{"slug":2365,"name":2365,"fn":2366,"description":2367,"org":2368,"tags":2369,"stars":19,"repoUrl":20,"updatedAt":2383},"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},[2370,2373,2376,2379,2382],{"name":2371,"slug":2372,"type":15},"AI Infrastructure","ai-infrastructure",{"name":2374,"slug":2375,"type":15},"Cost Optimization","cost-optimization",{"name":2377,"slug":2378,"type":15},"LLM","llm",{"name":2380,"slug":2381,"type":15},"Performance","performance",{"name":2361,"slug":2362,"type":15},"2026-04-06T18:40:44.377464",{"slug":2385,"name":2385,"fn":2386,"description":2387,"org":2388,"tags":2389,"stars":19,"repoUrl":20,"updatedAt":2395},"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},[2390,2391,2394],{"name":2374,"slug":2375,"type":15},{"name":2392,"slug":2393,"type":15},"Database","database",{"name":2377,"slug":2378,"type":15},"2026-04-06T18:41:08.513425",600]