Operator
← Back to blog
GuidesMessaging

Let OpenClaw text you with Twilio

Operator TeamOperator Team···6 min read

Telegram and Discord are where you talk to OpenClaw, but sometimes you want a plain text message on your phone, the kind that gets through when you are away from your laptop. Connect Twilio and your Operator.io agent can send SMS from a real number you own. Twilio is a cloud communications platform: you buy a phone number, store your credentials, and call its REST API to send and receive texts. OpenClaw handles the API calls through its built in Twilio skill. Here is how to set it up.

Twilio logo

What you get

With the Twilio skill, OpenClaw can send text messages from your Twilio number and read the ones that number receives. Sending covers the moments a text beats a chat app: a heads up that a long job finished, an alert when something you watch changes, or a reminder at a set time. Reading inbound replies turns a one way alert into something closer to a conversation, so the agent can text you a question, wait for your answer, and act on it. That second capability is what lets you set up something like "text me when the deploy is done, and if I reply HOLD, do not start the next one."

It also changes what an inbound text is. Once the agent acts on replies, a message to your Twilio number is an instruction the agent reads and acts on.

A phone number is not a secret and anyone who has yours can send to it, so tell the agent which number is you and have it treat texts from anywhere else as something to show you rather than obey. Keep the moves that spend money or change something on a confirmation through your main Telegram or Discord channel, and let SMS stay the fast nudge layer it is good at. The HOLD pattern holds up because the agent already knows the deploy it asked about and the number it is waiting to hear from, so a reply from a stranger does not slot into that gap.

Twilio routes SMS through carrier networks using the E.164 numbering standard defined by the ITU, which is why every number in your setup and every recipient address needs a country code and no spaces. The agent formats numbers that way automatically when you give it a full international number, but if you paste a local number without the country code, Twilio will reject the send.

Before you start

You need a Twilio account and a phone number with SMS enabled. Twilio's trial account includes product specific free units rather than a shared dollar balance: 100 SMS messages, among other allowances, with a 30 day trial period. A trial account has two limits: it can only message phone numbers you have verified in the Console, and it cannot complete the US registration described below until you upgrade to a paid account. Phone numbers cost roughly $1.15 a month for a US local number on top of per message fees.

Step 1: Find your Account SID and Auth Token

Log in to the Twilio Console. Your Account SID, which starts with AC, and your Auth Token sit on the main dashboard under Account Info. The Auth Token is hidden by default, so click the eye icon to reveal it, then copy both. Treat the Auth Token like a password, since anyone who has it can send messages on your account. These two values authenticate every API call the agent makes through the Messages API.

Step 2: Get a phone number

In the Console, go to Products & Services, then Numbers and Senders, and choose Set up a new phone number. Pick a number with SMS capability and buy it. Twilio's numbers documentation walks through the flow. US outbound SMS to US recipients currently starts at about $0.0083 per message segment on a long code number, plus carrier fees that vary by destination, according to Twilio's US SMS pricing page.

If you plan to text US recipients, there is one more requirement. Any standard 10 digit US number sending to US phones has to be registered through A2P 10DLC (Application to Person 10 digit long code), which applies to individuals and hobbyists too. Carriers treat all SMS traffic from Twilio as application sent, so the registration requirement applies even when you are texting yourself.

You handle it under Regulatory Compliance in the Console by registering a brand and a campaign and linking them to your number. Twilio's A2P 10DLC quickstart walks through brand registration, campaign registration, and linking your number to a Messaging Service. Because a trial account cannot register, you upgrade to a paid account first. Campaign approval from The Campaign Registry typically takes several days.

Twilio's own developer channel breaks down what A2P 10DLC is and how brand and campaign registration fit together, the step that decides whether your texts reach US numbers at all.

A toll free number is the other path for US delivery. Toll free numbers go through a separate verification process rather than A2P 10DLC. Twilio's trial account documentation notes that sending to US recipients on trial requires a toll free number with verification completed. A2P 10DLC registration is not required for messaging outside the United States, so if your recipients are in other countries, check Twilio's geographic permissions before you buy a number.

Step 3: Add three variables to Operator

The Twilio skill needs all three of these, so add each one in your Operator dashboard under Environment:

VariableWhere it comes from
TWILIO_ACCOUNT_SIDAccount Info on the Console dashboard
TWILIO_AUTH_TOKENAccount Info, behind the eye icon
TWILIO_PHONE_NUMBERThe number you bought, in E.164 form like +14155551234

Each value is encrypted and shown only once. OpenClaw reads them by name when it sends a message, and the Twilio skill is already installed, so there is nothing else to wire up.

Step 4: Connect a channel and try it

Make sure you have Telegram or Discord connected on the channels page so the agent has somewhere to talk to you. Then ask it to send a text:

Text me at +14155550123 when the overnight import finishes.
Every weekday at 7am, send me a one line text with my first meeting of the day.

The second turns into a scheduled job that runs whether or not you remember it. Because the agent can also read replies, you can layer a response onto an alert, telling it to text you when a metric crosses a line and to do one thing if you reply yes and another if you reply no.

Good to know

E.164 format matters: numbers need the plus sign and country code, like +14155551234, or Twilio rejects them. The standard allows up to 15 digits after the plus sign, and no E.164 country code starts with zero. On a trial account you can only message numbers you have verified in the Console, so verify your own phone first.

SMS is billed per segment, not per message, and how many characters fit in a segment depends on the encoding:

EncodingSingle segmentEach segment once split
GSM (standard text)160 characters153 characters
UCS-2 (emoji or other non GSM characters)70 characters67 characters

Once the body runs past the single segment limit, Twilio splits it and adds a reassembly header, which is why the per segment count drops. Twilio's character limit guide has the full table. A long alert costs more than a short one, and Twilio recommends keeping automated SMS under 320 characters for deliverability.

If you expect to send to US recipients at any real volume, get the A2P 10DLC registration started early, since brand and campaign approval can take several days. Until registration completes, messages to US numbers from an unregistered 10DLC may be filtered or blocked by carriers. International recipients have their own country specific rules, which Twilio documents in its messaging compliance section.

Frequently asked questions

What does my agent need to send SMS?

+

A Twilio account, a phone number with SMS enabled, and three values added to Operator's Environment: TWILIO_ACCOUNT_SID, TWILIO_AUTH_TOKEN, and TWILIO_PHONE_NUMBER. The SID and Auth Token sit under Account Info on the Console dashboard, and the phone number goes in E.164 form like +14155551234. The Twilio skill reads them by name when it sends a message.

Can the agent read SMS replies, not just send them?

+

Yes. The Twilio skill can send texts from your number and read the ones that number receives, which turns a one way alert into a conversation. That is what lets you set up something like "text me when the deploy is done, and if I reply HOLD, do not start the next one." The agent texts you, waits for the answer, and acts on it through Twilio's Messages API.

Why won't Twilio deliver my texts to US numbers?

+

Any standard 10 digit US number sending to US phones has to be registered through A2P 10DLC, which applies to individuals too. You register a brand and campaign under Regulatory Compliance and link them to your number, and a trial account cannot register until you upgrade. A toll free number is the other path, with its own verification step. Approval is not instant, so start early if US delivery matters.

Why does Twilio reject my phone numbers?

+

Almost always the format. Numbers need E.164 form, the plus sign and country code, like +14155551234, or Twilio rejects them. On a trial account you can also only message numbers you have verified in the Console, so verify your own phone first. One billing note: a single SMS holds about 160 characters before it splits into segments, and each segment is billed separately.