Twilio
Your Twilio, in two nodes on one connected credential. The action sends SMS and WhatsApp, reads your messages and looks up your numbers and templates — 8 operations — and can also be an AI toolkit with two limits on what it can spend. The trigger fires a flow when someone texts or WhatsApps one of your numbers.
Setup
Connect Twilio under Settings → Credentials, or straight from the node or the trigger. Twilio has no “sign in with Twilio” for this, so you paste three things: your Account SID (starts with AC), an API key SID (starts with SK) and its secret — shown only once, when you create the key. In Twilio go to Account → API keys & tokens and Create API key. Pick Restricted, so the key can do only what you tick; a Standard key works too, but it can do far more than HostWebhook needs.
AC where the key SID goes is rejected before it leaves your browser. Only accounts on Twilio's US region are supported for now (most accounts).When you connect, HostWebhook makes 4 read-only calls to check the key: the first, your phone numbers, is the check itself — if it fails, nothing is saved. The other three only tell the panel what to offer (reading messages, the trigger, templates). Sending can't be tested without sending, so a key without that permission fails on the first send, and the message says which permission to add.
Which permissions does the key need?
| Permission | What it is for |
|---|---|
| twilio/messaging/messages/create | Send SMS, MMS and WhatsApp |
| twilio/messaging/messages/list · read | List and read messages, and the Test push |
| twilio/messaging/messages.media/list · read | A message's files |
| twilio/phone-numbers/active-numbers/list · read | Check the key when connecting, the From and Number pickers, the own-number guard |
| twilio/messaging/services/list | The Messaging Service picker |
| twilio/messaging/whatsapp-senders/list | The WhatsApp sender picker |
| twilio/messaging/content-templates/list · read | The template picker and its variables |
| /twilio/event-streams/sink/create · read · list · delete | The trigger's sink |
| /twilio/event-streams/sink.test/create | Test the sink when it is created |
| /twilio/event-streams/subscription/create · read · list · update · delete | The trigger's subscription and its types |
| /twilio/event-streams/subscription.subscribed-event/list | The Health check |
| /twilio/lookup/phone-numbers/read | Look up a number |
HostWebhook never asks to delete or change messages, buy or change numbers, create or change Messaging Services, templates or WhatsApp senders, or touch accounts, keys, billing or voice. Without a permission only the feature that needs it stops, and its message says which one to add.
A new key in Edit keys and settings has to be of the same account: its sinks and triggers belong to that account.
What each thing costs
Twilio has no daily limit of its own, only how many calls an account can make at once (it answers “busy” and HostWebhook waits and tries again, up to 3 times). The money is Twilio's price, on your account: HostWebhook adds nothing. Check Twilio's pricing page for your countries — an SMS to the US costs a fraction of a cent per segment plus the carrier's fee, to some countries it costs many times more. The two limits further down count those same segments, not messages: a short text is 1, a long one (or one with an emoji) is several. For example, 200 one-segment SMS a day to Mexico is tens of dollars, which is why the daily limit starts at 200. Twilio also charges a fraction of a cent for each text you receive and for each send that fails (a person who texted STOP, a WhatsApp number that cannot be reached).
| What | Calls to Twilio | Money in Twilio |
|---|---|---|
| Connecting a credential | 4 read-only checks | Nothing |
| Activating the first trigger of an account | 4 — your number, then the sink, its test and the subscription | Nothing: Event Streams is free |
| Activating another trigger of the same account | 1 to check the number, plus 1 if it needs a new event type | Nothing |
| Deactivating a trigger that isn't the last one | 0, or 1 per event type nobody needs any more | Nothing |
| Deactivating or deleting the last trigger of an account | 2 — the subscription, then the sink | Nothing |
| A message arriving at a trigger | 0 — the notice carries the text. With “Download media” and files: 1 to list them, plus 1 for each file | Nothing from HostWebhook. Twilio charges you the incoming SMS whether or not it reaches us |
| Test push | 1 | Nothing |
| Health check (once a day) | 2 per account — and 3 more when it has to rebuild the sink | Nothing |
| Send an SMS | 1 | Twilio's price per segment, plus the carrier's fee |
| Send a WhatsApp message | 1 | Twilio's price per message, plus Meta's fee for the template |
| List or read messages | 1 per page | Nothing |
| Look up a number | 1 | Nothing (the basic lookup) |
| Each dropdown in the panel (numbers, services, senders, templates) | 1 each time you open it or press Refresh — the answer is kept for 60 seconds | Nothing |
| Deleting a credential | 2 if it had a sink | Nothing |
Operations
Send
| Value | In the dropdown | What it does |
|---|---|---|
| sendSms | Send SMS | A text message, or an MMS if it has files. Each message costs money in your Twilio account. |
| sendWhatsapp | Send WhatsApp | A WhatsApp message: free text within 24 hours of the person's last message, or an approved template. |
Messages
| Value | In the dropdown | What it does |
|---|---|---|
| listMessages | List messages | The messages of the account, newest first, each with its status, price and error. Narrow them by number or date. |
| getMessage | Get message | One message by its SID, with the list of its files. |
Structure
| Value | In the dropdown | What it does |
|---|---|---|
| listPhoneNumbers | List phone numbers | The numbers of the account, with what each one can do (SMS, MMS, voice). |
| listMessagingServices | List Messaging Services | The Messaging Services of the account. |
| listTemplates | List templates | The message templates, with their WhatsApp approval status and their variables. |
Numbers
| Value | In the dropdown | What it does |
|---|---|---|
| lookupPhoneNumber | Look up a number | Checks any number: gives it back as +E.164 and says if it is valid. The basic lookup, which is free. |
Filling in the fields
- From is picked from your account: your numbers and Messaging Services for an SMS, your WhatsApp senders (or the Sandbox one) for WhatsApp. To type a number, a
MG…SID or a template instead, use the field under the picker. - To is a phone number with the country code —
+15555550101— or a template such as{{payload.from}}. One number per message. With the Sandbox, or if a WhatsApp to a Mexican mobile written as+52isn't delivered (error 63015), try it as+521and the 10 digits. - Message takes up to 1,600 characters. Under it you see how many SMS parts you will pay for: 160 characters a part (153 each when it is split), or 70 (67) if it has any accent or emoji outside the basic alphabet, because then the whole text is sent as Unicode.
- Media is optional: up to 10 images or files, as
httpsaddresses. Not every country accepts them. - Send as (WhatsApp): Reply works within 24 hours of the person's last message; after that, use Template — an approved template with one value per
{{1}},{{2}}… A Messaging Service is optional: pick one to send from it instead of from a single sender. - Since is a day —
2026-11-01. Empty = all. Limit is 50 unless you set it, up to 1,000, newest first. - Look up a number accepts a number written any way (
55 1234 5678) with its country, and gives it back as+525512345678.
A sent message comes back with its sid, status, numSegments, price when Twilio has it, errorCode and errorMessage, and the channel (sms, mms or whatsapp). Lists come back as { messages: [...], count } (or phoneNumbers, services, templates) and the next node runs once per item.
When Twilio says no
- This person texted STOP. Twilio won't send until they text START. (21610)
- Twilio blocked it: your US number isn't registered for A2P 10DLC. (30034)
- More than 24 h since their last WhatsApp. Use an approved template. (63016)
- This key can't send messages. Add “twilio/messaging/messages/create” to the key in Twilio. (20403 — the line names the permission that is missing)
- Twilio didn't accept that key SID and secret together. Copy both from the screen Twilio shows right after Create (the secret shows only once), or create a new key. (401 or 20003 — reconnect the credential from its page)
- Twilio trial accounts can't send your own text. Upgrade in Twilio.
Twilio asks for people's consent before you text them, and to text the US from a local number you register it for A2P 10DLC. That is between you and Twilio; the node shows a reminder under “Before you text people”.
AI toolkit mode
Once the credential is picked, the node asks for a Mode. AI toolkit turns it into 8 tools that an AI Node — or an MCP client, through one of your MCP servers — calls by name: an assistant that answers the texts people send to your number, or looks up a customer's last messages.
| Tool | Arguments |
|---|---|
| send_twilio_sms | to · body |
| send_twilio_whatsapp | to · body, or a template with its variables |
| list_twilio_messages | to? · from? · since? · limit? |
| get_twilio_message | message_sid |
| list_twilio_phone_numbers | limit? |
| list_twilio_messaging_services | limit? |
| list_twilio_templates | limit? |
| lookup_twilio_phone_number | phone_number · country_code? |
What you control
- Send from is fixed. You pick the number or Messaging Service (and the WhatsApp sender) in the node; the AI chooses who and what, never where it sends from. It can't attach files either: files are for the node, where you set them.
- Messages per run: the most SMS segments the AI may send in one run — 3 unless you change it, from 1 to 20. A short text is 1 segment, a long one is several, and a WhatsApp message counts as 1. When it reaches the limit the tool refuses without calling Twilio; a text that is longer than the limit on its own is refused too, and the AI is told to shorten it. This limit is for an AI Node: through an MCP server every call is its own run, so only the daily limit applies there.
- Daily limit: the most SMS segments this node sends per day, in every mode — 200 unless you change it, from 1 to 10,000 (a short text is 1, a WhatsApp message counts as 1). It counts the day in UTC and it is shared by every run of the node. This is what stops a loop or a hijacked prompt from emptying your Twilio balance.
- If the counter is down, nothing is sent. The two limits live in a fast store; if it can't answer, or the run can't be identified, the tool refuses instead of sending without a limit. A message that Twilio rejects for good (a wrong number) gives its place back; one that may have gone out (a timeout) does not.
- Blocked tools. None starts blocked: an SMS auto-responder needs to send. The two that send go through the destructive gate, because a sent message can't be undone. Block the ones the agent should not have under Block these tool calls.
- Who the AI can text. A list of phone numbers (with the country code, one per line), anyone, or only the person who wrote — the number that texted the Twilio trigger that started the run. New nodes start on that last one. A number that can't be read with certainty is refused.
- On SMS, the sender can be faked. Anyone can send a text that looks like it comes from another number; on WhatsApp, WhatsApp checks it. With only the person who wrote the worst case is one reply per text that arrives, and the two limits above cap it. For a stricter setup, pick a list.
- Characters per call sent to the model. 20,000 by default, anything from 1,000 to 200,000.
What goes back to the model
- The same response as the operation. Lists return 50 unless the model asks for more, up to 1,000.
- Phone numbers and template SIDs come from the account: the model is told to look them up with
list_twilio_phone_numbersandlist_twilio_templates. - Items that don't fit the characters limit are left out whole, with a
notesfield saying how many. - The texts people send you are written by whoever sends them. HostWebhook tells the model to treat them as data, not as instructions, but a model can still be fooled: that is what the two limits and “Who the AI can text” are for.
Testing a tool
operation in their payload that names another tool is refused.{ "operation": "send_twilio_sms", "to": "+15555550101", "body": "Your order shipped" }The trigger
Pick Twilio as the service on a Trigger node, a Twilio credential whose key has the Event Streams permissions, and a Number of the account. HostWebhook uses Twilio's Event Streams: the first trigger of an account sets up one sink (an address Twilio delivers to) and one subscription for the whole account, shared by all its triggers. It never touches the webhook of your numbers — whatever you already have there, an auto-responder or your CRM, keeps working. Deactivating or deleting the last trigger of the account removes the sink and the subscription.
What fires it
- Number is required: one number per trigger. It has to be a number of the account (or its WhatsApp sender, or the Sandbox).
- Channel is optional: SMS (and MMS) or WhatsApp. Empty = both.
- Event Trigger: Message received (the default), Message not delivered, Message delivered and Message read (WhatsApp). The last three are about messages your number sent.
- Ignore messages sent by this flow (on by default): the status of a message this same flow sent doesn't fire it again. A message that arrives from a number another trigger of the same account watches never fires it either, so two watched numbers can't loop.
- A person who texts STOP does fire the trigger, with
optOutset, so your flow can note it. Twilio blocks the next messages to that person (and, depending on your account, may answer the STOP itself). - Download media (off by default) saves the photos and files people send, for 24 hours. See below.
- Changing the number or the events needs Apply changes.
Event Streams delivers “at least once”, so HostWebhook recognises a repeat and doesn't run the flow again; statuses that arrive out of order are dropped when a newer one was already handled. Twilio doesn't sign these deliveries in a way HostWebhook can check, so each account gets a private address with a secret in it, and refuses anything that doesn't carry it. A delivery already holds the text, so receiving one makes no call to Twilio.
Download media
A message with photos or files arrives with numMedia and nothing more: Twilio's notice doesn't carry the files. Turn on Download media (only for Message received) and HostWebhook asks Twilio for the message's files with your key and saves each one in your organization's files. The notice then carries them in media, and {{payload.media[0]._file}} works in the nodes below — for example in the File field of the Google Chat node, or as a Gmail attachment. With the option on, every Message received carries media and mediaErrors as lists — empty when the message has no files or nothing failed — so you never have to ask whether they exist. Without the option nothing is downloaded or saved, and the notice has neither.
- They are deleted after 24 hours, like email attachments: use them in the same run, or move them somewhere you keep.
- Limits: 5 files per message, up to 16 MB each (the virus scanner can't check bigger ones; Twilio itself sends at most 5 MB in an MMS and 16 MB in WhatsApp), and 100 files a day per organization, counting every attempt (and no more than 100 messages with files a day). Your plan's storage and file size limits count too: a file that doesn't fit isn't saved.
- Whatever passes a limit isn't saved, and
mediaErrorssays which and why —[{ "filename": "SM…-6.png", "reason": "More than 5 files in one message: this one wasn't saved." }]. The flow runs anyway. When every file was saved,mediaErrorsis an empty list ([]). - The files are scanned like any other upload, and they're whatever the sender sent: HostWebhook doesn't open or interpret them.
- Your key needs
twilio/messaging/messages.media/listand…/read(already in the list above). Without themmediaErrorssays which one to add.
What the trigger sends downstream
{
"event": "messageReceived",
"eventId": "NO00000000000000000000000001",
"messageSid": "SM0000000000000000000000000000001",
"accountSid": "AC0000000000000000000000000000001",
"from": "+15555550101",
"to": "+15555550199",
"channel": "sms",
"body": "Hi! Is my order on its way?",
"numMedia": 0,
"messagingServiceSid": "MG0000000000000000000000000000001",
"fromCountry": "US",
"optOut": "",
"receivedAt": "2026-11-01T00:00:01.000Z"
}With Download media on, a message that arrives also carries media — a list of { "_file": {…}, "contentType": "image/jpeg", "name": "SM…-1.jpg" }, named by HostWebhook — and mediaErrors — a list of the files that weren't saved. Both are always there: with no files, or with nothing failing, they are [].
A status carries status (delivered, failed, undelivered or read) and, when it failed, errorCode and errorMessage; here from is your number.
Trying it out
The trigger's Test push reads the latest messages that arrived at the number (one call) and shows them as a Message received notice will arrive, so you can write {{payload.body}} in the nodes below it from the start. It doesn't download files (that would use your storage every time you press it), so those messages show numMedia but not media or mediaErrors; the sample data (with the option on) shows both. To see a real one, text your number.
Health check
Once a day HostWebhook looks at the sink and the subscription (two calls per account, however many triggers use it). If something is gone it puts it back. If Twilio no longer accepts the key, or the key lost the Event Streams permission, the triggers of that account pause, your organization gets a warning, and the card says why: give the credential a new key in Edit keys and settings, or add the permissions to the key in Twilio, and activate it again.
Gotchas
- One number per trigger. To watch several numbers, make a trigger for each; they share the account's sink.
- A trigger needs the Event Streams permissions on the key. Without them the trigger says which one to add.
- A Twilio trial account has limits of its own, such as texting only the numbers you have verified.
- Your own webhook stays. The trigger is in addition to whatever your number already does when a text arrives.
- The key stops working. If you delete it in Twilio, the node says “Twilio didn't accept that key SID and secret together.” Give it a new key in Edit keys and settings, on the page of the credential.