Connect Twilio SMS and Voice

Connect a Twilio phone number to Wassla so your AI agent can answer inbound SMS messages and live phone calls. The flow is the same for both channels: buy a Twilio number with the right capability, point its inbound webhook at Wassla, paste the number into the Channels page, and assign an agent. Most teams finish both setups in under fifteen minutes once their Twilio account is funded.

Before you start

A few things need to be ready before either webhook will deliver to Wassla.

  1. A funded Twilio account with a verified caller ID or A2P 10DLC registration (US numbers) — Twilio rejects unregistered SMS senders in many regions.
  2. The Twilio Account SID and Auth Token from your Twilio console. Wassla stores the platform-wide Twilio credentials as Edge Function secrets, so you do not paste them per workspace — but you do need them in your own Twilio console to configure the webhook.
  3. A Wassla workspace where you have the owner or admin role. The Channels page hides the connect form for support and viewer roles.
  4. A Wassla plan that includes SMS or Voice. Trials cannot consume SMS because every outbound segment is real money to Twilio; if your plan does not include the channel, the tile shows a "Starter required" chip and an Upgrade button instead of the phone-number form.

Step 1 — Buy a Twilio phone number

In the Twilio console, open Phone Numbers then Buy a number. Filter by country and tick the SMS and Voice capability boxes you need — a single number can carry both. Saudi (+966), UAE (+971), US, UK, and most EU country codes work; if your country code is not on the list, Twilio will still let you buy the number but the channel will refuse the inbound webhook until support enables your region.

Click Buy and complete checkout. The number appears in your Active Numbers list within a few seconds.

Step 2 — Open the Channels page in Wassla

Sign into Wassla, switch to the workspace you want to connect, and click Channels in the left sidebar. Scroll to the Twilio section — you will see two tiles, "Twilio SMS" and "Twilio Voice", each with a disconnected chip, a phone-number field, and a webhook URL block at the bottom.

Copy the webhook URL shown on the SMS tile. It looks like:

https://zthlossdwwvjieeyktfd.supabase.co/functions/v1/twilio-sms

Copy the voice webhook URL from the Voice tile separately — it ends in /twilio-voice, not /twilio-sms. Pasting the SMS URL on the voice channel is one of the most common setup mistakes and produces a silent call with no agent response.

Step 3 — Configure the SMS webhook in Twilio

Back in the Twilio console, click into the phone number you bought. Scroll to the Messaging Configuration section.

  1. Set "A message comes in" to Webhook.
  2. Paste the Wassla SMS webhook URL you copied in step 2.
  3. Set the HTTP method to HTTP POST.
  4. Leave the "Primary handler fails" fallback blank unless you have a specific backup endpoint.
  5. Click Save configuration at the bottom of the page.

Twilio will now POST every inbound SMS to Wassla as a standard application/x-www-form-urlencoded request. Wassla verifies Twilio's x-twilio-signature header on every inbound call using your account's auth token, so forged or unsigned requests are rejected.

Step 4 — Configure the voice webhook in Twilio

Still on the same Twilio phone number page, scroll to the Voice Configuration section.

  1. Set "A call comes in" to Webhook.
  2. Paste the Wassla voice webhook URL (the one ending in /twilio-voice).
  3. Set the HTTP method to HTTP POST.
  4. Save the configuration.

Wassla answers inbound calls with a two-step TwiML state machine: a friendly greeting plus a <Gather> for the caller's first utterance, then a streamed agent reply spoken back over Twilio TTS, followed by another <Gather> for the next turn. The conversation closes automatically when Twilio sends a terminal call-status callback.

Step 5 — Paste the number into Wassla

Return to the Channels page in Wassla. On the Twilio SMS tile, type the number you bought into the phone-number field in strict international format — the leading plus sign and country code are required:

+15551234567

Wassla normalizes the number to E.164 on save (it strips spaces, parens, and dashes), but a missing plus sign or country code is rejected with a friendly error. Click Connect. The tile flips to a green Connected chip within a second.

Repeat the same paste-and-connect on the Voice tile with the same number if you want one number to serve both channels, or a different number if you bought two.

Step 6 — Assign an AI agent

Wassla routes the channel to the AI agent bound on the agent_channels row when one is set, and falls back to the oldest active agent in the workspace otherwise. To pick a specific agent, open the agent's editor from the Agents page and make sure it is set Active. For voice in particular, switch the Modality to Voice or Text & Voice in the agent editor so the agent picks up calls — text-only agents will not handle voice rooms.

Step 7 — Test with a real SMS

From a different mobile phone, send any text to your Twilio number — for example, "Hi, what are your hours?" Within five seconds you should:

  • See the inbound message appear in your Wassla Inbox under the new conversation.
  • Receive an AI reply on your phone, generated by your agent and delivered through Twilio.

If nothing arrives, open Twilio's Monitor then Logs then Errors page. Twilio surfaces every webhook failure (4xx/5xx, signature mismatch, timeout) with the exact response body Wassla returned — that is the fastest diagnostic. See Troubleshoot channel connectivity for the full webhook checklist.

Step 8 — Test a real call

Call the same Twilio number from a different phone. The Wassla voice agent answers within one ring, greets the caller, and waits for the first utterance. Speak your question naturally — the agent transcribes the audio, generates a reply through the same text-chat pipeline that powers your inbox, and speaks the answer back over Twilio TTS. The full transcript shows up live in the Inbox alongside the SMS thread, and the recording is stored in the private call-recordings bucket once the call ends.

For more capable voice agents — natural turn-taking, sub-second interruption, multilingual support, and 30+ voices — Wassla also runs a LiveKit-powered Python voice worker (deployed on Fly.io fra1) that the agent picks up automatically when you enable Voice modality. See Voice agents vs text agents for the deeper voice-agent walkthrough including greeting line, max call length, and human handoff.

What gets billed

Inbound SMS and inbound voice are free on Wassla; you pay Twilio directly for the number rental and carrier delivery. Outbound SMS replies are billed as outbound_messages against your Wassla credit balance, and voice minutes are billed as voice_minutes once a call connects. Every charge appears on the Settings then Billing tab in real time, and Wassla's billing-mode switch keeps pre-live workspaces in infra_only mode so AI spend is fully blocked until you flip to live.

Disconnect or replace a number

To swap the number, edit the phone-number field on the tile and click Save — Wassla updates the routing on the next inbound webhook. To unbind the channel entirely, click the trash icon and confirm; Wassla deactivates the row, future Twilio webhooks for that number return an empty TwiML response, and no further AI spend is incurred.