Overview
Our messaging API allows you to send both SMS (text) and MMS (multimedia) messages programmatically. Messages are queued and delivered through your configured messaging provider.Basic SMS message
The simplest way to send a message requires just two parameters:Specifying a sender
By default, messages are sent from your configured messaging service number. You can specify a different sender number:The
from number must be configured in your workspace and verified with your messaging provider.Sending to multiple recipients
To send messages to multiple recipients, make parallel API calls:Long messages
SMS messages longer than 160 characters are automatically split into multiple segments:- Single SMS: Up to 160 characters
- Multi-part SMS: Up to 1,600 characters (split into segments of 153 characters each)
MMS messages
To send multimedia messages, include media URLs:- Images: JPEG, PNG, GIF (up to 5MB)
- Audio: MP3, WAV (up to 5MB)
- Video: MP4, 3GP (up to 5MB)
- Documents: PDF, VCF (up to 5MB)
Message status
All messages start with aqueued status and progress through these states:
| Status | Description |
|---|---|
queued | Message accepted and queued for delivery |
sending | Message is being sent to carrier |
sent | Message sent to carrier network |
delivered | Message confirmed delivered to device |
failed | Message could not be delivered |
undelivered | Message sent but not delivered |
Error handling
Always implement proper error handling:Best practices
- Validate phone numbers: Always validate and format phone numbers in E.164 format (+country code + number)
- Handle rate limits: Implement exponential backoff for rate limit errors
- Log message SIDs: Store the message SID for tracking and debugging
- Use callbacks: Set up webhooks to receive real-time delivery updates
- Test thoroughly: Test with different carriers and number types