Trunks
List Trunks
List your organization’s SIP trunks
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
| Name | Type | Required | Description |
|---|---|---|---|
| Authorization | string | Yes | Token <your-api-key> |
| Org-Handle | string | Yes | Organization domain handle |
Trunk object fields
| Field | Type | Description |
|---|---|---|
| id | integer | Trunk id (use in attach / detach / delete) |
| name | string | Display name |
| sip_url | string | Carrier SIP URL / host |
| transport | string | tcp, udp, or tls |
| port | string | SIP port (default 5060) |
| auth_username | string | SIP auth username (nullable) |
| auth_password | string | Masked - only the last 4 chars shown |
| allowed_ips | string | Comma-separated source-IP allow-list |
| active | boolean | Whether the trunk is active |
| org_handle | string | Owning 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>"
Was this page helpful?
⌘I
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"
}
]
}