Create a new phone number
curl --request POST \
--url https://api.verbex.ai/v1/phone-numbers/ \
--header 'Content-Type: application/json' \
--data '
{
"provider": "sip",
"phone_number": "+14155552671",
"sip_infra_region": "global",
"friendly_name": "<string>",
"sip_termination_uri": "<string>",
"sip_trunk_username": "<string>",
"sip_trunk_password": "<string>",
"inbound_agent_id": "<string>",
"outbound_agent_id": "<string>",
"sip_infra_zones": [
"<string>"
],
"call_concurrency": 1,
"max_concurrent_inbound_calls": 1,
"max_concurrent_outbound_calls": 1,
"expires": 60,
"advanced": {
"realm": "asterisk",
"ip": "1.2.3.4/24",
"prefix": "0",
"register": true
}
}
'import requests
url = "https://api.verbex.ai/v1/phone-numbers/"
payload = {
"provider": "sip",
"phone_number": "+14155552671",
"sip_infra_region": "global",
"friendly_name": "<string>",
"sip_termination_uri": "<string>",
"sip_trunk_username": "<string>",
"sip_trunk_password": "<string>",
"inbound_agent_id": "<string>",
"outbound_agent_id": "<string>",
"sip_infra_zones": ["<string>"],
"call_concurrency": 1,
"max_concurrent_inbound_calls": 1,
"max_concurrent_outbound_calls": 1,
"expires": 60,
"advanced": {
"realm": "asterisk",
"ip": "1.2.3.4/24",
"prefix": "0",
"register": True
}
}
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({
provider: 'sip',
phone_number: '+14155552671',
sip_infra_region: 'global',
friendly_name: '<string>',
sip_termination_uri: '<string>',
sip_trunk_username: '<string>',
sip_trunk_password: '<string>',
inbound_agent_id: '<string>',
outbound_agent_id: '<string>',
sip_infra_zones: ['<string>'],
call_concurrency: 1,
max_concurrent_inbound_calls: 1,
max_concurrent_outbound_calls: 1,
expires: 60,
advanced: {realm: 'asterisk', ip: '1.2.3.4/24', prefix: '0', register: true}
})
};
fetch('https://api.verbex.ai/v1/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.verbex.ai/v1/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([
'provider' => 'sip',
'phone_number' => '+14155552671',
'sip_infra_region' => 'global',
'friendly_name' => '<string>',
'sip_termination_uri' => '<string>',
'sip_trunk_username' => '<string>',
'sip_trunk_password' => '<string>',
'inbound_agent_id' => '<string>',
'outbound_agent_id' => '<string>',
'sip_infra_zones' => [
'<string>'
],
'call_concurrency' => 1,
'max_concurrent_inbound_calls' => 1,
'max_concurrent_outbound_calls' => 1,
'expires' => 60,
'advanced' => [
'realm' => 'asterisk',
'ip' => '1.2.3.4/24',
'prefix' => '0',
'register' => true
]
]),
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.verbex.ai/v1/phone-numbers/"
payload := strings.NewReader("{\n \"provider\": \"sip\",\n \"phone_number\": \"+14155552671\",\n \"sip_infra_region\": \"global\",\n \"friendly_name\": \"<string>\",\n \"sip_termination_uri\": \"<string>\",\n \"sip_trunk_username\": \"<string>\",\n \"sip_trunk_password\": \"<string>\",\n \"inbound_agent_id\": \"<string>\",\n \"outbound_agent_id\": \"<string>\",\n \"sip_infra_zones\": [\n \"<string>\"\n ],\n \"call_concurrency\": 1,\n \"max_concurrent_inbound_calls\": 1,\n \"max_concurrent_outbound_calls\": 1,\n \"expires\": 60,\n \"advanced\": {\n \"realm\": \"asterisk\",\n \"ip\": \"1.2.3.4/24\",\n \"prefix\": \"0\",\n \"register\": true\n }\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.verbex.ai/v1/phone-numbers/")
.header("Content-Type", "application/json")
.body("{\n \"provider\": \"sip\",\n \"phone_number\": \"+14155552671\",\n \"sip_infra_region\": \"global\",\n \"friendly_name\": \"<string>\",\n \"sip_termination_uri\": \"<string>\",\n \"sip_trunk_username\": \"<string>\",\n \"sip_trunk_password\": \"<string>\",\n \"inbound_agent_id\": \"<string>\",\n \"outbound_agent_id\": \"<string>\",\n \"sip_infra_zones\": [\n \"<string>\"\n ],\n \"call_concurrency\": 1,\n \"max_concurrent_inbound_calls\": 1,\n \"max_concurrent_outbound_calls\": 1,\n \"expires\": 60,\n \"advanced\": {\n \"realm\": \"asterisk\",\n \"ip\": \"1.2.3.4/24\",\n \"prefix\": \"0\",\n \"register\": true\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.verbex.ai/v1/phone-numbers/")
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 \"provider\": \"sip\",\n \"phone_number\": \"+14155552671\",\n \"sip_infra_region\": \"global\",\n \"friendly_name\": \"<string>\",\n \"sip_termination_uri\": \"<string>\",\n \"sip_trunk_username\": \"<string>\",\n \"sip_trunk_password\": \"<string>\",\n \"inbound_agent_id\": \"<string>\",\n \"outbound_agent_id\": \"<string>\",\n \"sip_infra_zones\": [\n \"<string>\"\n ],\n \"call_concurrency\": 1,\n \"max_concurrent_inbound_calls\": 1,\n \"max_concurrent_outbound_calls\": 1,\n \"expires\": 60,\n \"advanced\": {\n \"realm\": \"asterisk\",\n \"ip\": \"1.2.3.4/24\",\n \"prefix\": \"0\",\n \"register\": true\n }\n}"
response = http.request(request)
puts response.read_body{
"phone_number": "<string>",
"_id": "<string>",
"provider": "sip",
"friendly_name": "<string>",
"sip_termination_uri": "<string>",
"sip_trunk_username": "<string>",
"sip_trunk_password": "<string>",
"inbound_agent_id": "<string>",
"outbound_agent_id": "<string>",
"sip_infra_region": "<string>",
"sip_infra_zones": [
"<string>"
],
"call_concurrency": 2,
"max_concurrent_inbound_calls": 1,
"max_concurrent_outbound_calls": 1,
"expires": 2,
"advanced": {
"realm": "asterisk",
"ip": "1.2.3.4/24",
"prefix": "0",
"register": true
},
"availability_zones": [
"<string>"
],
"workspace_id": "<string>"
}
Phone Numbers
Create a new phone number
Import a phone number into the Verbex Platform through a SIP trunk.
Only Import Phone Numbers (SIP provider, "provider": "sip") are supported. Use this to connect numbers from any SIP trunk, including Twilio Elastic SIP Trunking.
The phone number is validated and registered. You can then associate it with AI agents to handle inbound and outbound calls.
Defaults applied when omitted: call_concurrency = 1, expires = 60.
POST
/
v1
/
phone-numbers
/
Create a new phone number
curl --request POST \
--url https://api.verbex.ai/v1/phone-numbers/ \
--header 'Content-Type: application/json' \
--data '
{
"provider": "sip",
"phone_number": "+14155552671",
"sip_infra_region": "global",
"friendly_name": "<string>",
"sip_termination_uri": "<string>",
"sip_trunk_username": "<string>",
"sip_trunk_password": "<string>",
"inbound_agent_id": "<string>",
"outbound_agent_id": "<string>",
"sip_infra_zones": [
"<string>"
],
"call_concurrency": 1,
"max_concurrent_inbound_calls": 1,
"max_concurrent_outbound_calls": 1,
"expires": 60,
"advanced": {
"realm": "asterisk",
"ip": "1.2.3.4/24",
"prefix": "0",
"register": true
}
}
'import requests
url = "https://api.verbex.ai/v1/phone-numbers/"
payload = {
"provider": "sip",
"phone_number": "+14155552671",
"sip_infra_region": "global",
"friendly_name": "<string>",
"sip_termination_uri": "<string>",
"sip_trunk_username": "<string>",
"sip_trunk_password": "<string>",
"inbound_agent_id": "<string>",
"outbound_agent_id": "<string>",
"sip_infra_zones": ["<string>"],
"call_concurrency": 1,
"max_concurrent_inbound_calls": 1,
"max_concurrent_outbound_calls": 1,
"expires": 60,
"advanced": {
"realm": "asterisk",
"ip": "1.2.3.4/24",
"prefix": "0",
"register": True
}
}
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({
provider: 'sip',
phone_number: '+14155552671',
sip_infra_region: 'global',
friendly_name: '<string>',
sip_termination_uri: '<string>',
sip_trunk_username: '<string>',
sip_trunk_password: '<string>',
inbound_agent_id: '<string>',
outbound_agent_id: '<string>',
sip_infra_zones: ['<string>'],
call_concurrency: 1,
max_concurrent_inbound_calls: 1,
max_concurrent_outbound_calls: 1,
expires: 60,
advanced: {realm: 'asterisk', ip: '1.2.3.4/24', prefix: '0', register: true}
})
};
fetch('https://api.verbex.ai/v1/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.verbex.ai/v1/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([
'provider' => 'sip',
'phone_number' => '+14155552671',
'sip_infra_region' => 'global',
'friendly_name' => '<string>',
'sip_termination_uri' => '<string>',
'sip_trunk_username' => '<string>',
'sip_trunk_password' => '<string>',
'inbound_agent_id' => '<string>',
'outbound_agent_id' => '<string>',
'sip_infra_zones' => [
'<string>'
],
'call_concurrency' => 1,
'max_concurrent_inbound_calls' => 1,
'max_concurrent_outbound_calls' => 1,
'expires' => 60,
'advanced' => [
'realm' => 'asterisk',
'ip' => '1.2.3.4/24',
'prefix' => '0',
'register' => true
]
]),
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.verbex.ai/v1/phone-numbers/"
payload := strings.NewReader("{\n \"provider\": \"sip\",\n \"phone_number\": \"+14155552671\",\n \"sip_infra_region\": \"global\",\n \"friendly_name\": \"<string>\",\n \"sip_termination_uri\": \"<string>\",\n \"sip_trunk_username\": \"<string>\",\n \"sip_trunk_password\": \"<string>\",\n \"inbound_agent_id\": \"<string>\",\n \"outbound_agent_id\": \"<string>\",\n \"sip_infra_zones\": [\n \"<string>\"\n ],\n \"call_concurrency\": 1,\n \"max_concurrent_inbound_calls\": 1,\n \"max_concurrent_outbound_calls\": 1,\n \"expires\": 60,\n \"advanced\": {\n \"realm\": \"asterisk\",\n \"ip\": \"1.2.3.4/24\",\n \"prefix\": \"0\",\n \"register\": true\n }\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.verbex.ai/v1/phone-numbers/")
.header("Content-Type", "application/json")
.body("{\n \"provider\": \"sip\",\n \"phone_number\": \"+14155552671\",\n \"sip_infra_region\": \"global\",\n \"friendly_name\": \"<string>\",\n \"sip_termination_uri\": \"<string>\",\n \"sip_trunk_username\": \"<string>\",\n \"sip_trunk_password\": \"<string>\",\n \"inbound_agent_id\": \"<string>\",\n \"outbound_agent_id\": \"<string>\",\n \"sip_infra_zones\": [\n \"<string>\"\n ],\n \"call_concurrency\": 1,\n \"max_concurrent_inbound_calls\": 1,\n \"max_concurrent_outbound_calls\": 1,\n \"expires\": 60,\n \"advanced\": {\n \"realm\": \"asterisk\",\n \"ip\": \"1.2.3.4/24\",\n \"prefix\": \"0\",\n \"register\": true\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.verbex.ai/v1/phone-numbers/")
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 \"provider\": \"sip\",\n \"phone_number\": \"+14155552671\",\n \"sip_infra_region\": \"global\",\n \"friendly_name\": \"<string>\",\n \"sip_termination_uri\": \"<string>\",\n \"sip_trunk_username\": \"<string>\",\n \"sip_trunk_password\": \"<string>\",\n \"inbound_agent_id\": \"<string>\",\n \"outbound_agent_id\": \"<string>\",\n \"sip_infra_zones\": [\n \"<string>\"\n ],\n \"call_concurrency\": 1,\n \"max_concurrent_inbound_calls\": 1,\n \"max_concurrent_outbound_calls\": 1,\n \"expires\": 60,\n \"advanced\": {\n \"realm\": \"asterisk\",\n \"ip\": \"1.2.3.4/24\",\n \"prefix\": \"0\",\n \"register\": true\n }\n}"
response = http.request(request)
puts response.read_body{
"phone_number": "<string>",
"_id": "<string>",
"provider": "sip",
"friendly_name": "<string>",
"sip_termination_uri": "<string>",
"sip_trunk_username": "<string>",
"sip_trunk_password": "<string>",
"inbound_agent_id": "<string>",
"outbound_agent_id": "<string>",
"sip_infra_region": "<string>",
"sip_infra_zones": [
"<string>"
],
"call_concurrency": 2,
"max_concurrent_inbound_calls": 1,
"max_concurrent_outbound_calls": 1,
"expires": 2,
"advanced": {
"realm": "asterisk",
"ip": "1.2.3.4/24",
"prefix": "0",
"register": true
},
"availability_zones": [
"<string>"
],
"workspace_id": "<string>"
}
Body
application/json
The infrastructure region for SIP routing. 'global' for worldwide routing, 'bd' for Bangladesh-specific routing, 'bd_link3' for Bangladesh Link3 IPTSP routing, 'distributed' for multi-zone routing. The regions available to you depend on your organization.
Available options:
global, bd, bd_link3, distributed Example:
"global"
Response
Phone number successfully registered

