Send SMS API
Send SMS text messages to users for urgent notifications and verification codes
Send SMS API
Deliver SMS text messages for urgent notifications, verification codes, and time-sensitive alerts. High deliverability with global carrier support.
Direct Delivery
Messages delivered directly to mobile phones.
Instant
Near-instant delivery for urgent messages.
Global Coverage
Support for international phone numbers.
Endpoint Overview
/graphqlSend an SMS text message to a phone number. Supports international numbers and handles carrier-specific formatting.
Request Parameters
phoneNumberString!RequiredThe recipient's phone number in E.164 format (e.g., +1234567890).
messageString!RequiredThe SMS message content (max 160 characters for single SMS).
senderIdStringCustom sender ID (if supported by carrier).
GraphQL Mutation
mutation sendSMS($sms: SMSInput!) {
sendSMS(sms: $sms) {
messageId
status
segments
}
}Variables:
{
"sms": {
"phoneNumber": "+14155551234",
"message": "Your OrbVPN verification code is: 123456. Valid for 10 minutes."
}
}HTTP Request:
curl -X POST https://api.orbnet.com/graphql \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_ADMIN_TOKEN" \
-d '{
"query": "mutation sendSMS($sms: SMSInput!) { sendSMS(sms: $sms) { messageId status segments } }",
"variables": {
"sms": {
"phoneNumber": "+14155551234",
"message": "Your verification code is: 123456"
}
}
}'Response
{
"data": {
"sendSMS": {
"messageId": "sms_abc123xyz",
"status": "sent",
"segments": 1
}
}
}{
"errors": [
{
"message": "Invalid phone number format",
"path": ["sendSMS"],
"extensions": {
"code": "INVALID_PHONE_NUMBER"
}
}
],
"data": null
}{
"errors": [
{
"message": "Message exceeds maximum length",
"path": ["sendSMS"],
"extensions": {
"code": "MESSAGE_TOO_LONG",
"maxLength": 1600,
"providedLength": 1650
}
}
],
"data": null
}Use Cases
Verification Codes
Send OTP codes for two-factor authentication.
Security Alerts
Notify users of suspicious login attempts.
Urgent Notifications
Critical alerts when email may not be checked.
Payment Confirmations
Instant confirmation of successful payments.
Phone Number Format
E.164 Format
+[country code][number] e.g., +14155551234
Invalid Formats
(415) 555-1234 or 415-555-1234
Best Practices
Keep It Short
160 characters or less for single-segment SMS.
Include Context
Identify your service in the message.
Verify Numbers
Validate phone numbers before sending.
Rate Limit
Implement rate limiting to prevent abuse.
Related Endpoints
SMS Costs
SMS messages incur per-message costs. International messages may have higher rates. Monitor usage to manage costs.
Multi-Channel Messaging
Combine SMS with other channels for comprehensive notification coverage.