Labsco
openai logo

twilio-send-message

✓ Official4,081

by openai · part of openai/plugins

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 us

🧩 One of 7 skills in the openai/plugins package — works on its own, and pairs well with its siblings.

This is the playbook your agent receives when the skill activates — you don't need to read it to use the skill, but it's here to audit before installing.

Overview

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.

Channelto formatNotesTemplate required?
SMS/MMS+15551234567MMS: US/CA/AU onlyNo
RCS (with SMS fallback)+15551234567Send via Messaging Service that has both an RCS sender and an SMS sender — Twilio attempts RCS first, falls back to SMS on failureNo
RCS (no fallback)rcs:+15551234567Forces RCS only — fails if recipient isn't RCS-capableNo
WhatsAppwhatsapp:+15551234567Send via whatsapp:-prefixed fromOutside 24-hr window: yes

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.


Key Patterns

Send with media (MMS, WhatsApp, RCS)

client.messages.create(
    from_="+15017122661",
    to="+15558675310",
    body="Here is your invoice.",
    media_url=["https://example.com/invoice.pdf"]
)

Supported: images (JPEG, PNG, GIF), PDF, audio, video. 5 MB max per attachment.

Send a template (WhatsApp required outside 24-hr window; RCS rich content)

client.messages.create(
    messaging_service_sid="MGxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
    to="+15558675310",
    content_sid="HXxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
    content_variables='{"1": "Sarah", "2": "12345"}'
)

See twilio-content-template-builder for building templates.

Track delivery status

client.messages.create(
    messaging_service_sid="MGxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
    to="+15558675310",
    body="Hello!",
    status_callback="https://yourapp.com/status"
)

Twilio POSTs at each state transition: queued → sent → delivered (or failed/undelivered).

Configure RCS→SMS fallback

Configured 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.


CANNOT

  • 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.
  • Cannot send WhatsApp free-form outside the 24-hour service window. Use a pre-approved template (content_sid). See twilio-whatsapp-send-message.
  • Cannot send MMS outside US/Canada. For international rich media, use WhatsApp or RCS.
  • Cannot configure RCS→SMS fallback without a Messaging Service. Raw from sends don't support FallbackFrom.
  • Cannot guarantee delivery on any channel. Always implement status callbacks.

Next Steps

  • Pick a channel for your use case: twilio-messaging-channel-advisor
  • Full messaging platform overview: twilio-messaging-overview
  • Channel-specific deep dives: twilio-sms-send-message, twilio-rcs-messaging, twilio-whatsapp-send-message
  • Sender pools, fallback, production features: twilio-messaging-services
  • Build templates (cards, carousels, quick replies): twilio-content-template-builder
  • Handle inbound messages and status callbacks: twilio-messaging-webhooks
  • US A2P 10DLC compliance: twilio-compliance-onboarding
  • OTP / verification use cases: twilio-verify-send-otp