curl --request POST \
--url https://api.spenza.com/api/v1/customer/register-sip \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"sipIngressIp": "44.205.10.20",
"sipPort": 5060,
"transport": "udp",
"didRanges": [
"+14155550123",
"+1628555*"
]
}
'import requests
url = "https://api.spenza.com/api/v1/customer/register-sip"
payload = {
"sipIngressIp": "44.205.10.20",
"sipPort": 5060,
"transport": "udp",
"didRanges": ["+14155550123", "+1628555*"]
}
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({
sipIngressIp: '44.205.10.20',
sipPort: 5060,
transport: 'udp',
didRanges: ['+14155550123', '+1628555*']
})
};
fetch('https://api.spenza.com/api/v1/customer/register-sip', 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/customer/register-sip",
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([
'sipIngressIp' => '44.205.10.20',
'sipPort' => 5060,
'transport' => 'udp',
'didRanges' => [
'+14155550123',
'+1628555*'
]
]),
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/customer/register-sip"
payload := strings.NewReader("{\n \"sipIngressIp\": \"44.205.10.20\",\n \"sipPort\": 5060,\n \"transport\": \"udp\",\n \"didRanges\": [\n \"+14155550123\",\n \"+1628555*\"\n ]\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/customer/register-sip")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"sipIngressIp\": \"44.205.10.20\",\n \"sipPort\": 5060,\n \"transport\": \"udp\",\n \"didRanges\": [\n \"+14155550123\",\n \"+1628555*\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.spenza.com/api/v1/customer/register-sip")
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 \"sipIngressIp\": \"44.205.10.20\",\n \"sipPort\": 5060,\n \"transport\": \"udp\",\n \"didRanges\": [\n \"+14155550123\",\n \"+1628555*\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"message": "SIP configuration registered successfully",
"sipConfig": {
"sipIngressIp": "44.205.10.20",
"sipPort": 5060,
"transport": "udp",
"codecs": [
"ulaw",
"alaw"
],
"didRanges": [
"+14155550123",
"+1628555*"
],
"allowedSourceIps": []
},
"isSIPEnabled": true
}Register or update your SIP gateway
Send inbound calls for your lines to your own SIP gateway — a PBX, contact-centre platform or SBC you run. Once registered, when someone calls one of your lines, Spenza’s voice nodes send the SIP INVITE to sipIngressIp:sipPort over transport instead of ringing the SIM.
Each call replaces the whole configuration. Nothing is merged: an optional field you leave out goes back to its default, so send the full configuration every time.
Which lines are routed
- Every line on your account that has a phone number, narrowed by
didRanges. LeavedidRangesempty to route them all. - A line bound to an AI voice agent stays with the agent.
- A number that two accounts both claim is never routed.
- Changes reach Spenza’s voice nodes on their next routing sync, typically within seconds.
Destination rules. sipIngressIp must be a public IPv4 address — hostnames aren’t accepted yet. Private, loopback, link-local, carrier-grade NAT, multicast, broadcast, reserved and documentation ranges (such as 203.0.113.0/24) are refused, as are Spenza’s own ranges. sipPort must be 1024–65535.
Spenza doesn’t send SIP credentials to your gateway, so restrict it by source address instead — ask support@spenza.com for the addresses Spenza’s voice nodes call from.
Contract exceptions
- Needs an Admin-tier API key. A token from a read-only or read-write key gets
401Access to this endpoint is forbidden. - Not on the standard envelope. Success is a flat
{ message, sipConfig, isSIPEnabled }, and errors use the shapes shown below rather than{ success: false, error }. - A refused destination currently comes back as
500with the reason inmessage, not400. Treat a500whosemessagestarts withSIP destinationorSIP portas a validation error and fix the request.
curl --request POST \
--url https://api.spenza.com/api/v1/customer/register-sip \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"sipIngressIp": "44.205.10.20",
"sipPort": 5060,
"transport": "udp",
"didRanges": [
"+14155550123",
"+1628555*"
]
}
'import requests
url = "https://api.spenza.com/api/v1/customer/register-sip"
payload = {
"sipIngressIp": "44.205.10.20",
"sipPort": 5060,
"transport": "udp",
"didRanges": ["+14155550123", "+1628555*"]
}
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({
sipIngressIp: '44.205.10.20',
sipPort: 5060,
transport: 'udp',
didRanges: ['+14155550123', '+1628555*']
})
};
fetch('https://api.spenza.com/api/v1/customer/register-sip', 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/customer/register-sip",
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([
'sipIngressIp' => '44.205.10.20',
'sipPort' => 5060,
'transport' => 'udp',
'didRanges' => [
'+14155550123',
'+1628555*'
]
]),
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/customer/register-sip"
payload := strings.NewReader("{\n \"sipIngressIp\": \"44.205.10.20\",\n \"sipPort\": 5060,\n \"transport\": \"udp\",\n \"didRanges\": [\n \"+14155550123\",\n \"+1628555*\"\n ]\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/customer/register-sip")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"sipIngressIp\": \"44.205.10.20\",\n \"sipPort\": 5060,\n \"transport\": \"udp\",\n \"didRanges\": [\n \"+14155550123\",\n \"+1628555*\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.spenza.com/api/v1/customer/register-sip")
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 \"sipIngressIp\": \"44.205.10.20\",\n \"sipPort\": 5060,\n \"transport\": \"udp\",\n \"didRanges\": [\n \"+14155550123\",\n \"+1628555*\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"message": "SIP configuration registered successfully",
"sipConfig": {
"sipIngressIp": "44.205.10.20",
"sipPort": 5060,
"transport": "udp",
"codecs": [
"ulaw",
"alaw"
],
"didRanges": [
"+14155550123",
"+1628555*"
],
"allowedSourceIps": []
},
"isSIPEnabled": true
}Authorizations
Bearer token obtained from POST /api/v1.1/auth/token.
Body
Public IPv4 address of your gateway. See the destination rules above.
"44.205.10.20"
1024 <= x <= 655355060
udp, tcp, tls Stored and returned, but not applied yet — calls are offered with the voice node's standard codec set.
Which of your numbers to route. Each entry is an exact E.164 number (+14155550123) or an E.164 prefix ending in * (+1628555*). Empty routes every line on your account. Entries in any other form — such as +1415000xxxx — match nothing.
["+14155550123", "+1628555*"]
Stored and returned, but not enforced yet.
["44.205.10.20"]
Send false to save the configuration without routing any calls. GET then returns sipConfig: null.

