Skip to main content
GET
/
sip-trunks
/
trunks
/
{trunk_id}
cURL
curl --request GET \
  --url https://api.bolna.ai/sip-trunks/trunks/{trunk_id} \
  --header 'Authorization: Bearer <token>'
import requests

url = "https://api.bolna.ai/sip-trunks/trunks/{trunk_id}"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.text)
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

fetch('https://api.bolna.ai/sip-trunks/trunks/{trunk_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.bolna.ai/sip-trunks/trunks/{trunk_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"net/http"
"io"
)

func main() {

url := "https://api.bolna.ai/sip-trunks/trunks/{trunk_id}"

req, _ := http.NewRequest("GET", url, nil)

req.Header.Add("Authorization", "Bearer <token>")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.get("https://api.bolna.ai/sip-trunks/trunks/{trunk_id}")
.header("Authorization", "Bearer <token>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.bolna.ai/sip-trunks/trunks/{trunk_id}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
{
  "id": "<string>",
  "name": "<string>",
  "provider": "<string>",
  "description": "<string>",
  "auth_username": "<string>",
  "gateways": [
    {
      "gateway_address": "sip.zadarma.com",
      "port": 5060,
      "priority": 1
    }
  ],
  "ip_identifiers": [
    {
      "ip_address": "15.207.90.192/31"
    }
  ],
  "phone_numbers": [
    {
      "id": "<string>",
      "phone_number": "<string>",
      "name": "<string>",
      "byot_trunk_id": "<string>",
      "telephony_provider": "sip-trunk",
      "deleted": true,
      "created_at": "2023-11-07T05:31:56Z",
      "updated_at": "2023-11-07T05:31:56Z"
    }
  ],
  "allow": "<string>",
  "disallow": "<string>",
  "direct_media": true,
  "rtp_symmetric": true,
  "force_rport": true,
  "media_encryption_optimistic": true,
  "qualify_frequency": 123,
  "inbound_enabled": true,
  "outbound_leading_plus_enabled": true,
  "is_active": true,
  "created_at": "2023-11-07T05:31:56Z",
  "updated_at": "2023-11-07T05:31:56Z"
}
{
"error": 123,
"message": "<string>"
}
SIP Trunking is currently in Beta.

Please reach out to us at enterprise@bolna.ai or schedule a call at https://www.bolna.ai/meet for more information and access.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

trunk_id
string
required

The unique trunk ID

Response

SIP trunk details

SIP trunk object returned by the API.

id
string

Unique SIP trunk identifier.

name
string

Human-readable trunk name.

provider
string

SIP provider name (e.g., twilio, plivo, zadarma, telnyx, vonage, custom).

description
string

Optional trunk description for internal reference.

auth_type
enum<string>

Authentication method used for this trunk.

Available options:
userpass,
ip-based
auth_username
string

SIP username (present only for userpass trunks).

gateways
object[]

Ordered list of SIP gateways used for registration and call routing.

ip_identifiers
object[]

IP ranges associated with this trunk (used only for ip-based authentication).

phone_numbers
object[]

Phone numbers (DIDs) registered on this trunk.

allow
string

Comma-separated codecs to allow.

disallow
string

Comma-separated codecs to disallow.

transport
enum<string>

SIP transport used by the trunk.

Available options:
transport-udp,
transport-tcp,
transport-tls
direct_media
boolean

Whether RTP is routed directly between endpoints (typically false).

rtp_symmetric
boolean

Enables symmetric RTP to handle NAT.

force_rport
boolean

Forces responses to the source port to handle NAT.

media_encryption
enum<string>

RTP encryption mode. "no" for plain RTP, "sdes" for SRTP via SDES (TLS trunks only).

Available options:
no,
sdes
media_encryption_optimistic
boolean

When media_encryption=sdes, whether to fall back to clear RTP if the carrier does not offer crypto.

qualify_frequency
integer

SIP OPTIONS ping interval in seconds.

inbound_enabled
boolean

Whether inbound calling is enabled.

outbound_leading_plus_enabled
boolean

Whether to prepend a leading + to outbound dialed numbers.

is_active
boolean

Whether the trunk is active.

created_at
string<date-time>

ISO timestamp when the trunk was created.

updated_at
string<date-time>

ISO timestamp when the trunk was last updated.