Create number with SIP gateways
curl --request POST \
--url https://api.zeroruntime.ai/v2/sip/phone-numbers \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Support SIP",
"phoneNumbers": [
"+14155550100",
"+14155550101"
],
"isShared": true,
"mediaEncryption": "disable",
"inbound": {
"sipRegion": "auto"
},
"outbound": {
"address": "sip.my-carrier.com",
"sipRegion": "us002",
"transport": "tls",
"auth": {
"username": "sip-user",
"password": "s3cr3t"
}
}
}
'import requests
url = "https://api.zeroruntime.ai/v2/sip/phone-numbers"
payload = {
"name": "Support SIP",
"phoneNumbers": ["+14155550100", "+14155550101"],
"isShared": True,
"mediaEncryption": "disable",
"inbound": { "sipRegion": "auto" },
"outbound": {
"address": "sip.my-carrier.com",
"sipRegion": "us002",
"transport": "tls",
"auth": {
"username": "sip-user",
"password": "s3cr3t"
}
}
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Support SIP',
phoneNumbers: ['+14155550100', '+14155550101'],
isShared: true,
mediaEncryption: 'disable',
inbound: {sipRegion: 'auto'},
outbound: {
address: 'sip.my-carrier.com',
sipRegion: 'us002',
transport: 'tls',
auth: {username: 'sip-user', password: 's3cr3t'}
}
})
};
fetch('https://api.zeroruntime.ai/v2/sip/phone-numbers', 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.zeroruntime.ai/v2/sip/phone-numbers",
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([
'name' => 'Support SIP',
'phoneNumbers' => [
'+14155550100',
'+14155550101'
],
'isShared' => true,
'mediaEncryption' => 'disable',
'inbound' => [
'sipRegion' => 'auto'
],
'outbound' => [
'address' => 'sip.my-carrier.com',
'sipRegion' => 'us002',
'transport' => 'tls',
'auth' => [
'username' => 'sip-user',
'password' => 's3cr3t'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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.zeroruntime.ai/v2/sip/phone-numbers"
payload := strings.NewReader("{\n \"name\": \"Support SIP\",\n \"phoneNumbers\": [\n \"+14155550100\",\n \"+14155550101\"\n ],\n \"isShared\": true,\n \"mediaEncryption\": \"disable\",\n \"inbound\": {\n \"sipRegion\": \"auto\"\n },\n \"outbound\": {\n \"address\": \"sip.my-carrier.com\",\n \"sipRegion\": \"us002\",\n \"transport\": \"tls\",\n \"auth\": {\n \"username\": \"sip-user\",\n \"password\": \"s3cr3t\"\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
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.zeroruntime.ai/v2/sip/phone-numbers")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Support SIP\",\n \"phoneNumbers\": [\n \"+14155550100\",\n \"+14155550101\"\n ],\n \"isShared\": true,\n \"mediaEncryption\": \"disable\",\n \"inbound\": {\n \"sipRegion\": \"auto\"\n },\n \"outbound\": {\n \"address\": \"sip.my-carrier.com\",\n \"sipRegion\": \"us002\",\n \"transport\": \"tls\",\n \"auth\": {\n \"username\": \"sip-user\",\n \"password\": \"s3cr3t\"\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.zeroruntime.ai/v2/sip/phone-numbers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Support SIP\",\n \"phoneNumbers\": [\n \"+14155550100\",\n \"+14155550101\"\n ],\n \"isShared\": true,\n \"mediaEncryption\": \"disable\",\n \"inbound\": {\n \"sipRegion\": \"auto\"\n },\n \"outbound\": {\n \"address\": \"sip.my-carrier.com\",\n \"sipRegion\": \"us002\",\n \"transport\": \"tls\",\n \"auth\": {\n \"username\": \"sip-user\",\n \"password\": \"s3cr3t\"\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"message": "Phone Number with SIP Configured Created Successfully"
}{
"message": "<string>"
}{
"message": "One or more phone numbers were attached to a gateway concurrently. Please retry."
}Phone numbers
Create number with SIP gateways
Registers numbers from your own SIP trunk and attaches an inbound and an outbound gateway to them in one call. Numbers already on your account are reused.
This is only for numbers on your own SIP trunk. Numbers bought in the dashboard are set up for you.
POST
/
v2
/
sip
/
phone-numbers
Create number with SIP gateways
curl --request POST \
--url https://api.zeroruntime.ai/v2/sip/phone-numbers \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Support SIP",
"phoneNumbers": [
"+14155550100",
"+14155550101"
],
"isShared": true,
"mediaEncryption": "disable",
"inbound": {
"sipRegion": "auto"
},
"outbound": {
"address": "sip.my-carrier.com",
"sipRegion": "us002",
"transport": "tls",
"auth": {
"username": "sip-user",
"password": "s3cr3t"
}
}
}
'import requests
url = "https://api.zeroruntime.ai/v2/sip/phone-numbers"
payload = {
"name": "Support SIP",
"phoneNumbers": ["+14155550100", "+14155550101"],
"isShared": True,
"mediaEncryption": "disable",
"inbound": { "sipRegion": "auto" },
"outbound": {
"address": "sip.my-carrier.com",
"sipRegion": "us002",
"transport": "tls",
"auth": {
"username": "sip-user",
"password": "s3cr3t"
}
}
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Support SIP',
phoneNumbers: ['+14155550100', '+14155550101'],
isShared: true,
mediaEncryption: 'disable',
inbound: {sipRegion: 'auto'},
outbound: {
address: 'sip.my-carrier.com',
sipRegion: 'us002',
transport: 'tls',
auth: {username: 'sip-user', password: 's3cr3t'}
}
})
};
fetch('https://api.zeroruntime.ai/v2/sip/phone-numbers', 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.zeroruntime.ai/v2/sip/phone-numbers",
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([
'name' => 'Support SIP',
'phoneNumbers' => [
'+14155550100',
'+14155550101'
],
'isShared' => true,
'mediaEncryption' => 'disable',
'inbound' => [
'sipRegion' => 'auto'
],
'outbound' => [
'address' => 'sip.my-carrier.com',
'sipRegion' => 'us002',
'transport' => 'tls',
'auth' => [
'username' => 'sip-user',
'password' => 's3cr3t'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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.zeroruntime.ai/v2/sip/phone-numbers"
payload := strings.NewReader("{\n \"name\": \"Support SIP\",\n \"phoneNumbers\": [\n \"+14155550100\",\n \"+14155550101\"\n ],\n \"isShared\": true,\n \"mediaEncryption\": \"disable\",\n \"inbound\": {\n \"sipRegion\": \"auto\"\n },\n \"outbound\": {\n \"address\": \"sip.my-carrier.com\",\n \"sipRegion\": \"us002\",\n \"transport\": \"tls\",\n \"auth\": {\n \"username\": \"sip-user\",\n \"password\": \"s3cr3t\"\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
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.zeroruntime.ai/v2/sip/phone-numbers")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Support SIP\",\n \"phoneNumbers\": [\n \"+14155550100\",\n \"+14155550101\"\n ],\n \"isShared\": true,\n \"mediaEncryption\": \"disable\",\n \"inbound\": {\n \"sipRegion\": \"auto\"\n },\n \"outbound\": {\n \"address\": \"sip.my-carrier.com\",\n \"sipRegion\": \"us002\",\n \"transport\": \"tls\",\n \"auth\": {\n \"username\": \"sip-user\",\n \"password\": \"s3cr3t\"\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.zeroruntime.ai/v2/sip/phone-numbers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Support SIP\",\n \"phoneNumbers\": [\n \"+14155550100\",\n \"+14155550101\"\n ],\n \"isShared\": true,\n \"mediaEncryption\": \"disable\",\n \"inbound\": {\n \"sipRegion\": \"auto\"\n },\n \"outbound\": {\n \"address\": \"sip.my-carrier.com\",\n \"sipRegion\": \"us002\",\n \"transport\": \"tls\",\n \"auth\": {\n \"username\": \"sip-user\",\n \"password\": \"s3cr3t\"\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"message": "Phone Number with SIP Configured Created Successfully"
}{
"message": "<string>"
}{
"message": "One or more phone numbers were attached to a gateway concurrently. Please retry."
}Authorizations
Body
application/json