SIP trunks
List SIP trunk calls API
List recent inbound and outbound calls on a SIP trunk’s numbers via GET /trunk/trunks//calls, with outcome and SIP code.
GET
/
trunk
/
trunks
/
{trunk_id}
/
calls
cURL
curl --request GET \
--url https://api.bolna.ai/trunk/trunks/{trunk_id}/calls \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.bolna.ai/trunk/trunks/{trunk_id}/calls"
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/trunk/trunks/{trunk_id}/calls', 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/trunk/trunks/{trunk_id}/calls",
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/trunk/trunks/{trunk_id}/calls"
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/trunk/trunks/{trunk_id}/calls")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bolna.ai/trunk/trunks/{trunk_id}/calls")
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{
"calls": [
{
"execution_id": "4c1e7a9b-2d3f-4a5b-8c6d-7e8f9a0b1c2d",
"started_at": "2026-10-16T10:02:11.904512+00:00",
"direction": "inbound",
"number": "+12025550178",
"duration_s": 143,
"outcome": "completed",
"sip_code": null,
"sip_cause": "NORMAL_CLEARING"
},
{
"execution_id": "9a8b7c6d-5e4f-4a3b-9c2d-1e0f9a8b7c6d",
"started_at": "2026-10-16T09:55:40.118204+00:00",
"direction": "outbound",
"number": "+12025550191",
"duration_s": 0,
"outcome": "busy",
"sip_code": 486,
"sip_cause": "USER_BUSY"
}
]
}{
"message": "trunk_numbers:+12025550143"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
The trunk's id
Query Parameters
failed returns inbound and outbound calls that ended no-answer, busy, failed, error or canceled.
Available options:
all, inbound, outbound, failed Maximum number of calls to return. Values above 100 return 100.
Required range:
x >= 1Only calls on this one number, given exactly as the number's e164. URL-encode the plus as %2B.
Response
Recent calls
Show child attributes
Show child attributes
Was this page helpful?
⌘I
cURL
curl --request GET \
--url https://api.bolna.ai/trunk/trunks/{trunk_id}/calls \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.bolna.ai/trunk/trunks/{trunk_id}/calls"
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/trunk/trunks/{trunk_id}/calls', 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/trunk/trunks/{trunk_id}/calls",
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/trunk/trunks/{trunk_id}/calls"
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/trunk/trunks/{trunk_id}/calls")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bolna.ai/trunk/trunks/{trunk_id}/calls")
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{
"calls": [
{
"execution_id": "4c1e7a9b-2d3f-4a5b-8c6d-7e8f9a0b1c2d",
"started_at": "2026-10-16T10:02:11.904512+00:00",
"direction": "inbound",
"number": "+12025550178",
"duration_s": 143,
"outcome": "completed",
"sip_code": null,
"sip_cause": "NORMAL_CLEARING"
},
{
"execution_id": "9a8b7c6d-5e4f-4a3b-9c2d-1e0f9a8b7c6d",
"started_at": "2026-10-16T09:55:40.118204+00:00",
"direction": "outbound",
"number": "+12025550191",
"duration_s": 0,
"outcome": "busy",
"sip_code": 486,
"sip_cause": "USER_BUSY"
}
]
}{
"message": "trunk_numbers:+12025550143"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}
