curl --request PATCH \
--url https://api.example.com/v1/phone-numbers/{phone_number_id} \
--header 'Content-Type: application/json' \
--data '
{
"friendly_name": "<string>",
"inbound_agent_id": "<string>",
"outbound_agent_id": "<string>",
"sip_termination_uri": "<string>",
"sip_trunk_username": "<string>",
"sip_trunk_password": "<string>"
}
'import requests
url = "https://api.example.com/v1/phone-numbers/{phone_number_id}"
payload = {
"friendly_name": "<string>",
"inbound_agent_id": "<string>",
"outbound_agent_id": "<string>",
"sip_termination_uri": "<string>",
"sip_trunk_username": "<string>",
"sip_trunk_password": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
friendly_name: '<string>',
inbound_agent_id: '<string>',
outbound_agent_id: '<string>',
sip_termination_uri: '<string>',
sip_trunk_username: '<string>',
sip_trunk_password: '<string>'
})
};
fetch('https://api.example.com/v1/phone-numbers/{phone_number_id}', 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.example.com/v1/phone-numbers/{phone_number_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'friendly_name' => '<string>',
'inbound_agent_id' => '<string>',
'outbound_agent_id' => '<string>',
'sip_termination_uri' => '<string>',
'sip_trunk_username' => '<string>',
'sip_trunk_password' => '<string>'
]),
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.example.com/v1/phone-numbers/{phone_number_id}"
payload := strings.NewReader("{\n \"friendly_name\": \"<string>\",\n \"inbound_agent_id\": \"<string>\",\n \"outbound_agent_id\": \"<string>\",\n \"sip_termination_uri\": \"<string>\",\n \"sip_trunk_username\": \"<string>\",\n \"sip_trunk_password\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.example.com/v1/phone-numbers/{phone_number_id}")
.header("Content-Type", "application/json")
.body("{\n \"friendly_name\": \"<string>\",\n \"inbound_agent_id\": \"<string>\",\n \"outbound_agent_id\": \"<string>\",\n \"sip_termination_uri\": \"<string>\",\n \"sip_trunk_username\": \"<string>\",\n \"sip_trunk_password\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/phone-numbers/{phone_number_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"friendly_name\": \"<string>\",\n \"inbound_agent_id\": \"<string>\",\n \"outbound_agent_id\": \"<string>\",\n \"sip_termination_uri\": \"<string>\",\n \"sip_trunk_username\": \"<string>\",\n \"sip_trunk_password\": \"<string>\"\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": "global"
}{
"error": "<string>",
"message": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}{
"error": "<string>",
"message": "<string>"
}Update the configuration of an existing phone number
Update the configuration of an existing phone number. This endpoint allows you to:
- Modify the AI agent association
- Update SIP trunk settings for Import Phone Numbers
- Adjust routing rules and call handling preferences
- Update metadata and labels
curl --request PATCH \
--url https://api.example.com/v1/phone-numbers/{phone_number_id} \
--header 'Content-Type: application/json' \
--data '
{
"friendly_name": "<string>",
"inbound_agent_id": "<string>",
"outbound_agent_id": "<string>",
"sip_termination_uri": "<string>",
"sip_trunk_username": "<string>",
"sip_trunk_password": "<string>"
}
'import requests
url = "https://api.example.com/v1/phone-numbers/{phone_number_id}"
payload = {
"friendly_name": "<string>",
"inbound_agent_id": "<string>",
"outbound_agent_id": "<string>",
"sip_termination_uri": "<string>",
"sip_trunk_username": "<string>",
"sip_trunk_password": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
friendly_name: '<string>',
inbound_agent_id: '<string>',
outbound_agent_id: '<string>',
sip_termination_uri: '<string>',
sip_trunk_username: '<string>',
sip_trunk_password: '<string>'
})
};
fetch('https://api.example.com/v1/phone-numbers/{phone_number_id}', 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.example.com/v1/phone-numbers/{phone_number_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'friendly_name' => '<string>',
'inbound_agent_id' => '<string>',
'outbound_agent_id' => '<string>',
'sip_termination_uri' => '<string>',
'sip_trunk_username' => '<string>',
'sip_trunk_password' => '<string>'
]),
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.example.com/v1/phone-numbers/{phone_number_id}"
payload := strings.NewReader("{\n \"friendly_name\": \"<string>\",\n \"inbound_agent_id\": \"<string>\",\n \"outbound_agent_id\": \"<string>\",\n \"sip_termination_uri\": \"<string>\",\n \"sip_trunk_username\": \"<string>\",\n \"sip_trunk_password\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.example.com/v1/phone-numbers/{phone_number_id}")
.header("Content-Type", "application/json")
.body("{\n \"friendly_name\": \"<string>\",\n \"inbound_agent_id\": \"<string>\",\n \"outbound_agent_id\": \"<string>\",\n \"sip_termination_uri\": \"<string>\",\n \"sip_trunk_username\": \"<string>\",\n \"sip_trunk_password\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/phone-numbers/{phone_number_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"friendly_name\": \"<string>\",\n \"inbound_agent_id\": \"<string>\",\n \"outbound_agent_id\": \"<string>\",\n \"sip_termination_uri\": \"<string>\",\n \"sip_trunk_username\": \"<string>\",\n \"sip_trunk_password\": \"<string>\"\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": "global"
}{
"error": "<string>",
"message": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}{
"error": "<string>",
"message": "<string>"
}Path Parameters
Body
- UpdateSIPPhoneNumberRequest
- UpdatePiaPhoneNumberRequest
- UpdateTwilioPhoneNumberRequest
A human-readable label for this phone number to help identify its purpose
ID of the AI agent that will handle incoming calls to this number
ID of the AI agent that will be used when making outbound calls from this number
The SIP URI where calls to this Import Phone Number should be terminated
Username for authenticating with the SIP trunk provider
Password for authenticating with the SIP trunk provider
Response
Successful Response
- GetSIPPhoneNumberResponse
- GetPiaPhoneNumberResponse
- GetTwilioPhoneNumberResponse
The phone number in E.164 format, including country code (e.g., +14155552671)
Unique identifier for this phone number record
Indicates this is an Import Phone Number (SIP provider)
"sip"A human-readable label for this phone number
The SIP URI where calls are terminated
Username for SIP trunk authentication
Password for SIP trunk authentication
ID of the AI agent handling incoming calls
ID of the AI agent used for outbound calls
The infrastructure region for SIP routing: 'global' or 'bd' (Bangladesh)
global, bd, bd_link3 
