Skip to main content

Overview

Unosend provides a simple API for sending SMS messages. Perfect for:

OTP & Verification

Two-factor authentication and phone verification

Transactional Alerts

Order confirmations, shipping updates, appointments

Notifications

Account alerts, reminders, status updates

Marketing

Promotional messages (with consent)

Pricing

ItemPrice
First 10 SMSFree
Additional SMS$0.01 per segment
SMS messages are charged per segment. A segment is 160 characters for GSM-7 encoding (standard text) or 70 characters for Unicode (emojis, special characters).

Quick Start

Send Your First SMS

cURL
curl -X POST https://www.unosend.co/api/v1/sms \
  -H "Authorization: Bearer un_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "to": "+14155551234",
    "body": "Your verification code is 123456"
  }'

Response

{
  "data": {
    "id": "sms_abc123xyz",
    "to": "+14155551234",
    "body": "Your verification code is 123456",
    "status": "sent",
    "segments": 1,
    "created_at": "2026-01-15T10:30:00Z"
  }
}

SDK Examples

const response = await fetch('https://www.unosend.co/api/v1/sms', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer un_your_api_key',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    to: '+14155551234',
    body: 'Your verification code is 123456',
  }),
});

const data = await response.json();
console.log(data.data.id); // sms_abc123xyz

Phone Number Format

Always use E.164 format for phone numbers:
CountryFormatExample
USA/Canada+1XXXXXXXXXX+14155551234
UK+44XXXXXXXXXX+447700900123
Germany+49XXXXXXXXXXX+4915123456789
India+91XXXXXXXXXX+919876543210
Australia+61XXXXXXXXX+61412345678
Phone numbers must include the country code with + prefix. Numbers without country codes will be rejected.

Segment Calculation

SMS messages are split into segments based on character encoding:
EncodingSingle SMSMulti-part SMS
GSM-7 (standard text)160 chars153 chars/segment
Unicode (emojis, etc.)70 chars67 chars/segment

Examples

MessageCharactersEncodingSegments
”Your code is 123456”19GSM-71
”Hello! 👋 Welcome”16Unicode1
200-char text message200GSM-72
150-char with emoji150Unicode3
Use standard ASCII characters when possible to maximize message length and minimize costs.

Batch Sending

Send to multiple recipients in a single API call (max 100 per request):
cURL
curl -X POST https://www.unosend.co/api/v1/sms \
  -H "Authorization: Bearer un_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "to": ["+14155551234", "+14155555678", "+447700900123"],
    "body": "Flash sale! 50% off all items today."
  }'

Response

{
  "data": [
    { "id": "sms_abc123", "to": "+14155551234", "status": "sent", "segments": 1 },
    { "id": "sms_def456", "to": "+14155555678", "status": "sent", "segments": 1 },
    { "id": "sms_ghi789", "to": "+447700900123", "status": "sent", "segments": 1 }
  ]
}
For more details, see the Batch SMS API Reference.

OTP Verification

Unosend provides a built-in OTP verification flow:

Step 1: Send OTP

curl -X POST https://www.unosend.co/api/v1/sms/verify/send \
  -H "Authorization: Bearer un_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "to": "+14155551234"
  }'
This sends a 6-digit code to the user.

Step 2: Verify OTP

curl -X POST https://www.unosend.co/api/v1/sms/verify/check \
  -H "Authorization: Bearer un_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "to": "+14155551234",
    "code": "123456"
  }'

Response

{
  "data": {
    "verified": true,
    "phone": "+14155551234"
  }
}

Sender ID

You can customize the sender name that appears on recipients’ phones:
{
  "to": "+14155551234",
  "body": "Your order has shipped!",
  "from": "MyStore"
}
Sender ID support varies by country:
  • ✅ Supported: UK, Germany, France, Australia, most of Europe
  • ❌ Not supported: USA, Canada (shows a phone number instead)
  • ⚠️ Requires registration: India (DLT), Singapore, others

Country-Specific Requirements

India (DLT Registration)

Sending SMS to India requires DLT registration:
  1. Register with a DLT portal (JioTrueConnect, Vodafone DLT, etc.)
  2. Register your sender ID (header)
  3. Register message templates
  4. Provide your DLT Entity ID and Template ID
Without DLT registration, SMS to India may be blocked by carriers. Contact support for assistance with DLT setup.

United States (10DLC)

For high-volume SMS to US numbers, register for 10DLC:
  • Required for sending at scale
  • Improves deliverability
  • Contact support to register your brand and campaigns

Wallet & Billing

SMS is billed from your wallet balance:
  1. First 10 SMS are free
  2. After that, each segment costs $0.01
  3. Balance is deducted after successful sends
  4. Add funds at Settings → Wallet

Check Balance Before Sending

The API returns a 402 Payment Required error if balance is insufficient:
{
  "error": "Insufficient wallet balance ($0.00). Add funds to send SMS. Estimated cost: $0.01"
}

Message Status

Track SMS delivery status:
StatusDescription
queuedMessage accepted, pending send
sentSent to carrier
deliveredConfirmed delivered to device
failedDelivery failed
undeliveredCarrier could not deliver

Get SMS Status

curl https://www.unosend.co/api/v1/sms/sms_abc123 \
  -H "Authorization: Bearer un_your_api_key"

Best Practices

Always include country code with + prefix. Validate phone numbers before sending.
Shorter messages = fewer segments = lower costs. Aim for under 160 characters.
Emojis and special characters reduce segment capacity from 160 to 70 characters.
Respect STOP requests. We automatically handle opt-outs for compliant messaging.
For marketing messages, include “Reply STOP to unsubscribe” as required by regulations.
Spread large sends over time to avoid carrier throttling.

Rate Limits

PlanSMS per minute
Free10
Pro100
Scale500
EnterpriseCustom

Error Codes

CodeMeaning
400Invalid phone number or request
401Invalid API key
402Insufficient wallet balance
429Rate limit exceeded
500Internal error

Next Steps