Get Assistant Phone Numbers
curl --request GET \
--url https://api.example.com/api/v1/assistants/{assistant_id}/phone-numbers \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.example.com/api/v1/assistants/{assistant_id}/phone-numbers"
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/api/v1/assistants/{assistant_id}/phone-numbers', 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/api/v1/assistants/{assistant_id}/phone-numbers",
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/api/v1/assistants/{assistant_id}/phone-numbers"
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/api/v1/assistants/{assistant_id}/phone-numbers")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/assistants/{assistant_id}/phone-numbers")
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[
{}
]{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Assistant Phone Numbers
List Assigned Phone Numbers
Get all phone numbers assigned to a specific assistant.
Returns a list of phone numbers currently assigned to the assistant.
GET
/
api
/
v1
/
assistants
/
{assistant_id}
/
phone-numbers
Get Assistant Phone Numbers
curl --request GET \
--url https://api.example.com/api/v1/assistants/{assistant_id}/phone-numbers \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.example.com/api/v1/assistants/{assistant_id}/phone-numbers"
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/api/v1/assistants/{assistant_id}/phone-numbers', 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/api/v1/assistants/{assistant_id}/phone-numbers",
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/api/v1/assistants/{assistant_id}/phone-numbers"
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/api/v1/assistants/{assistant_id}/phone-numbers")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/assistants/{assistant_id}/phone-numbers")
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[
{}
]{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}This endpoint retrieves a list of all phone numbers currently assigned to a specific assistant. This is useful for seeing which numbers will route incoming calls to this assistant.
Path Parameters
assistant_id(string, required): The unique identifier of the assistant whose phone numbers you want to list.
Response
The response is a JSON array of phone number objects. Each object contains details about the assigned phone number.Response
[
{
"id": "pn_1a2b3c4d5e6f7g8h",
"phone_number": "+15551234567",
"assistant_id": "asst_a1b2c3d4e5f67890",
"organization_id": "org_67890",
"created_at": "2023-10-26T11:00:00Z",
"updated_at": "2023-10-26T11:00:00Z"
},
{
"id": "pn_9i8j7k6l5m4n3o2p",
"phone_number": "+15557654321",
"assistant_id": "asst_a1b2c3d4e5f67890",
"organization_id": "org_67890",
"created_at": "2023-10-27T12:30:00Z",
"updated_at": "2023-10-27T12:30:00Z"
}
]