Chatspark
K
K

Twilio

Enable your AI agent to send SMS, MMS, and WhatsApp messages, validate phone numbers, send booking confirmations, and alert your team — all through natural conversation.

7 min read

Updated April 2026

Overview

The Twilio integration gives your AI agent the ability to send text messages on your behalf. Customers can ask to receive a confirmation, a link, an address, or any other information by text, and your agent handles it all through natural conversation.

You can also use Twilio to send your team an SMS alert when a new lead comes in, or automatically text a customer their booking confirmation right after they schedule an appointment through Square, Calendly, or Google Calendar.

Available Actions

ActionDescription
Send SMSSend a text message to a customer or contact
Send MMSSend a media message with an image, coupon, or document
Send WhatsAppSend a WhatsApp message via Twilio's WhatsApp Business channel
Check Message StatusLook up whether a previously sent message was delivered
Lookup Phone NumberValidate a number and check if it can receive SMS (mobile vs. landline)
Notify Team SMSSend an internal SMS alert to a staff member when a lead or key event occurs
Send Booking SMSText a customer their booking confirmation after scheduling an appointment
Two Directions
Most actions send messages to your customers. Notify Team SMS sends to your own staff and is labeled “Internal Use” in the action library to make that distinction clear.

Prerequisites

Before setting up the Twilio integration, you'll need:

  • A Twilio account (free trial works for testing)
  • A Twilio phone number capable of sending SMS, or a Messaging Service SID
  • Your Account SID and Auth Token from the Twilio Console
  • For WhatsApp: a Twilio WhatsApp-approved sender (see the WhatsApp section below)

Setup Instructions

Step 1: Get Your Twilio Credentials

  1. Log in to the Twilio Console
  2. On the dashboard, locate your Account SID and Auth Token
  3. Click the eye icon next to the Auth Token to reveal it
  4. Copy both values
Keep Your Auth Token Private
Your Auth Token gives full access to your Twilio account. Never share it publicly or commit it to source code.

Step 2: Get Your From Number or Messaging Service SID

Your agent needs a sender to send from. You can use either a Twilio phone number or a Messaging Service.

  • Phone number: Go to Phone Numbers in the Console, copy a number that has SMS capability, and use it as your From Phone Number.
  • Messaging Service: Go to MessagingServices, copy the Service SID (starts with MG), and use it as your Messaging Service SID. Required for scheduling booking reminders.

Step 3: Enable in ChatSpark

  1. In ChatSpark, go to AI Actions
  2. Find Twilio in the Library and click Enable
  3. Select the agent that should have access
  4. Enter your Account SID and Auth Token
  5. Enter your From Phone Number or Messaging Service SID
  6. Optionally, enter an Agent Notify Number for team alert actions
  7. Click Save
Pair With Booking Actions
The Send Booking SMS action works best alongside Square, Calendly, or Google Calendar. After a booking completes, your agent automatically texts the customer their confirmation. Enable both integrations on the same agent to activate this flow.

Configuration Fields

FieldDescriptionExample
Account SIDYour Twilio account identifierACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Auth TokenYour Twilio auth token (kept encrypted)xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
From Phone NumberThe Twilio number your agent sends from. Leave blank if using a Messaging Service.+15551234567
Messaging Service SIDUse instead of a From number if you have a Messaging Service. Required to schedule booking reminders.MGxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Agent Notify NumberYour team member's mobile number for internal alert actions+15559876543

WhatsApp Setup

The Send WhatsApp action uses the same Twilio credentials but requires a WhatsApp-approved sender in your Twilio account. Twilio must approve your WhatsApp Business number before you can send messages.

  1. In the Twilio Console, go to MessagingSendersWhatsApp senders
  2. Follow the steps to request a WhatsApp-enabled number
  3. Once approved, use that number as your From Phone Number in ChatSpark
WhatsApp Message Templates
WhatsApp requires pre-approved message templates for outbound messages to users who have not messaged you first. For session messages (within 24 hours of a customer message), free-form text works without a template.

Testing Your Integration

After setup, test the integration in your AI Agent widget:

  1. Open your AI Agent widget
  2. Share a phone number in the chat
  3. Try one of the phrases below
  4. Confirm the message arrives on the target phone

Sample trigger phrases by action:

  • Send SMS: “Can you text me the details?” or “Send that to my phone”
  • Send MMS: “Text me the menu” or “Send me a photo of that product”
  • Send WhatsApp: “Can you WhatsApp me?” or “Send that over WhatsApp”
  • Check Status: “I never got that text” or “Did my confirmation send?”
  • Lookup Number: “Is this a valid number?” or “Can this phone receive texts?”
  • Notify Team: Fires automatically when a lead is captured — no customer phrase needed
  • Booking SMS: Fires automatically after a booking completes — no customer phrase needed

Troubleshooting

Authentication failed

Double-check your Account SID and Auth Token. The Account SID starts withAC and can be found at the top of your Twilio Console dashboard. If the token was recently rotated, update it in the action settings.

Invalid phone number (error 21211)

The recipient's phone number is not valid. Ask the customer to confirm their number and try again. Use the Lookup Phone Number action first to validate numbers before sending.

Number cannot receive SMS (error 21614)

The number is a landline or VoIP number that cannot receive text messages. The Lookup Phone Number action returns the line type before sending so your agent can catch this automatically.

No sender configured

Either a From Phone Number or a Messaging Service SID must be set in the action configuration. Go to AI Actions, open the Twilio settings, and add one of the two.

WhatsApp message not delivered

Confirm your Twilio sender is approved for WhatsApp in the Console. The From number must be listed under WhatsApp senders with an “Approved” status before messages can be sent.

Booking reminder not scheduled

Scheduled reminders require a Messaging Service SID (not just a From number) and an appointment date that can be parsed automatically. Set your Messaging Service SID in the action configuration to enable this feature.

Twilio Support
For questions about your Twilio account, phone numbers, or billing, visit the Twilio Help Center.

Previous

Stripe

Next

Workday