Skip to content

Send Single SMS

Sending a single SMS is very easy and should take just a few seconds to integrate.

The easiest way to send SMS is using our official client libraries.

// Inject IConnectSms via dependency injection, or build manually:
// var smsClient = new ConnectClientBuilder()
// .WithApiKey("your-api-key")
// .BuildSmsClient();
await smsClient.SendSmsAsync(new ConnectSmsMessage
{
To = "+447700900123", // Required: E.164 format
From = "YourSender", // Optional if DefaultSmsSender is configured
Content = "Your verification code is 123456"
});
await smsClient.SendSmsAsync(new ConnectSmsMessage
{
To = "+447700900123",
Content = "Your appointment is tomorrow at 10am",
// Schedule for later (optional)
DateSendAtUtc = DateTime.UtcNow.AddHours(1),
// Track for billing/analytics (optional)
ClientReference = "appointment-reminder-123",
// Override Workspace link shortening for this message (optional)
EnableLinkShortening = true,
// Control unicode handling (optional, defaults to Allow)
UnicodeMode = UnicodeMode.Allow // Allow, Deny, or Strip
});
await smsClient.SendSmsAsync(new ConnectSmsMessage
{
To = "+447700900123",
TemplateName = "verification-code",
TemplateData = new Dictionary<string, object>
{
["code"] = "123456",
["expiresIn"] = "10 minutes"
}
});

POST
/sms/send

Headers

X-Api-Key
required
string
The API Key for your Workspace.

JSON Data

sender
required
string
Sender Name for the SMS.
recipient
required
string
format: E.164
Recipient Number (E.164 format) for the SMS.
content
required
string
The Content of the SMS to send.
sendAtUtc
string
format: date-time (ISO 8601)
The date (UTC) in ISO 8601 format for when the SMS should be scheduled. If not specified, the SMS will be sent immediately.
clientReference
string
Your own reference for the message, useful for billing, analytics, and matching webhook delivery receipts back to your system.
unicode
string
Controls how Unicode characters are handled. Accepted values are Allow, Deny, and Strip.
enableLinkShortening
boolean
Overrides your Workspace link shortening setting for this message. Set true to enable link shortening for this send, or false to disable it.

JSON Data

id
string
format: long / int64
The SMS ID from Connect.
countryCode
string
Country code extracted from the phone number.

Paste this in your favourite terminal to send your first SMS. Don’t forget to replace the things.

Sending with cURL
curl -X POST https://connect-api.divergent.cloud/sms/send \
-H "X-Api-Key: { API_KEY }" \
--json '{
"sender": "{ SENDER_NAME }",
"recipient": "{ RECIPIENT_NUMBER }",
"content": "{ CONTENT }",
"enableLinkShortening": true
}'