{"id":7522,"plugin_id":"Plugin_c266c85897248191be15eb07c415f89e","kind":"skill","collection_source":null,"comparison_source":null,"observed_at":"2026-09-30T22:50:44.830Z","digest":"7aedfebacc8a38eb2801b4100355c70518c82be697f92d9e5a9180b80157af5b","against":null,"payload":{"name":"twilio-send-message","description":"Send messages via Twilio's Programmable Messaging API across all channels — SMS, MMS, RCS, and WhatsApp. Covers text messages, media, rich content (cards, carousels, buttons), template-based sends, Messaging Services, status callbacks, and WhatsApp's 24-hour service window. Use when the user wants to send a message — whether they say \"send SMS\", \"text message\", \"branded message\", \"rich message\", \"WhatsApp message\", \"RCS message\", \"notification\", or \"alert\". For picking the right channel for a use case, first consult twilio-messaging-channel-advisor.","included_files":[{"relative_path":"agents/openai.yaml","size_in_bytes":219}],"skill_md_contents":"---\nname: twilio-send-message\ndescription: >\n  Send messages via Twilio's Programmable Messaging API across all\n  channels — SMS, MMS, RCS, and WhatsApp. Covers text messages, media,\n  rich content (cards, carousels, buttons), template-based sends,\n  Messaging Services, status callbacks, and WhatsApp's 24-hour service\n  window. Use when the user wants to send a message — whether they\n  say \"send SMS\", \"text message\", \"branded message\", \"rich message\",\n  \"WhatsApp message\", \"RCS message\", \"notification\", or \"alert\". For\n  picking the right channel for a use case, first consult\n  twilio-messaging-channel-advisor.\n---\n\n## Overview\n\n**A single `messages.create()` call sends on any messaging channel — SMS, MMS, RCS, or WhatsApp.** The channel is determined by the sender address and the recipient's capabilities. For channel selection guidance and the full onboarding sequence, see `twilio-messaging-overview` and `twilio-messaging-channel-advisor`.\n\n| Channel | `to` format | Notes | Template required? |\n|---------|-------------|-------|--------------------|\n| SMS/MMS | `+15551234567` | MMS: US/CA/AU only | No |\n| RCS (with SMS fallback) | `+15551234567` | Send via Messaging Service that has both an RCS sender and an SMS sender — Twilio attempts RCS first, falls back to SMS on failure | No |\n| RCS (no fallback) | `rcs:+15551234567` | Forces RCS only — fails if recipient isn't RCS-capable | No |\n| WhatsApp | `whatsapp:+15551234567` | Send via `whatsapp:`-prefixed `from` | Outside 24-hr window: yes |\n\n**For production:** Send via `messagingServiceSid` instead of `from`. This enables sender pool management, RCS→SMS fallback, SMS pumping protection, link shortening, compliance toolkit, and scheduling. See `twilio-messaging-services`.\n\n---\n\n## Prerequisites\n\n- Twilio account — New to Twilio? See `twilio-account-setup`\n- Environment variables: `TWILIO_ACCOUNT_SID`, `TWILIO_AUTH_TOKEN` — see `twilio-iam-auth-setup`\n- SDK: `pip install twilio` / `npm install twilio`\n- Channel-specific senders:\n  - SMS/MMS: a Twilio phone number (see `twilio-account-setup`)\n  - RCS: an RCS sender added to a Messaging Service (see `twilio-rcs-messaging`)\n  - WhatsApp: an active WhatsApp sender (see `twilio-whatsapp-send-message` for sandbox, `twilio-whatsapp-manage-senders` for production)\n\n---\n\n## Quickstart\n\n**Python**\n```python\nimport os\nfrom twilio.rest import Client\n\nclient = Client(os.environ[\"TWILIO_ACCOUNT_SID\"], os.environ[\"TWILIO_AUTH_TOKEN\"])\n\n# SMS\nsms = client.messages.create(\n    from_=\"+15017122661\",\n    to=\"+15558675310\",\n    body=\"Your order has shipped.\"\n)\n\n# RCS — forces RCS only, no fallback\nrcs = client.messages.create(\n    messaging_service_sid=\"MGxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\",\n    to=\"rcs:+15558675310\",\n    body=\"Your order has shipped.\"\n)\n\n# WhatsApp\nwhatsapp = client.messages.create(\n    from_=\"whatsapp:+15017122661\",\n    to=\"whatsapp:+15558675310\",\n    body=\"Your order has shipped.\"\n)\n\n# Via Messaging Service (recommended — attempts RCS first, falls back to SMS)\nmsg = client.messages.create(\n    messaging_service_sid=\"MGxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\",\n    to=\"+15558675310\",\n    body=\"Your order has shipped.\"\n)\n```\n\n**Node.js**\n```javascript\nconst client = require(\"twilio\")(process.env.TWILIO_ACCOUNT_SID, process.env.TWILIO_AUTH_TOKEN);\n\n// SMS\nconst sms = await client.messages.create({\n    from: \"+15017122661\",\n    to: \"+15558675310\",\n    body: \"Your order has shipped.\",\n});\n\n// RCS — forces RCS only, no fallback\nconst rcs = await client.messages.create({\n    messagingServiceSid: \"MGxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\",\n    to: \"rcs:+15558675310\",\n    body: \"Your order has shipped.\",\n});\n\n// WhatsApp\nconst whatsapp = await client.messages.create({\n    from: \"whatsapp:+15017122661\",\n    to: \"whatsapp:+15558675310\",\n    body: \"Your order has shipped.\",\n});\n\n// Via Messaging Service (attempts RCS first, falls back to SMS)\nconst msg = await client.messages.create({\n    messagingServiceSid: \"MGxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\",\n    to: \"+15558675310\",\n    body: \"Your order has shipped.\",\n});\n```\n\n---\n\n## Key Patterns\n\n### Send with media (MMS, WhatsApp, RCS)\n\n```python\nclient.messages.create(\n    from_=\"+15017122661\",\n    to=\"+15558675310\",\n    body=\"Here is your invoice.\",\n    media_url=[\"https://example.com/invoice.pdf\"]\n)\n```\n\nSupported: images (JPEG, PNG, GIF), PDF, audio, video. 5 MB max per attachment.\n\n### Send a template (WhatsApp required outside 24-hr window; RCS rich content)\n\n```python\nclient.messages.create(\n    messaging_service_sid=\"MGxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\",\n    to=\"+15558675310\",\n    content_sid=\"HXxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\",\n    content_variables='{\"1\": \"Sarah\", \"2\": \"12345\"}'\n)\n```\n\nSee `twilio-content-template-builder` for building templates.\n\n### Track delivery status\n\n```python\nclient.messages.create(\n    messaging_service_sid=\"MGxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\",\n    to=\"+15558675310\",\n    body=\"Hello!\",\n    status_callback=\"https://yourapp.com/status\"\n)\n```\n\nTwilio POSTs at each state transition: `queued → sent → delivered` (or `failed`/`undelivered`).\n\n### Configure RCS→SMS fallback\n\nConfigured on the Messaging Service, not per-message. Add both an RCS sender and an SMS sender to the same Messaging Service. Twilio attempts RCS first and falls back to SMS on failure. See `twilio-messaging-services` and `twilio-rcs-messaging`.\n\n---\n\n## Common Errors\n\n| Code | Meaning | Fix |\n|------|---------|-----|\n| 21211 | Invalid `to` number | Validate E.164 format |\n| 21408 | Region not permitted | Enable geo-permissions in Console |\n| 21610 | Recipient opted out | Do not retry; respect opt-out |\n| 21664 | `FallbackFrom` cannot be used with `From` sender | Use `messaging_service_sid` instead of `from` |\n| 21666 | `FallbackFrom` requires `MessagingServiceSid` | Send via a Messaging Service |\n| 21667 | `FallbackFrom` requires an RCS Sender on the Messaging Service | Add an RCS sender before configuring fallback |\n| 30003 | Unreachable destination | Carrier cannot deliver |\n| 30007 | Message filtered as spam | Review content and sender reputation |\n| 30034 | US A2P 10DLC — sender not registered | Register brand + campaign. See `twilio-compliance-onboarding` |\n| 30036 | Validity Period expired | Message aged out. Often indicates RCS fallback is misconfigured |\n| 63036 | RCS recipient unreachable | Configure SMS fallback on the Messaging Service |\n\n---\n\n## CANNOT\n\n- **Cannot send cross-channel in a single API call.** One `messages.create()` = one channel. For multi-channel fallback, use RCS→SMS via a Messaging Service, or implement sequencing in your app.\n- **Cannot send WhatsApp free-form outside the 24-hour service window.** Use a pre-approved template (`content_sid`). See `twilio-whatsapp-send-message`.\n- **Cannot send MMS outside US/Canada.** For international rich media, use WhatsApp or RCS.\n- **Cannot configure RCS→SMS fallback without a Messaging Service.** Raw `from` sends don't support `FallbackFrom`.\n- **Cannot guarantee delivery on any channel.** Always implement status callbacks.\n\n---\n\n## Next Steps\n\n- **Pick a channel for your use case:** `twilio-messaging-channel-advisor`\n- **Full messaging platform overview:** `twilio-messaging-overview`\n- **Channel-specific deep dives:** `twilio-sms-send-message`, `twilio-rcs-messaging`, `twilio-whatsapp-send-message`\n- **Sender pools, fallback, production features:** `twilio-messaging-services`\n- **Build templates (cards, carousels, quick replies):** `twilio-content-template-builder`\n- **Handle inbound messages and status callbacks:** `twilio-messaging-webhooks`\n- **US A2P 10DLC compliance:** `twilio-compliance-onboarding`\n- **OTP / verification use cases:** `twilio-verify-send-otp`\n"},"changes":[],"summary":"First saved snapshot. No earlier version is available for comparison.","summary_kind":"deterministic","summary_metadata":{}}