Update Advanced Config
curl --request PATCH \
--url https://api.bland.ai/v1/sip/config \
--header 'Content-Type: application/json' \
--header 'authorization: <authorization>' \
--data '
{
"phone_number": "<string>",
"direction": "<string>",
"failover_config": {},
"codec_config": {},
"alert_config": {}
}
'import requests
url = "https://api.bland.ai/v1/sip/config"
payload = {
"phone_number": "<string>",
"direction": "<string>",
"failover_config": {},
"codec_config": {},
"alert_config": {}
}
headers = {
"authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({
phone_number: '<string>',
direction: '<string>',
failover_config: {},
codec_config: {},
alert_config: {}
})
};
fetch('https://api.bland.ai/v1/sip/config', 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.bland.ai/v1/sip/config",
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([
'phone_number' => '<string>',
'direction' => '<string>',
'failover_config' => [
],
'codec_config' => [
],
'alert_config' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"authorization: <authorization>"
],
]);
$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.bland.ai/v1/sip/config"
payload := strings.NewReader("{\n \"phone_number\": \"<string>\",\n \"direction\": \"<string>\",\n \"failover_config\": {},\n \"codec_config\": {},\n \"alert_config\": {}\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("authorization", "<authorization>")
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.bland.ai/v1/sip/config")
.header("authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"phone_number\": \"<string>\",\n \"direction\": \"<string>\",\n \"failover_config\": {},\n \"codec_config\": {},\n \"alert_config\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bland.ai/v1/sip/config")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"phone_number\": \"<string>\",\n \"direction\": \"<string>\",\n \"failover_config\": {},\n \"codec_config\": {},\n \"alert_config\": {}\n}"
response = http.request(request)
puts response.read_bodySIP Trunks
Update Advanced Config
Update advanced SIP configuration including failover, codecs, and alerts.
PATCH
/
v1
/
sip
/
config
Update Advanced Config
curl --request PATCH \
--url https://api.bland.ai/v1/sip/config \
--header 'Content-Type: application/json' \
--header 'authorization: <authorization>' \
--data '
{
"phone_number": "<string>",
"direction": "<string>",
"failover_config": {},
"codec_config": {},
"alert_config": {}
}
'import requests
url = "https://api.bland.ai/v1/sip/config"
payload = {
"phone_number": "<string>",
"direction": "<string>",
"failover_config": {},
"codec_config": {},
"alert_config": {}
}
headers = {
"authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({
phone_number: '<string>',
direction: '<string>',
failover_config: {},
codec_config: {},
alert_config: {}
})
};
fetch('https://api.bland.ai/v1/sip/config', 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.bland.ai/v1/sip/config",
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([
'phone_number' => '<string>',
'direction' => '<string>',
'failover_config' => [
],
'codec_config' => [
],
'alert_config' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"authorization: <authorization>"
],
]);
$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.bland.ai/v1/sip/config"
payload := strings.NewReader("{\n \"phone_number\": \"<string>\",\n \"direction\": \"<string>\",\n \"failover_config\": {},\n \"codec_config\": {},\n \"alert_config\": {}\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("authorization", "<authorization>")
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.bland.ai/v1/sip/config")
.header("authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"phone_number\": \"<string>\",\n \"direction\": \"<string>\",\n \"failover_config\": {},\n \"codec_config\": {},\n \"alert_config\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bland.ai/v1/sip/config")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"phone_number\": \"<string>\",\n \"direction\": \"<string>\",\n \"failover_config\": {},\n \"codec_config\": {},\n \"alert_config\": {}\n}"
response = http.request(request)
puts response.read_bodyHeaders
string
required
Your API key for authentication.
Body
string
required
The phone number to update configuration for. Must be in E.164 format.
string
required
The direction to update:
"inbound" or "outbound".object
Failover configuration:
enabled(boolean) — Enable/disable failoverendpoints(array) — Failover SIP servers, each withhost,port,transport, andprioritytriggers(array) — Conditions that trigger failover:"unreachable","auth_failure","timeout"failback(string) —"auto"or"manual"
object
Codec configuration:
codecs(array) — Ordered list of codec names:"PCMU","PCMA","G.729","Opus","G.722"transcode(boolean) — Enable transcoding between codecs
object
Alert configuration:
enabled(boolean) — Enable/disable alertsthresholds—unreachable_minutes(number),failure_rate_percent(number),failure_rate_window_minutes(number),response_time_ms(number)channels—email(boolean),sms(boolean),webhook(string, URL)
Example Request
curl -X PATCH https://api.bland.ai/v1/sip/config \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"phone_number": "+14150000000",
"direction": "outbound",
"failover_config": {
"enabled": true,
"endpoints": [
{ "host": "backup1.sip.provider.com", "port": 5061, "transport": "tls", "priority": 1 },
{ "host": "backup2.sip.provider.com", "port": 5061, "transport": "tls", "priority": 2 }
],
"triggers": ["unreachable", "timeout"],
"failback": "auto"
},
"codec_config": {
"codecs": ["PCMU", "PCMA", "Opus"],
"transcode": true
},
"alert_config": {
"enabled": true,
"thresholds": {
"unreachable_minutes": 5,
"failure_rate_percent": 20,
"failure_rate_window_minutes": 30,
"response_time_ms": 500
},
"channels": {
"email": true,
"sms": false,
"webhook": "https://hooks.example.com/sip-alerts"
}
}
}'
Docs for agents: llms.txt
Was this page helpful?
⌘I