Messages
Send a message
Send an outbound SMS via a registered Sender ID.
POST
/
v1
/
messaging
/
messages
Send a message
curl --request POST \
--url https://api.example.com/v1/messaging/messages \
--header 'Content-Type: application/json' \
--data '
{
"to": "<string>",
"sender_id": "<string>",
"body": "<string>",
"market": "<string>",
"reference": "<string>",
"callback_url": "<string>",
"scheduled_at": "<string>"
}
'import requests
url = "https://api.example.com/v1/messaging/messages"
payload = {
"to": "<string>",
"sender_id": "<string>",
"body": "<string>",
"market": "<string>",
"reference": "<string>",
"callback_url": "<string>",
"scheduled_at": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
to: '<string>',
sender_id: '<string>',
body: JSON.stringify('<string>'),
market: '<string>',
reference: '<string>',
callback_url: '<string>',
scheduled_at: '<string>'
})
};
fetch('https://api.example.com/v1/messaging/messages', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/v1/messaging/messages",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'to' => '<string>',
'sender_id' => '<string>',
'body' => '<string>',
'market' => '<string>',
'reference' => '<string>',
'callback_url' => '<string>',
'scheduled_at' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/messaging/messages"
payload := strings.NewReader("{\n \"to\": \"<string>\",\n \"sender_id\": \"<string>\",\n \"body\": \"<string>\",\n \"market\": \"<string>\",\n \"reference\": \"<string>\",\n \"callback_url\": \"<string>\",\n \"scheduled_at\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/v1/messaging/messages")
.header("Content-Type", "application/json")
.body("{\n \"to\": \"<string>\",\n \"sender_id\": \"<string>\",\n \"body\": \"<string>\",\n \"market\": \"<string>\",\n \"reference\": \"<string>\",\n \"callback_url\": \"<string>\",\n \"scheduled_at\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/messaging/messages")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"to\": \"<string>\",\n \"sender_id\": \"<string>\",\n \"body\": \"<string>\",\n \"market\": \"<string>\",\n \"reference\": \"<string>\",\n \"callback_url\": \"<string>\",\n \"scheduled_at\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"ok": true,
"data": {
"id": "msg_a1b2c3d4e5",
"status": "queued",
"to": "+61412345678",
"sender_id": "SecurBank",
"body": "483291 is your verification code. It expires in 5 minutes. Do not share this code.",
"segments": 1,
"encoding": "GSM-7",
"market": "AU",
"reference": "otp-login-user-8821",
"created_at": "2026-07-17T14:30:00+10:00"
},
"meta": {
"request_id": "req_abc123",
"timestamp": "2026-07-17T14:30:00+10:00"
}
}
Required permission:
messaging:send
Request body
string
required
Recipient phone number in E.164 format (e.g.
+61412345678).string
required
Registered alphanumeric Sender ID. Max 11 characters. Must be a SID registered to your organisation.
string
required
Message content. Auto-encoded GSM-7 or UCS-2. Auto-concatenated if longer than 160 (GSM-7) or 70 (UCS-2) characters.
string
required
ISO 3166-1 alpha-2 country code. Determines routing and compliance rules.
string
Your internal reference. Returned in callbacks. Max 255 characters.
string
Per-message webhook override. Falls back to organisation-level webhook if not set.
string
ISO 8601 timestamp. Schedule for future delivery. Max 7 days ahead.
Examples
- OTP / 2FA
- Logistics
- Promotional
curl -X POST https://api.senderz.ai/v1/messaging/messages \
-H "Authorization: Bearer sz_live_xxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"to": "+61412345678",
"sender_id": "SecurBank",
"body": "483291 is your verification code. It expires in 5 minutes. Do not share this code.",
"market": "AU",
"reference": "otp-login-user-8821"
}'
curl -X POST https://api.senderz.ai/v1/messaging/messages \
-H "Authorization: Bearer sz_live_xxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"to": "+61400123456",
"sender_id": "TrackFast",
"body": "Your order SYD-90421 has been dispatched. Expected delivery: tomorrow by 5pm. Track at trackfast.com.au/SYD90421",
"market": "AU",
"reference": "shipment-SYD-90421"
}'
curl -X POST https://api.senderz.ai/v1/messaging/messages \
-H "Authorization: Bearer sz_live_xxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"to": "+61498765432",
"sender_id": "StyleHaus",
"body": "Flash sale: 30% off all winter styles. Ends midnight AEST. Shop now at stylehaus.com.au/sale. Reply STOP to opt out.",
"market": "AU",
"reference": "promo-winter-2026-batch3"
}'
Response
{
"ok": true,
"data": {
"id": "msg_a1b2c3d4e5",
"status": "queued",
"to": "+61412345678",
"sender_id": "SecurBank",
"body": "483291 is your verification code. It expires in 5 minutes. Do not share this code.",
"segments": 1,
"encoding": "GSM-7",
"market": "AU",
"reference": "otp-login-user-8821",
"created_at": "2026-07-17T14:30:00+10:00"
},
"meta": {
"request_id": "req_abc123",
"timestamp": "2026-07-17T14:30:00+10:00"
}
}
⌘I
Send a message
curl --request POST \
--url https://api.example.com/v1/messaging/messages \
--header 'Content-Type: application/json' \
--data '
{
"to": "<string>",
"sender_id": "<string>",
"body": "<string>",
"market": "<string>",
"reference": "<string>",
"callback_url": "<string>",
"scheduled_at": "<string>"
}
'import requests
url = "https://api.example.com/v1/messaging/messages"
payload = {
"to": "<string>",
"sender_id": "<string>",
"body": "<string>",
"market": "<string>",
"reference": "<string>",
"callback_url": "<string>",
"scheduled_at": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
to: '<string>',
sender_id: '<string>',
body: JSON.stringify('<string>'),
market: '<string>',
reference: '<string>',
callback_url: '<string>',
scheduled_at: '<string>'
})
};
fetch('https://api.example.com/v1/messaging/messages', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/v1/messaging/messages",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'to' => '<string>',
'sender_id' => '<string>',
'body' => '<string>',
'market' => '<string>',
'reference' => '<string>',
'callback_url' => '<string>',
'scheduled_at' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/messaging/messages"
payload := strings.NewReader("{\n \"to\": \"<string>\",\n \"sender_id\": \"<string>\",\n \"body\": \"<string>\",\n \"market\": \"<string>\",\n \"reference\": \"<string>\",\n \"callback_url\": \"<string>\",\n \"scheduled_at\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/v1/messaging/messages")
.header("Content-Type", "application/json")
.body("{\n \"to\": \"<string>\",\n \"sender_id\": \"<string>\",\n \"body\": \"<string>\",\n \"market\": \"<string>\",\n \"reference\": \"<string>\",\n \"callback_url\": \"<string>\",\n \"scheduled_at\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/messaging/messages")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"to\": \"<string>\",\n \"sender_id\": \"<string>\",\n \"body\": \"<string>\",\n \"market\": \"<string>\",\n \"reference\": \"<string>\",\n \"callback_url\": \"<string>\",\n \"scheduled_at\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"ok": true,
"data": {
"id": "msg_a1b2c3d4e5",
"status": "queued",
"to": "+61412345678",
"sender_id": "SecurBank",
"body": "483291 is your verification code. It expires in 5 minutes. Do not share this code.",
"segments": 1,
"encoding": "GSM-7",
"market": "AU",
"reference": "otp-login-user-8821",
"created_at": "2026-07-17T14:30:00+10:00"
},
"meta": {
"request_id": "req_abc123",
"timestamp": "2026-07-17T14:30:00+10:00"
}
}
.jpg?fit=max&auto=format&n=IhWYk8R5R6sdJ_7C&q=85&s=7e3194d82fa9653ad2a2449b4f1a3073)