Send SMS & MMS via API
Send SMS & MMS via API
The SMS endpoint lets you send text and multimedia messages from your JustCall numbers through a simple API call. Use it for transactional alerts, appointment reminders, follow-ups, or any conversational messaging workflow.
Endpoint
POST https://api.justcall.io/v2/texts/send
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
from | string | Yes | Your JustCall SMS-enabled number (E.164 format) |
to | string | Yes | Recipient phone number (E.164 format) |
body | string | Yes | Message text (up to 1,600 characters) |
media_url | string | No | Publicly accessible URL of an image or file to send as MMS |
webhook_url | string | No | URL to receive delivery status updates |
Code Example: Send an SMS
curl -X POST "https://api.justcall.io/v2/texts/send" \
-H "Authorization: {api_key}:{api_secret}" \
-H "Content-Type: application/json" \
-d '{
"from": "+14155551234",
"to": "+14155559876",
"body": "Hi Alex, your appointment is confirmed for tomorrow at 2 PM."
}'
Code Example: Send an MMS
curl -X POST "https://api.justcall.io/v2/texts/send" \
-H "Authorization: {api_key}:{api_secret}" \
-H "Content-Type: application/json" \
-d '{
"from": "+14155551234",
"to": "+14155559876",
"body": "Here is your invoice for March.",
"media_url": "https://yourapp.com/invoices/march-2026.pdf"
}'
Successful Response
{
"status": "success",
"message": "Message sent",
"data": {
"message_id": "msg_4d9e1a7f",
"from": "+14155551234",
"to": "+14155559876",
"direction": "outbound",
"status": "queued"
}
}
Character Limits and Segment Billing
SMS messages are billed per segment. A single segment supports up to 160 GSM-7 characters (standard Latin letters, numbers, and common symbols). If your message uses Unicode (emojis, non-Latin scripts), the limit drops to 70 characters per segment.
| Encoding | Characters per segment | Max characters (concatenated) |
|---|---|---|
| GSM-7 | 160 | 1,600 (10 segments) |
| Unicode | 70 | 1,120 (16 segments) |
Messages longer than one segment are automatically split and reassembled on the recipient's device, but each segment is billed individually.
Delivery Status Webhook
If you include a webhook_url, JustCall sends a POST request when the delivery status changes:
| Status | Description |
|---|---|
queued | Message accepted and queued for delivery |
sent | Message sent to carrier |
delivered | Carrier confirmed delivery |
failed | Message could not be delivered |
undelivered | Carrier rejected the message |
The webhook payload includes message_id, status, to, from, and timestamp.
MMS Supported Media Types
| Type | Formats | Max size |
|---|---|---|
| Image | JPEG, PNG, GIF | 5 MB |
| File | PDF, VCF | 5 MB |
| Video | MP4 (carrier support varies) | 5 MB |
Error Handling
| Code | Meaning | Fix |
|---|---|---|
| 400 | Missing from, to, or body | Include all required fields |
| 404 | from number not found or not SMS-enabled | Use an SMS-enabled JustCall number |
| 422 | Message body exceeds character limit | Shorten the message to 1,600 characters or fewer |
| 429 | Rate limit exceeded | Retry with exponential backoff |