Transform your CalStudio AI apps into powerful WhatsApp and SMS assistants. This integration allows your custom AI to communicate directly with users through their preferred messaging platforms.

Overview

With CalStudio’s Twilio integration, you can:
  • Deploy AI apps to WhatsApp Business accounts
  • Enable SMS communication for your AI assistants
  • Test safely using Twilio’s sandbox environment
  • Scale to production with WhatsApp Business API
  • Handle customer support, sales inquiries, and automated responses

Prerequisites

Before you begin, ensure you have:

CalStudio Account

Free to start - Sign up here

Twilio Account

For messaging API access - Create account

Phone Number

A verified number for testing

Facebook Business

Optional - Required for production WhatsApp deployment

Setup Guide

Step 1: Create Your AI App in CalStudio

  1. Access your dashboard
  2. Configure your AI app
    • App Name: Choose a descriptive name
    • App Icon: Upload a logo (optional)
    • AI Model: Select from GPT-4, Claude, Gemini, or others
    • System Prompt: Define your bot’s personality and behavior
  3. Launch your app
    • Click “Create App” in the top-right corner
    • Once created, click “Launch” to make it live
No API keys required! CalStudio handles all AI model connections for you.

Step 2: Connect CalStudio with Twilio

  1. In your CalStudio dashboard, locate your launched app
  2. Click “Publish”“Continue with Twilio”
  3. You’ll need to provide:
    • Account SID: Your Twilio account identifier
    • Auth Token: Your Twilio authentication token
    • Twilio Phone Number: In E.164 format (e.g., +14155552671)
Keep this window open while you retrieve your Twilio credentials in the next step.

Step 3: Retrieve Twilio Credentials

  1. Access Twilio Console
    • Sign up or log in at Twilio Console
    • Complete phone verification with OTP
    • Save your recovery code securely
  2. Copy your credentials
    • From your Twilio dashboard, locate:
      • Account SID (starts with AC…)
      • Auth Token (click to reveal)
  3. Return to CalStudio
    • Paste your Account SID and Auth Token
    • Add your Twilio phone number in E.164 format
    • Click “Publish”
Keep your Auth Token secure. Never share it publicly or commit it to version control.

Step 4: Configure Webhook for Testing (Sandbox)

  1. Get your webhook URL
    • After publishing, CalStudio generates a unique webhook URL
    • Copy this URL for the next step
  2. Configure Twilio Sandbox
    • In Twilio Console, navigate to:
      • MessagingTry it OutSend a WhatsApp Message
      • Click “Sandbox Settings”
  3. Set up the webhook
    • Paste your CalStudio webhook URL in “When a message comes in”
    • Set HTTP method to POST
    • Save your changes
  4. Join the sandbox
    • Scan the QR code provided by Twilio
    • Or send the join code to the sandbox WhatsApp number
Your WhatsApp bot is now ready for testing! Send a message to see it in action.

Step 5: Deploy to Production

1

Upgrade Twilio Account

  1. Click “Upgrade Account” in Twilio Console
  2. Complete verification:
    • Legal name and country
    • Government ID verification
    • Payment details
2

Purchase Phone Number

  1. Navigate to Phone NumbersManageBuy a Number
  2. Select a number with SMS and voice capabilities
  3. Complete the purchase
3

Register with WhatsApp Business

  1. Go to MessagingSendersWhatsApp Senders
  2. Click “Get Started”
  3. Select your Twilio phone number
  4. Log in with Facebook to verify WhatsApp Business
  5. Provide business information:
    • Business name and category
    • WhatsApp display name
    • Complete OTP verification
4

Configure Production Webhook

  1. In your WhatsApp Sender settings
  2. Paste your CalStudio webhook URL under “Incoming Messages”
  3. Save your configuration

Step 6: Test Your Production Bot

  1. Add to contacts
    • Save your Twilio WhatsApp number to your phone contacts
  2. Start chatting
    • Send a message to your WhatsApp Business number
    • Your AI app will respond instantly!
Congratulations! Your custom AI app is now live on WhatsApp.

SMS Integration (Optional)

To enable SMS messaging for your AI app:
  1. Use the same Twilio phone number
  2. In Twilio Console, configure SMS settings
  3. Set incoming messages webhook to your CalStudio URL
  4. No additional verification required
SMS integration is simpler than WhatsApp as it doesn’t require Facebook Business verification.

Best Practices

Message Templates

Use WhatsApp-approved templates for business-initiated conversations

Response Time

Configure your AI to respond quickly to maintain user engagement

Compliance

Follow WhatsApp Business policies and Twilio’s acceptable use guidelines

Error Handling

Set up fallback responses for when your AI can’t understand a query

What’s Next?

Troubleshooting