Twilio Integration
Twilio is the primary telephony provider for Crew, enabling voice calls, SMS messaging, and phone number provisioning. This guide covers setup, configuration, and best practices.Overview
Crew uses Twilio for:- Voice calls — Inbound and outbound calling
- SMS — Two-way text messaging
- Phone numbers — Provisioning and management
- Call recording — Optional call storage
- Transcription — Speech-to-text
Prerequisites
Before connecting Twilio:- Create a Twilio account
- Verify your account (required for outbound calls)
- Purchase at least one phone number
- Note your Account SID and Auth Token
Setup
Step 1: Get Twilio Credentials
1
Log into Twilio Console
Go to console.twilio.com
2
Find Account SID
Your Account SID is displayed on the dashboard
3
Get Auth Token
Click to reveal your Auth Token
4
Copy Credentials
Copy both values for the next step
Step 2: Connect to Crew
1
Open Crew Dashboard
Navigate to Settings → Integrations
2
Select Twilio
Click Connect next to Twilio
3
Enter Credentials
Paste your Account SID and Auth Token
4
Verify Connection
Crew will verify the credentials are valid
Step 3: Configure Webhooks
Crew automatically configures webhooks for your Twilio numbers. You can also configure manually: Voice Webhook URL:Phone Number Management
Viewing Numbers
See all Twilio numbers connected to Crew:Assigning Numbers to Agents
Purchasing New Numbers
Purchase numbers directly through Crew:Voice Configuration
Inbound Calls
Configure how inbound calls are handled:Outbound Calls
Configure outbound calling behavior:Call Recording
Recording regulations vary by jurisdiction. Ensure compliance with local laws.
SMS Configuration
Inbound SMS
Configure SMS handling:Outbound SMS
Send SMS via API:Twilio Subaccounts
For multi-tenant deployments, use Twilio subaccounts:Error Handling
Common Errors
| Error | Cause | Solution |
|---|---|---|
21211 | Invalid phone number | Verify number format |
21614 | To number not verified | Verify trial account numbers |
21610 | Blocked number | Check Twilio blocklist |
21606 | Geographic restriction | Check account permissions |
Webhook Failures
If Crew doesn’t receive calls:- Verify webhook URLs are correctly configured
- Check Twilio webhook debugger for errors
- Ensure Crew API is accessible from Twilio
- Check for SSL/TLS issues
Security
Credential Storage
Crew stores Twilio credentials encrypted at rest using AES-256 encryption.Request Validation
Crew validates all incoming Twilio requests using Twilio’s signature validation:IP Allowlisting
For additional security, allowlist Twilio’s IP ranges in your firewall.Pricing
Twilio usage is billed directly by Twilio. Crew does not add markups.| Resource | Twilio Pricing |
|---|---|
| Local numbers | ~$1/month |
| Voice (inbound) | ~$0.0085/min |
| Voice (outbound) | ~$0.014/min |
| SMS (inbound) | ~$0.0075/message |
| SMS (outbound) | ~$0.0079/message |
Best Practices
Use subaccounts for isolation
Use subaccounts for isolation
If serving multiple clients, use Twilio subaccounts for billing and access separation.
Enable machine detection
Enable machine detection
For outbound calls, enable answering machine detection to avoid wasted agent time.
Monitor usage
Monitor usage
Set up Twilio usage alerts to avoid unexpected charges.
Test with trial account
Test with trial account
Use Twilio’s trial mode for development and testing.
Troubleshooting
Calls not connecting
- Verify phone number is assigned to an agent
- Check webhook configuration in Twilio
- Review Crew logs for errors
- Test with a simple TwiML response
SMS not received
- Verify SMS capability on phone number
- Check message status in Twilio logs
- Verify carrier hasn’t blocked messages
- Check for spam filtering
Next Steps
- RingCentral Integration — Alternative telephony provider
- Inbound Calls — Configure call handling
- Webhooks — Receive real-time events