curl --request POST \
--url https://api.spenza.com/api/v1.1/sms \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"fromNumber": "+12792044584",
"toNumber": "+15555551234",
"text": "Hello from Spenza!"
}
'import requests
url = "https://api.spenza.com/api/v1.1/sms"
payload = {
"fromNumber": "+12792044584",
"toNumber": "+15555551234",
"text": "Hello from Spenza!"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
fromNumber: '+12792044584',
toNumber: '+15555551234',
text: 'Hello from Spenza!'
})
};
fetch('https://api.spenza.com/api/v1.1/sms', 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.spenza.com/api/v1.1/sms",
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([
'fromNumber' => '+12792044584',
'toNumber' => '+15555551234',
'text' => 'Hello from Spenza!'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.spenza.com/api/v1.1/sms"
payload := strings.NewReader("{\n \"fromNumber\": \"+12792044584\",\n \"toNumber\": \"+15555551234\",\n \"text\": \"Hello from Spenza!\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.spenza.com/api/v1.1/sms")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"fromNumber\": \"+12792044584\",\n \"toNumber\": \"+15555551234\",\n \"text\": \"Hello from Spenza!\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.spenza.com/api/v1.1/sms")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"fromNumber\": \"+12792044584\",\n \"toNumber\": \"+15555551234\",\n \"text\": \"Hello from Spenza!\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"message": "Outbound SMS sent successfully"
}
}Send an SMS
Send a Mobile-Originated (MO) SMS from a number provisioned on your
account. Requires the account’s Admin role tier. MO SMS is only
implemented for some operators (SpenzaJ today) — everyone else gets
501. This is a synchronous endpoint that returns 201 directly
(NestJS’s default for @Post(), since the handler has no @HttpCode
override); it does not follow the async 202 + transaction-polling
pattern used elsewhere. fromNumber, toNumber, and text are all
shown as required below to reflect this endpoint’s actual runtime
behavior — enforcement happens in controller logic, not in the
underlying DTO. toNumber is only validated for E.164 format; it is
not checked against any ownership/allow-list.
curl --request POST \
--url https://api.spenza.com/api/v1.1/sms \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"fromNumber": "+12792044584",
"toNumber": "+15555551234",
"text": "Hello from Spenza!"
}
'import requests
url = "https://api.spenza.com/api/v1.1/sms"
payload = {
"fromNumber": "+12792044584",
"toNumber": "+15555551234",
"text": "Hello from Spenza!"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
fromNumber: '+12792044584',
toNumber: '+15555551234',
text: 'Hello from Spenza!'
})
};
fetch('https://api.spenza.com/api/v1.1/sms', 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.spenza.com/api/v1.1/sms",
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([
'fromNumber' => '+12792044584',
'toNumber' => '+15555551234',
'text' => 'Hello from Spenza!'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.spenza.com/api/v1.1/sms"
payload := strings.NewReader("{\n \"fromNumber\": \"+12792044584\",\n \"toNumber\": \"+15555551234\",\n \"text\": \"Hello from Spenza!\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.spenza.com/api/v1.1/sms")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"fromNumber\": \"+12792044584\",\n \"toNumber\": \"+15555551234\",\n \"text\": \"Hello from Spenza!\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.spenza.com/api/v1.1/sms")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"fromNumber\": \"+12792044584\",\n \"toNumber\": \"+15555551234\",\n \"text\": \"Hello from Spenza!\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"message": "Outbound SMS sent successfully"
}
}Authorizations
Bearer token obtained from POST /api/v1.1/auth/token.
Headers
Any string unique to this logical request. On a retry with the same key
and the same request body, the original response is replayed verbatim
(with an Idempotency-Replayed: true response header) instead of the
action repeating. Reusing the key with a different body or on a
different route returns 409 IDEMPOTENCY_KEY_REUSED. A replay attempted
while the original call is still in flight returns 409 CONFLICT.
Optional — omit it and the endpoint behaves exactly as it would otherwise.
"a1b2c3d4-idem-key-001"
Body
Response
Sent.

