Twilio SMS & Messaging
Lets an agent send SMS, MMS and WhatsApp messages through Twilio, check delivery status, browse message history and media, cancel scheduled messages, and list the account's phone numbers. Curated from Twilio's official OpenAPI specification.
Connect this API to an AI agent Browse all specs
What you can do with Twilio SMS & Messaging via MCP
Every endpoint below becomes a governed tool your AI agent (Claude, ChatGPT, or a customer-facing VX agent) can call — with scoped permissions, sandbox testing, and audit logs.
| Method | Path | Operation | Description |
|---|---|---|---|
| GET | /2010-04-01/Accounts/{Sid}.json |
getAccount | Get the Twilio account's name, status and type (trial or full) |
| GET | /2010-04-01/Accounts/{AccountSid}/IncomingPhoneNumbers.json |
listIncomingPhoneNumbers | List the phone numbers the account owns (possible senders) |
| GET | /2010-04-01/Accounts/{AccountSid}/Messages.json |
listMessages | List sent and received messages, filtered by number or date |
| POST | /2010-04-01/Accounts/{AccountSid}/Messages.json |
sendMessage | Send (or schedule) an SMS, MMS or WhatsApp message |
| GET | /2010-04-01/Accounts/{AccountSid}/Messages/{Sid}.json |
getMessage | Get one message with its delivery status, price and error code |
| POST | /2010-04-01/Accounts/{AccountSid}/Messages/{Sid}.json |
updateMessage | Cancel a scheduled message or redact a message body |
| DELETE | /2010-04-01/Accounts/{AccountSid}/Messages/{Sid}.json |
deleteMessage | Permanently delete a message record from the account log |
| GET | /2010-04-01/Accounts/{AccountSid}/Messages/{MessageSid}/Media.json |
listMessageMedia | List images or files attached to an MMS/WhatsApp message |
| GET | /2010-04-01/Accounts/{AccountSid}/Messages/{MessageSid}/Media/{Sid}.json |
getMessageMedia | Get details of one attached media file |
Authentication
accountSid_authToken
HTTP Basic
HTTP Basic auth: username = Account SID (AC...), password = Auth Token. An API key works too: username = API Key SID (SK...), password = API key secret.
How to get a credential
- Sign in to the Twilio Console (https://console.twilio.com).
- On the dashboard under Account Info, copy the Account SID and reveal/copy the Auth Token.
- Recommended: create a restricted key instead in Account > API keys & tokens > Create API key (type Standard) and use its SID + secret.
- Buy or verify a sender: a Twilio phone number with SMS capability, a Messaging Service, or an approved WhatsApp sender.
Permissions used
Twilio Basic credentials are account-wide; there are no per-operation scopes.
| Credential | Operations |
|---|---|
| Account SID + Auth Token, or Standard API key | getAccount, listIncomingPhoneNumbers, listMessages, getMessage, listMessageMedia, getMessageMedia, sendMessage, updateMessage, deleteMessage |
Common errors
- 401 Unauthorized (code 20003): wrong SID/token pair, or the
AccountSidpath value does not match the account of the key. Re-copy both values. - 403 Forbidden: account suspended, or trial account sending to an unverified number (21608). Upgrade or verify the recipient.
- 400 Bad Request: invalid
To/From(21211, 21606), number not SMS-capable, or missingBody/MediaUrl/ContentSid. Use E.164 numbers like+14155550100. - 429 Too Many Requests (20429): too many concurrent requests; back off and retry.
Store the SID and token (or API key SID and secret) as a VX Agents credential (Basic auth) for this spec; never paste them into chat.
Usage guide
Setup
- Credential: Basic auth with Account SID + Auth Token, or a Standard API key SID + secret (Twilio Console > Account > API keys & tokens).
- Pin
AccountSid(AC...) as a preset: every call needs it in the path.getAccountuses it asSid. - Worth pinning: the default sender (
Fromnumber orMessagingServiceSidMG...). UselistIncomingPhoneNumbersto find numbers with SMS capability.
Send a message
- Check the sender:
listIncomingPhoneNumbers(look atcapabilities.sms/mms). sendMessagewithTo, a sender (FromorMessagingServiceSid) andBody(and/orMediaUrlfor MMS).- WhatsApp: prefix both numbers, e.g.
To=whatsapp:+14155550100,From=whatsapp:+14155550199. Outside the 24-hour session window WhatsApp requires an approved template (ContentSid+ContentVariables). - Schedule:
MessagingServiceSid+ScheduleType=fixed+SendAt(ISO 8601, 15 min to 35 days ahead).
- WhatsApp: prefix both numbers, e.g.
- Track delivery with
getMessage:statusgoes queued > sent > delivered (orundelivered/failedwitherror_code). - Cancel a scheduled message with
updateMessageStatus=canceled; redact a sent body withBody="".
Confirm before writing: sending costs money and reaches real people. Show the user the recipient(s), sender and exact text, and wait for approval before sendMessage. Ask again before updateMessage or deleteMessage; deletion is permanent.
Review history
listMessagesfiltered byTo,FromorDateSent>/DateSent<(YYYY-MM-DD),PageSizeup to 1000; follownext_page_urifor more.getMessageshowsprice,num_segmentsanderror_code;listMessageMedia/getMessageMediafor MMS attachments.
Good to know
- Phone numbers must be E.164 (
+country code, no spaces). - Ids:
SM/MMmessage,MEmedia,PNphone number,MGmessaging service. - One SMS segment = 160 GSM-7 chars or 70 UCS-2 (emoji) chars; long texts are billed per segment.
- Trial accounts can only text verified numbers and prefix a trial notice.
- Requests are form-encoded; the response dates are RFC 2822 strings.
How to use this spec
- Create a free VX Agents account (sandbox tools included).
- Open the marketplace and connect “Twilio SMS & Messaging” to an agent.
- Expose it as an MCP server for Claude/ChatGPT, or chat with it directly.