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.

⚠Sending costs money, and a sent message can't be taken back. Every SMS segment and every WhatsApp message is charged by Twilio to your account. HostWebhook adds nothing, but it does stop two things: a node never sends more than its daily limit, and an AI never sends more than its messages per run. Run Test sends for real.

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.

ℹNever paste your Auth Token. It can do everything on the account, including creating keys and sub-accounts, and it can't be limited. HostWebhook refuses it: a value that starts with 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?
PermissionWhat it is for
twilio/messaging/messages/createSend SMS, MMS and WhatsApp
twilio/messaging/messages/list · readList and read messages, and the Test push
twilio/messaging/messages.media/list · readA message's files
twilio/phone-numbers/active-numbers/list · readCheck the key when connecting, the From and Number pickers, the own-number guard
twilio/messaging/services/listThe Messaging Service picker
twilio/messaging/whatsapp-senders/listThe WhatsApp sender picker
twilio/messaging/content-templates/list · readThe template picker and its variables
/twilio/event-streams/sink/create · read · list · deleteThe trigger's sink
/twilio/event-streams/sink.test/createTest the sink when it is created
/twilio/event-streams/subscription/create · read · list · update · deleteThe trigger's subscription and its types
/twilio/event-streams/subscription.subscribed-event/listThe Health check
/twilio/lookup/phone-numbers/readLook 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.

ℹYour personal data. HostWebhook keeps the last four characters of your Account SID and how many numbers you have, to tell your credentials apart. The key secret is encrypted, sent to Twilio only as its HTTP login — never in an address — and it comes back to the panel only inEdit keys and settings, after you verify it's you, and only for a person who can see it. Deleting the credential first closes the sink and subscription of that account, then deletes the key from HostWebhook. A restricted key can't delete itself, so it stays valid in your Twilio account until you delete it under Twilio → API keys.

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

WhatCalls to TwilioMoney in Twilio
Connecting a credential4 read-only checksNothing
Activating the first trigger of an account4 — your number, then the sink, its test and the subscriptionNothing: Event Streams is free
Activating another trigger of the same account1 to check the number, plus 1 if it needs a new event typeNothing
Deactivating a trigger that isn't the last one0, or 1 per event type nobody needs any moreNothing
Deactivating or deleting the last trigger of an account2 — the subscription, then the sinkNothing
A message arriving at a trigger0 — the notice carries the text. With “Download media” and files: 1 to list them, plus 1 for each fileNothing from HostWebhook. Twilio charges you the incoming SMS whether or not it reaches us
Test push1Nothing
Health check (once a day)2 per account — and 3 more when it has to rebuild the sinkNothing
Send an SMS1Twilio's price per segment, plus the carrier's fee
Send a WhatsApp message1Twilio's price per message, plus Meta's fee for the template
List or read messages1 per pageNothing
Look up a number1Nothing (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 secondsNothing
Deleting a credential2 if it had a sinkNothing

Operations

Send

ValueIn the dropdownWhat it does
sendSmsSend SMSA text message, or an MMS if it has files. Each message costs money in your Twilio account.
sendWhatsappSend WhatsAppA WhatsApp message: free text within 24 hours of the person's last message, or an approved template.

Messages

ValueIn the dropdownWhat it does
listMessagesList messagesThe messages of the account, newest first, each with its status, price and error. Narrow them by number or date.
getMessageGet messageOne message by its SID, with the list of its files.

Structure

ValueIn the dropdownWhat it does
listPhoneNumbersList phone numbersThe numbers of the account, with what each one can do (SMS, MMS, voice).
listMessagingServicesList Messaging ServicesThe Messaging Services of the account.
listTemplatesList templatesThe message templates, with their WhatsApp approval status and their variables.

Numbers

ValueIn the dropdownWhat it does
lookupPhoneNumberLook up a numberChecks 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 +52 isn't delivered (error 63015), try it as +521 and 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 https addresses. 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.

⚠HostWebhook never sends to your own Twilio number — it would make a loop — and a send is never repeated by itself: only a “busy” answer is tried again, because Twilio says it did nothing. If Twilio doesn't answer after a send, the message says to check its message log before sending again.

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.

ToolArguments
send_twilio_smsto · body
send_twilio_whatsappto · body, or a template with its variables
list_twilio_messagesto? · from? · since? · limit?
get_twilio_messagemessage_sid
list_twilio_phone_numberslimit?
list_twilio_messaging_serviceslimit?
list_twilio_templateslimit?
lookup_twilio_phone_numberphone_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_numbers and list_twilio_templates.
  • Items that don't fit the characters limit are left out whole, with a notes field 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

⚠Only a tool call picks the tool. In AI toolkit mode, only an AI Node, an MCP client or a voice agent chooses which tool the node runs. Run Test, a flow or a webhook run the operation saved on the node: an operation in their payload that names another tool is refused.
✦To try a tool, call it from an AI Node or from an MCP client. Its arguments look like this:
jsonA tool call
{ "operation": "send_twilio_sms", "to": "+15555550101", "body": "Your order shipped" }
⚠A node in toolkit mode is not part of the pipeline. Events arriving through connections made before you switched are refused — the node only runs the tool it is asked for.

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 optOut set, 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 mediaErrors says 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, mediaErrors is 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/list and …/read (already in the list above). Without them mediaErrors says 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.
Powered by Twilio