Listar trunks SIP
curl --request GET \
--url https://suasofia.online/api/user/phone-numbers/sip-trunks \
--header 'Authorization: Bearer <token>'import requests
url = "https://suasofia.online/api/user/phone-numbers/sip-trunks"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://suasofia.online/api/user/phone-numbers/sip-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://suasofia.online/api/user/phone-numbers/sip-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: 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://suasofia.online/api/user/phone-numbers/sip-trunks"
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://suasofia.online/api/user/phone-numbers/sip-trunks")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://suasofia.online/api/user/phone-numbers/sip-trunks")
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{
"data": [
{
"id": 42,
"phone_number": "1000",
"nickname": "Provedor X — Principal",
"sip_username": "meuusuario",
"sip_address": "sip.provedor.com",
"sip_calling_format": "+e164",
"inbound_authorization_type": "auth",
"allowed_inbound_ips": null,
"outbound_proxy": false,
"country_code": "US",
"created_at": "2026-03-31T10:00:00.000000Z",
"updated_at": "2026-03-31T10:00:00.000000Z"
},
{
"id": 43,
"phone_number": "+14155551234",
"nickname": null,
"sip_username": "usuario_trunk",
"sip_address": "sip.provedor.com",
"sip_calling_format": "e164",
"inbound_authorization_type": "ip",
"allowed_inbound_ips": ["203.0.113.10", "198.51.100.20"],
"outbound_proxy": true,
"country_code": "US",
"created_at": "2026-03-31T11:00:00.000000Z",
"updated_at": "2026-03-31T11:00:00.000000Z"
}
]
}
SIP Trunks
Listar trunks SIP
Obter todos os trunks SIP pertencentes ao usuário autenticado
GET
/
user
/
phone-numbers
/
sip-trunks
Listar trunks SIP
curl --request GET \
--url https://suasofia.online/api/user/phone-numbers/sip-trunks \
--header 'Authorization: Bearer <token>'import requests
url = "https://suasofia.online/api/user/phone-numbers/sip-trunks"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://suasofia.online/api/user/phone-numbers/sip-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://suasofia.online/api/user/phone-numbers/sip-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: 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://suasofia.online/api/user/phone-numbers/sip-trunks"
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://suasofia.online/api/user/phone-numbers/sip-trunks")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://suasofia.online/api/user/phone-numbers/sip-trunks")
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{
"data": [
{
"id": 42,
"phone_number": "1000",
"nickname": "Provedor X — Principal",
"sip_username": "meuusuario",
"sip_address": "sip.provedor.com",
"sip_calling_format": "+e164",
"inbound_authorization_type": "auth",
"allowed_inbound_ips": null,
"outbound_proxy": false,
"country_code": "US",
"created_at": "2026-03-31T10:00:00.000000Z",
"updated_at": "2026-03-31T10:00:00.000000Z"
},
{
"id": 43,
"phone_number": "+14155551234",
"nickname": null,
"sip_username": "usuario_trunk",
"sip_address": "sip.provedor.com",
"sip_calling_format": "e164",
"inbound_authorization_type": "ip",
"allowed_inbound_ips": ["203.0.113.10", "198.51.100.20"],
"outbound_proxy": true,
"country_code": "US",
"created_at": "2026-03-31T11:00:00.000000Z",
"updated_at": "2026-03-31T11:00:00.000000Z"
}
]
}
Este endpoint retorna uma lista de todos os trunks SIP associados à sua conta.
Resposta
array
Array de objetos de trunks SIP
Show Propriedades do trunk SIP
Show Propriedades do trunk SIP
integer
O identificador único do trunk SIP
string
A extensão SIP ou número de telefone (DID) no formato E.164
string
Um rótulo curto e amigável para o trunk (ou
null se não estiver definido)string
O nome de usuário usado para autenticação SIP
string
O endereço do servidor SIP
string
O formato do número de chamada de saída:
+e164, e164 ou nationalstring
O método de autorização de entrada:
auth (nome de usuário/senha) ou ip (lista de IPs permitidos)array
Array de endereços IP permitidos para chamadas de entrada (apenas quando
inbound_authorization_type é ip)boolean
Se as chamadas de saída usam um endereço IP de proxy fixo
string
O código do país ISO 3166-2 onde o trunk SIP está localizado
string
Timestamp ISO 8601 de quando o trunk SIP foi criado
string
Timestamp ISO 8601 de quando o trunk SIP foi atualizado pela última vez
{
"data": [
{
"id": 42,
"phone_number": "1000",
"nickname": "Provedor X — Principal",
"sip_username": "meuusuario",
"sip_address": "sip.provedor.com",
"sip_calling_format": "+e164",
"inbound_authorization_type": "auth",
"allowed_inbound_ips": null,
"outbound_proxy": false,
"country_code": "US",
"created_at": "2026-03-31T10:00:00.000000Z",
"updated_at": "2026-03-31T10:00:00.000000Z"
},
{
"id": 43,
"phone_number": "+14155551234",
"nickname": null,
"sip_username": "usuario_trunk",
"sip_address": "sip.provedor.com",
"sip_calling_format": "e164",
"inbound_authorization_type": "ip",
"allowed_inbound_ips": ["203.0.113.10", "198.51.100.20"],
"outbound_proxy": true,
"country_code": "US",
"created_at": "2026-03-31T11:00:00.000000Z",
"updated_at": "2026-03-31T11:00:00.000000Z"
}
]
}

