Channels
Twilio Integration
Set up Twilio for SMS and voice notifications
Twilio Integration
Send SMS messages and voice calls through Twilio with NotiGrid.
Overview
Twilio provides reliable SMS and voice communication APIs that integrate seamlessly with NotiGrid.
Supported Features:
- SMS messages
- MMS (multimedia messages)
- Voice calls
- WhatsApp Business messages (if enabled on your Twilio account)
Prerequisites
- Twilio account (Sign up here)
- Phone number from Twilio
- NotiGrid account
Setup Instructions
1. Create Twilio Account
- Go to twilio.com/try-twilio
- Sign up for a free account
- Complete phone verification
- Answer the onboarding questions
2. Get Your Account Credentials
- Log in to Twilio Console
- From the dashboard, locate:
- Account SID - Your unique account identifier
- Auth Token - Click "Show" to reveal (keep this secret!)
- Copy both values - you'll need them for NotiGrid
3. Get a Phone Number
Option A: Trial Phone Number (Free)
Your trial account comes with a free number:
- Go to Phone Numbers → Manage → Active numbers
- You'll see your trial number listed
Trial Limitations:
- Can only send to verified phone numbers
- Messages include "Sent from your Twilio trial account" prefix
- Limited features
Option B: Purchase a Phone Number (Recommended)
- Go to Phone Numbers → Manage → Buy a number
- Select your country
- Choose number capabilities:
- ☑ SMS - For text messages
- ☑ MMS - For multimedia messages
- ☑ Voice - For voice calls
- Search and select a number
- Click Buy (~$1-2/month depending on country)
4. Verify Phone Numbers (Trial Only)
If using a trial account, verify recipient numbers:
- Go to Phone Numbers → Manage → Verified Caller IDs
- Click + Add a new number
- Enter the phone number
- Choose verification method (SMS or call)
- Enter the verification code
5. Configure in NotiGrid
- Log in to NotiGrid dashboard
- Navigate to Channels → SMS → Twilio
- Click Add Twilio Account
- Enter your credentials:
- Account Name: "Production Twilio" (or any name)
- Account SID: From step 2
- Auth Token: From step 2
- From Phone Number: Your Twilio number (e.g., +1234567890)
- Click Save & Test Connection
Sending Notifications
SMS Messages
Via NotiGrid Dashboard
- Go to Notifications → Send
- Select SMS channel
- Choose Twilio as provider
- Enter recipient number (E.164 format: +1234567890)
- Type your message
- Click Send
Via API
curl -X POST https://api.notigrid.com/v1/notifications \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"channel": "sms",
"to": "+1234567890",
"body": "Your verification code is: 123456"
}'MMS Messages (With Media)
curl -X POST https://api.notigrid.com/v1/notifications \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"channel": "sms",
"to": "+1234567890",
"body": "Check out our new product!",
"metadata": {
"mediaUrl": "https://example.com/image.jpg"
}
}'Voice Calls
curl -X POST https://api.notigrid.com/v1/notifications \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"channel": "voice",
"to": "+1234567890",
"body": "Hello! This is an automated call from NotiGrid.",
"metadata": {
"voice": "alice",
"language": "en-US"
}
}'Message Templates
SMS Template
{
"name": "verification-code",
"channel": "sms",
"body": "Your {{app_name}} verification code is: {{code}}. This code expires in {{expires_in}} minutes."
}Usage:
curl -X POST https://api.notigrid.com/v1/notifications \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"template": "verification-code",
"to": "+1234567890",
"data": {
"app_name": "NotiGrid",
"code": "123456",
"expires_in": "10"
}
}'Order Status Template
{
"name": "order-shipped",
"channel": "sms",
"body": "Great news! Your order #{{order_id}} has shipped. Track it here: {{tracking_url}}"
}Advanced Features
Delivery Status Callbacks
Get notified when messages are delivered:
- In NotiGrid dashboard, go to Settings → Webhooks
- Add your webhook URL for delivery status
- NotiGrid will send POST requests with delivery updates:
{
"event": "message.delivered",
"messageId": "msg_123456",
"to": "+1234567890",
"status": "delivered",
"timestamp": "2025-01-16T10:30:00Z"
}Message Segments
SMS messages are charged per segment:
- Standard (GSM-7): 160 characters per segment
- Unicode: 70 characters per segment
- Concatenated: Overhead reduces per-segment count
Example:
- 150 characters = 1 segment
- 165 characters = 2 segments
- 320 characters = 3 segments
Tips to reduce segments:
- Avoid emojis (use Unicode)
- Avoid special characters when possible
- Use URL shorteners for long links
Sender ID (Alpha Sender)
Available in some countries (UK, parts of Europe, Asia):
curl -X POST https://api.notigrid.com/v1/notifications \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"channel": "sms",
"to": "+447700900000",
"body": "Hello from MyBrand!",
"metadata": {
"from": "MyBrand"
}
}'Note: Not supported in US/Canada.
Short Codes
For high-volume SMS (requires separate application):
- Apply for short code through Twilio
- Complete carrier approval (4-12 weeks)
- Configure in NotiGrid
- Use for promotional campaigns
Phone Number Types
Long Code (Standard)
- Format: Regular 10-digit number (+1234567890)
- Use case: P2P messaging, transactional SMS
- Throughput: 1 message per second
- Cost: ~$1-2/month
Toll-Free Numbers
- Format: +1 (8XX) XXX-XXXX
- Use case: Business messaging, customer support
- Throughput: Higher than long code
- Cost: ~$2-5/month
- Verification required for A2P messaging
Short Codes
- Format: 5-6 digits (e.g., 12345)
- Use case: Marketing, high-volume
- Throughput: Up to 100 messages per second
- Cost: ~$1,000-1,500/month
WhatsApp Business API
If you have WhatsApp Business enabled:
Setup
- Apply for WhatsApp Business access through Twilio
- Get your WhatsApp number approved
- Configure in NotiGrid
Send WhatsApp Message
curl -X POST https://api.notigrid.com/v1/notifications \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"channel": "whatsapp",
"to": "+1234567890",
"body": "Hello from NotiGrid!",
"metadata": {
"from": "whatsapp:+1234567890"
}
}'Rate Limits & Throughput
Default Limits
- Long code: 1 msg/second
- Toll-free: 3 msg/second (after verification: higher)
- Short code: Up to 100 msg/second
Increase Limits
- Contact Twilio support
- Provide use case details
- Request higher throughput
- May require additional verification
Pricing
SMS Pricing (US, as of 2025)
- Outbound: $0.0079 per message segment
- Inbound: $0.0079 per message segment
- MMS: $0.02 per message
International SMS
- Varies by country ($0.01 - $0.50+ per message)
- Check Twilio SMS Pricing
Voice Pricing (US)
- Outbound calls: $0.013/minute
- Inbound calls: $0.0085/minute
Cost Estimation
- 10,000 SMS/month ≈ $79
- 100,000 SMS/month ≈ $790
- Add phone number cost (~$1/month)
Best Practices
Compliance
- Obtain consent - Get explicit opt-in before sending
- Include opt-out - Always provide "Reply STOP to unsubscribe"
- Honor opt-outs - Process STOP requests immediately
- Time restrictions - Don't send 9PM - 8AM local time
- Identify yourself - Make sender clear in message
Message Quality
- Keep it concise - Aim for under 160 characters
- Use clear CTAs - Make actions obvious
- Personalize - Use recipient's name when appropriate
- Provide value - Only send useful, timely information
- Test thoroughly - Send test messages before campaigns
Deliverability
- Use registered numbers - Register toll-free numbers for A2P
- Avoid spam triggers - Don't use all caps, excessive punctuation
- Monitor metrics - Track delivery and conversion rates
- Maintain clean lists - Remove invalid/inactive numbers
- Segment audience - Send relevant content to each group
Monitoring & Analytics
Key Metrics
Track in NotiGrid dashboard:
- Sent - Total messages sent
- Delivered - Successfully delivered
- Failed - Delivery failures
- Delivery rate - Percentage delivered
- Cost - Total spend
Error Codes
Common Twilio error codes:
- 30003 - Unreachable destination
- 30004 - Message blocked
- 30005 - Unknown destination
- 30006 - Landline or unreachable carrier
- 30007 - Message filtered (spam)
- 21211 - Invalid phone number
Troubleshooting
Messages Not Sending
- Check phone format - Must be E.164 (+1234567890)
- Verify number - On trial, recipient must be verified
- Check balance - Ensure Twilio account has credit
- Review logs - Check Twilio console for errors
- Test connection - Use NotiGrid test button
High Failure Rate
- Validate numbers - Use phone validation API
- Remove landlines - Can't receive SMS
- Check carrier blocks - Some carriers filter messages
- Review content - Avoid spam-like content
- Register numbers - Complete A2P registration for toll-free
Messages Going to Spam
- Register your number - Complete carrier registration
- Use verified sender - Register your brand
- Avoid spam triggers - No "FREE", "CLICK HERE", etc.
- Include opt-out - Always provide unsubscribe option
- Maintain good practices - Low complaint rates
Security
- Secure credentials - Never expose Auth Token
- Use environment variables - Don't hardcode credentials
- Rotate tokens - Periodically rotate auth tokens
- Enable 2FA - Secure your Twilio account
- Monitor usage - Set up alerts for unusual activity
- IP whitelisting - Restrict API access (if possible)
Compliance & Regulations
United States
- TCPA - Telephone Consumer Protection Act
- CAN-SPAM - Email/SMS marketing rules
- CTIA - Carrier guidelines
Europe
- GDPR - Data protection requirements
- Privacy and Electronic Communications Directive
Global
- Check local regulations for each destination country
- Maintain consent records
- Honor do-not-call lists
Support Resources
- Twilio Documentation: twilio.com/docs
- Twilio Support: support.twilio.com
- Twilio Console: console.twilio.com
- NotiGrid Support: support@notigrid.com
- Community: community.notigrid.com