Twilio Integration: SMS, WhatsApp, and Voice for Agents
Agents can send and read SMS and WhatsApp messages, place and review calls, look up phone numbers, and send verification codes. Connect with a Twilio API key.
OneCLI connects AI agents to Twilio with an API key. Agents can send and read SMS, MMS, and WhatsApp messages, place calls and read call logs, look up phone numbers, and send one-time verification codes. The gateway signs every request with the key, so your agent never sees it.This suits support and operations agents: texting a customer an update, checking whether a message was delivered, or verifying a phone number before an account change.Connecting takes about two minutes.
In the Twilio Console, select API keys & tokens on the home page (or open Account > API keys & tokens), then select Create API key.
The Twilio Console home page. API keys & tokens is under your Account SID and Auth Token.
Setting
Value
Friendly name
Something you’ll recognize, such as OneCLI
Region
The region your account’s data lives in. Most accounts use United States (US1)
Key type
Standard. Pick Restricted to limit the key to specific products
Select Create, then copy the key’s SID (it starts with SK) and its Secret. Twilio shows the secret only once.
Prefer an API key over your Auth Token. You can revoke a key on its own, without touching anything else that uses your account. Avoid Main keys: they can manage subaccounts and other keys, which agents don’t need.
2
Paste it in OneCLI
In the OneCLI dashboard, open Connections > Twilio and fill in the form.
The Twilio connect window in OneCLI.
Field
Value
Region
The region you created the key in: US1 (the default), IE1 (Ireland), or AU1 (Australia)
API key SID
The key’s SID, starting with SK
API key secret
The key’s secret
Select Connect Twilio. OneCLI checks the key with Twilio in that region before saving it, so a wrong secret, or a key from another region, is rejected right away.You don’t need to enter your Account SID. OneCLI looks it up from the key and uses it as the connection’s name, so agents know which account they are working in.
Using your Account SID and Auth Token instead
If you can’t create an API key, paste your Account SID (it starts with AC) into API key SID, and your Auth Token into API key secret. Both are on the Twilio Console home page.
The Auth Token has full access to your account. If it leaks, you have to rotate it, which breaks everything else that uses it. An API key is safer.
Twilio keeps credentials per region: a US1 key doesn’t work in IE1 or AU1. Agents can always call the US hosts in Twilio’s docs, such as https://api.twilio.com. For an IE1 or AU1 connection, the gateway sends each request to that region’s host for you.
Send SMS, MMS, and WhatsApp messages, list and read messages and their media, and cancel or delete messages
Calls
Place outbound calls, list and read calls and recordings, and end or redirect a live call
Phone numbers
List the account’s numbers, search numbers available to buy, and buy, configure, or release numbers
Lookup
Validate and format a phone number, and read its carrier and line type
Verify
Send a one-time code by SMS, WhatsApp, voice, or email, and check it
Messaging services
Read and manage messaging services and their senders
Conversations
Read conversations, add participants, and send conversation messages
Account
Read the account balance and usage records
Some products, including Studio, Conversations, and Functions, aren’t available on Twilio trial accounts. On a trial account, Twilio only sends messages and calls to phone numbers you’ve verified.
No Authorization header is needed. The gateway adds Twilio’s Basic auth:
# Send an SMS (replace AC... with the Account SID shown on the connection)curl -s -X POST "https://api.twilio.com/2010-04-01/Accounts/ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/Messages.json" \ --data-urlencode "To=+14155550100" \ --data-urlencode "From=+14155550199" \ --data-urlencode "Body=Your order has shipped."# Look up a phone number's carrier and line typecurl -s "https://lookups.twilio.com/v2/PhoneNumbers/+14155552671?Fields=line_type_intelligence"
Grant the connection to each agent that needs it, and choose per tool what runs freely, what needs approval, and what’s blocked.Twilio writes reach real people and cost money. Send a message, Place a call, and Send a verification code each contact someone, and Buy, configure, or release phone numbers changes what you’re billed for. A good default is to let agents read messages, calls, and lookups freely, and put every one of those writes behind approval.Organization rules add guardrails on top. A blocked request never reaches Twilio.To disconnect, remove the connection in Connections > Twilio, then delete the key in the Twilio Console under Account > API keys & tokens.