Skip to main content
GET
/
agents
/
{agent_id}
/
phone-numbers
/
{phone_number}
Get Phone Number
curl --request GET \
  --url https://api.example.com/agents/{agent_id}/phone-numbers/{phone_number} \
  --header 'Authorization: Bearer <token>'
import requests

url = "https://api.example.com/agents/{agent_id}/phone-numbers/{phone_number}"

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

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

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

fetch('https://api.example.com/agents/{agent_id}/phone-numbers/{phone_number}', 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.example.com/agents/{agent_id}/phone-numbers/{phone_number}",
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.example.com/agents/{agent_id}/phone-numbers/{phone_number}"

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.example.com/agents/{agent_id}/phone-numbers/{phone_number}")
.header("Authorization", "Bearer <token>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.example.com/agents/{agent_id}/phone-numbers/{phone_number}")

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
{
  "agent_id": "<string>",
  "phone_number": "<string>",
  "provider": "<string>",
  "sip_uri": "<string>",
  "dispatch_rule_id": "<string>",
  "outbound_enabled": true,
  "status": "<string>",
  "created_at": "<string>",
  "instructions": {},
  "outbound_trunk_id": "<string>",
  "outbound_address": "<string>",
  "provider_config": {},
  "room_pattern": "<string>",
  "livekit_sip_domain": "<string>",
  "inbound_addresses": [
    "<string>"
  ],
  "supported_providers": [
    {}
  ]
}
{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}

Authorizations

Authorization
string
header
required

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

Path Parameters

agent_id
string<uuid>
required
phone_number
string
required

Response

Successful Response

Response for phone number registration.

agent_id
string
required
phone_number
string
required
provider
string
required
sip_uri
string
required
dispatch_rule_id
string
required
outbound_enabled
boolean
required
status
string
required
created_at
string
required
instructions
Instructions · object
required
outbound_trunk_id
string | null

LiveKit outbound trunk ID if outbound is enabled

outbound_address
string | null

SIP address used for outbound calls (e.g., sip.telnyx.com)

provider_config
Provider Config · object | null
room_pattern
string | null

LiveKit room naming pattern for this agent's calls

livekit_sip_domain
string | null

LiveKit SIP domain for this deployment

inbound_addresses
string[] | null

LiveKit inbound SIP server addresses

supported_providers
Supported Providers · object[] | null

List of supported SIP providers with default addresses