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
-
Access your dashboard
- Sign in to your CalStudio Dashboard
- Click “Create App”
-
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
-
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
- In your CalStudio dashboard, locate your launched app
- Click “Publish” → “Continue with Twilio”
- 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
-
Access Twilio Console
- Sign up or log in at Twilio Console
- Complete phone verification with OTP
- Save your recovery code securely
-
Copy your credentials
- From your Twilio dashboard, locate:
- Account SID (starts with AC…)
- Auth Token (click to reveal)
- From your Twilio dashboard, locate:
-
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)
-
Get your webhook URL
- After publishing, CalStudio generates a unique webhook URL
- Copy this URL for the next step
-
Configure Twilio Sandbox
- In Twilio Console, navigate to:
- Messaging → Try it Out → Send a WhatsApp Message
- Click “Sandbox Settings”
- In Twilio Console, navigate to:
-
Set up the webhook
- Paste your CalStudio webhook URL in “When a message comes in”
- Set HTTP method to POST
- Save your changes
-
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
- Click “Upgrade Account” in Twilio Console
- Complete verification:
- Legal name and country
- Government ID verification
- Payment details
2
Purchase Phone Number
- Navigate to Phone Numbers → Manage → Buy a Number
- Select a number with SMS and voice capabilities
- Complete the purchase
3
Register with WhatsApp Business
- Go to Messaging → Senders → WhatsApp Senders
- Click “Get Started”
- Select your Twilio phone number
- Log in with Facebook to verify WhatsApp Business
- Provide business information:
- Business name and category
- WhatsApp display name
- Complete OTP verification
4
Configure Production Webhook
- In your WhatsApp Sender settings
- Paste your CalStudio webhook URL under “Incoming Messages”
- Save your configuration
Step 6: Test Your Production Bot
- Add to contacts
- Save your Twilio WhatsApp number to your phone contacts
- 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:- Use the same Twilio phone number
- In Twilio Console, configure SMS settings
- Set incoming messages webhook to your CalStudio URL
- 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?
Configure Webhooks
Set up automated workflows with Zapier or Make.com
Customize Your Bot
Fine-tune your AI’s personality and responses
Monitor Analytics
Track usage and conversations (Pro plans)
Get Support
Contact our team for assistance
Troubleshooting
Bot not responding in WhatsApp
Bot not responding in WhatsApp
- Verify webhook URL is correctly configured in Twilio
- Check that your CalStudio app is launched and active
- Ensure Twilio credentials are correct in CalStudio
Messages delayed or not delivering
Messages delayed or not delivering
- Check Twilio account balance and limits
- Verify phone number format (E.164)
- Review Twilio error logs for specific issues
WhatsApp Business verification failed
WhatsApp Business verification failed
- Ensure Facebook Business account is properly set up
- Verify business information matches across platforms
- Contact Twilio support for verification assistance