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",
// 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.

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 }"
}'