Create a PBX extension connector
curl --request POST \
--url https://{subdomain}.mihu.ai/api/v1/pbx_extension_connectors \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"agent_uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"phone_number": "+12084439178",
"registrar_server": "sip.example.com",
"username_extension": "user-100",
"pbx_password": "<string>",
"allowed_ip": "192.168.1.100",
"setup_mode": "both",
"connection_type": "udp",
"port": 5060,
"auth_username": "<string>",
"auth_password": "<string>",
"normalizer": {
"default_prefix": "<string>",
"condition_length": "<string>",
"condition_prefix": "<string>"
}
}
'import requests
url = "https://{subdomain}.mihu.ai/api/v1/pbx_extension_connectors"
payload = {
"agent_uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"phone_number": "+12084439178",
"registrar_server": "sip.example.com",
"username_extension": "user-100",
"pbx_password": "<string>",
"allowed_ip": "192.168.1.100",
"setup_mode": "both",
"connection_type": "udp",
"port": 5060,
"auth_username": "<string>",
"auth_password": "<string>",
"normalizer": {
"default_prefix": "<string>",
"condition_length": "<string>",
"condition_prefix": "<string>"
}
}
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({
agent_uuid: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
phone_number: '+12084439178',
registrar_server: 'sip.example.com',
username_extension: 'user-100',
pbx_password: '<string>',
allowed_ip: '192.168.1.100',
setup_mode: 'both',
connection_type: 'udp',
port: 5060,
auth_username: '<string>',
auth_password: '<string>',
normalizer: {
default_prefix: '<string>',
condition_length: '<string>',
condition_prefix: '<string>'
}
})
};
fetch('https://{subdomain}.mihu.ai/api/v1/pbx_extension_connectors', 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://{subdomain}.mihu.ai/api/v1/pbx_extension_connectors",
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([
'agent_uuid' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'phone_number' => '+12084439178',
'registrar_server' => 'sip.example.com',
'username_extension' => 'user-100',
'pbx_password' => '<string>',
'allowed_ip' => '192.168.1.100',
'setup_mode' => 'both',
'connection_type' => 'udp',
'port' => 5060,
'auth_username' => '<string>',
'auth_password' => '<string>',
'normalizer' => [
'default_prefix' => '<string>',
'condition_length' => '<string>',
'condition_prefix' => '<string>'
]
]),
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://{subdomain}.mihu.ai/api/v1/pbx_extension_connectors"
payload := strings.NewReader("{\n \"agent_uuid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"phone_number\": \"+12084439178\",\n \"registrar_server\": \"sip.example.com\",\n \"username_extension\": \"user-100\",\n \"pbx_password\": \"<string>\",\n \"allowed_ip\": \"192.168.1.100\",\n \"setup_mode\": \"both\",\n \"connection_type\": \"udp\",\n \"port\": 5060,\n \"auth_username\": \"<string>\",\n \"auth_password\": \"<string>\",\n \"normalizer\": {\n \"default_prefix\": \"<string>\",\n \"condition_length\": \"<string>\",\n \"condition_prefix\": \"<string>\"\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://{subdomain}.mihu.ai/api/v1/pbx_extension_connectors")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"agent_uuid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"phone_number\": \"+12084439178\",\n \"registrar_server\": \"sip.example.com\",\n \"username_extension\": \"user-100\",\n \"pbx_password\": \"<string>\",\n \"allowed_ip\": \"192.168.1.100\",\n \"setup_mode\": \"both\",\n \"connection_type\": \"udp\",\n \"port\": 5060,\n \"auth_username\": \"<string>\",\n \"auth_password\": \"<string>\",\n \"normalizer\": {\n \"default_prefix\": \"<string>\",\n \"condition_length\": \"<string>\",\n \"condition_prefix\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{subdomain}.mihu.ai/api/v1/pbx_extension_connectors")
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 \"agent_uuid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"phone_number\": \"+12084439178\",\n \"registrar_server\": \"sip.example.com\",\n \"username_extension\": \"user-100\",\n \"pbx_password\": \"<string>\",\n \"allowed_ip\": \"192.168.1.100\",\n \"setup_mode\": \"both\",\n \"connection_type\": \"udp\",\n \"port\": 5060,\n \"auth_username\": \"<string>\",\n \"auth_password\": \"<string>\",\n \"normalizer\": {\n \"default_prefix\": \"<string>\",\n \"condition_length\": \"<string>\",\n \"condition_prefix\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"pbx_extension_connector_uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"phone_number": "<string>",
"agent_uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"agent_name": "<string>",
"sip_connector_server": "<string>",
"pbx": {
"registrar_server": "<string>",
"port": 123,
"username_extension": "<string>"
},
"inbound": {
"allowed_ip": "<string>"
},
"auth": {
"has_separate_credentials": true,
"username": "<string>"
},
"normalizer": {
"default_prefix": "<string>",
"condition_length": "<string>",
"condition_prefix": "<string>"
},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}PBX Extension Connectors
Create a PBX extension connector
Registers a PBX extension to an AI voice agent. This endpoint configures the PBX end only — it does not provision a SIP trunk. Use it when you want to connect a number purchased through this platform to your existing PBX extension; if you already have a SIP trunk from a provider, use the SIP trunk endpoints directly instead.
POST
/
api
/
v1
/
pbx_extension_connectors
Create a PBX extension connector
curl --request POST \
--url https://{subdomain}.mihu.ai/api/v1/pbx_extension_connectors \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"agent_uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"phone_number": "+12084439178",
"registrar_server": "sip.example.com",
"username_extension": "user-100",
"pbx_password": "<string>",
"allowed_ip": "192.168.1.100",
"setup_mode": "both",
"connection_type": "udp",
"port": 5060,
"auth_username": "<string>",
"auth_password": "<string>",
"normalizer": {
"default_prefix": "<string>",
"condition_length": "<string>",
"condition_prefix": "<string>"
}
}
'import requests
url = "https://{subdomain}.mihu.ai/api/v1/pbx_extension_connectors"
payload = {
"agent_uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"phone_number": "+12084439178",
"registrar_server": "sip.example.com",
"username_extension": "user-100",
"pbx_password": "<string>",
"allowed_ip": "192.168.1.100",
"setup_mode": "both",
"connection_type": "udp",
"port": 5060,
"auth_username": "<string>",
"auth_password": "<string>",
"normalizer": {
"default_prefix": "<string>",
"condition_length": "<string>",
"condition_prefix": "<string>"
}
}
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({
agent_uuid: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
phone_number: '+12084439178',
registrar_server: 'sip.example.com',
username_extension: 'user-100',
pbx_password: '<string>',
allowed_ip: '192.168.1.100',
setup_mode: 'both',
connection_type: 'udp',
port: 5060,
auth_username: '<string>',
auth_password: '<string>',
normalizer: {
default_prefix: '<string>',
condition_length: '<string>',
condition_prefix: '<string>'
}
})
};
fetch('https://{subdomain}.mihu.ai/api/v1/pbx_extension_connectors', 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://{subdomain}.mihu.ai/api/v1/pbx_extension_connectors",
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([
'agent_uuid' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'phone_number' => '+12084439178',
'registrar_server' => 'sip.example.com',
'username_extension' => 'user-100',
'pbx_password' => '<string>',
'allowed_ip' => '192.168.1.100',
'setup_mode' => 'both',
'connection_type' => 'udp',
'port' => 5060,
'auth_username' => '<string>',
'auth_password' => '<string>',
'normalizer' => [
'default_prefix' => '<string>',
'condition_length' => '<string>',
'condition_prefix' => '<string>'
]
]),
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://{subdomain}.mihu.ai/api/v1/pbx_extension_connectors"
payload := strings.NewReader("{\n \"agent_uuid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"phone_number\": \"+12084439178\",\n \"registrar_server\": \"sip.example.com\",\n \"username_extension\": \"user-100\",\n \"pbx_password\": \"<string>\",\n \"allowed_ip\": \"192.168.1.100\",\n \"setup_mode\": \"both\",\n \"connection_type\": \"udp\",\n \"port\": 5060,\n \"auth_username\": \"<string>\",\n \"auth_password\": \"<string>\",\n \"normalizer\": {\n \"default_prefix\": \"<string>\",\n \"condition_length\": \"<string>\",\n \"condition_prefix\": \"<string>\"\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://{subdomain}.mihu.ai/api/v1/pbx_extension_connectors")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"agent_uuid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"phone_number\": \"+12084439178\",\n \"registrar_server\": \"sip.example.com\",\n \"username_extension\": \"user-100\",\n \"pbx_password\": \"<string>\",\n \"allowed_ip\": \"192.168.1.100\",\n \"setup_mode\": \"both\",\n \"connection_type\": \"udp\",\n \"port\": 5060,\n \"auth_username\": \"<string>\",\n \"auth_password\": \"<string>\",\n \"normalizer\": {\n \"default_prefix\": \"<string>\",\n \"condition_length\": \"<string>\",\n \"condition_prefix\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{subdomain}.mihu.ai/api/v1/pbx_extension_connectors")
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 \"agent_uuid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"phone_number\": \"+12084439178\",\n \"registrar_server\": \"sip.example.com\",\n \"username_extension\": \"user-100\",\n \"pbx_password\": \"<string>\",\n \"allowed_ip\": \"192.168.1.100\",\n \"setup_mode\": \"both\",\n \"connection_type\": \"udp\",\n \"port\": 5060,\n \"auth_username\": \"<string>\",\n \"auth_password\": \"<string>\",\n \"normalizer\": {\n \"default_prefix\": \"<string>\",\n \"condition_length\": \"<string>\",\n \"condition_prefix\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"pbx_extension_connector_uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"phone_number": "<string>",
"agent_uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"agent_name": "<string>",
"sip_connector_server": "<string>",
"pbx": {
"registrar_server": "<string>",
"port": 123,
"username_extension": "<string>"
},
"inbound": {
"allowed_ip": "<string>"
},
"auth": {
"has_separate_credentials": true,
"username": "<string>"
},
"normalizer": {
"default_prefix": "<string>",
"condition_length": "<string>",
"condition_prefix": "<string>"
},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}Authorizations
Use a Bearer token to access these API endpoints. Example: "Bearer {your-token}"
Body
application/json
Example:
"+12084439178"
Example:
"sip.example.com"
Example:
"user-100"
Example:
"192.168.1.100"
Available options:
both, inbound, outbound Available options:
udp, tls Show child attributes
Show child attributes
⌘I