Skip to main content
GET
/
api
/
v2
/
platform
/
telephony
/
trunks
/
List Trunks
curl --request GET \
  --url https://unpod.ai/api/v2/platform/telephony/trunks/ \
  --header 'Authorization: <api-key>' \
  --header 'Org-Handle: <org-handle>'
import requests

url = "https://unpod.ai/api/v2/platform/telephony/trunks/"

headers = {
"Org-Handle": "<org-handle>",
"Authorization": "<api-key>"
}

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

print(response.text)
const options = {
method: 'GET',
headers: {'Org-Handle': '<org-handle>', Authorization: '<api-key>'}
};

fetch('https://unpod.ai/api/v2/platform/telephony/trunks/', 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://unpod.ai/api/v2/platform/telephony/trunks/",
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: <api-key>",
"Org-Handle: <org-handle>"
],
]);

$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://unpod.ai/api/v2/platform/telephony/trunks/"

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

req.Header.Add("Org-Handle", "<org-handle>")
req.Header.Add("Authorization", "<api-key>")

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

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

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.get("https://unpod.ai/api/v2/platform/telephony/trunks/")
.header("Org-Handle", "<org-handle>")
.header("Authorization", "<api-key>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://unpod.ai/api/v2/platform/telephony/trunks/")

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

request = Net::HTTP::Get.new(url)
request["Org-Handle"] = '<org-handle>'
request["Authorization"] = '<api-key>'

response = http.request(request)
puts response.read_body
{
  "status_code": 200,
  "message": "Trunks fetched successfully.",
  "data": [
    {
      "id": 12,
      "name": "Acme Primary Trunk",
      "sip_url": "sip:sip.acme-voice.com",
      "transport": "tcp",
      "port": "5060",
      "auth_username": null,
      "auth_password": null,
      "allowed_ips": "",
      "active": true,
      "org_handle": "acme.co"
    }
  ]
}
List the SIP trunks (carrier credentials) owned by your organization, newest first. Secrets (auth_password) are masked in the response.
Prerequisites: API Token + Org-Handle. See Authentication.

Headers

NameTypeRequiredDescription
AuthorizationstringYesToken <your-api-key>
Org-HandlestringYesOrganization domain handle

Trunk object fields

FieldTypeDescription
idintegerTrunk id (use in attach / detach / delete)
namestringDisplay name
sip_urlstringCarrier SIP URL / host
transportstringtcp, udp, or tls
portstringSIP port (default 5060)
auth_usernamestringSIP auth username (nullable)
auth_passwordstringMasked - only the last 4 chars shown
allowed_ipsstringComma-separated source-IP allow-list
activebooleanWhether the trunk is active
org_handlestringOwning organization handle
{
  "status_code": 200,
  "message": "Trunks fetched successfully.",
  "data": [
    {
      "id": 12,
      "name": "Acme Primary Trunk",
      "sip_url": "sip:sip.acme-voice.com",
      "transport": "tcp",
      "port": "5060",
      "auth_username": null,
      "auth_password": null,
      "allowed_ips": "",
      "active": true,
      "org_handle": "acme.co"
    }
  ]
}
cURL
curl -s "https://unpod.ai/api/v2/platform/telephony/trunks/" \
  -H "Authorization: Token <your-api-key>" \
  -H "Org-Handle: <your-org-handle>"

Authorizations

Authorization
string
header
required

Format: Token

Headers

Org-Handle
string
required

Organization domain handle

Example:

"unpod.tv"

Response

List of the organization's SIP trunks (secrets masked)