List Organization Phone Numbers
curl --request GET \
--url https://api.example.com/api/v1/assistants/organization/phone-numbers \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.example.com/api/v1/assistants/organization/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/organization/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/organization/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/organization/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/organization/phone-numbers")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/assistants/organization/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[
{
"id": 123,
"phone_number": "<string>",
"twilio_sid": "<string>",
"is_active": true,
"capabilities": {},
"created_at": "2023-11-07T05:31:56Z",
"friendly_name": "<string>",
"assistant": {
"id": 123,
"name": "<string>",
"is_active": true
},
"updated_at": "2023-11-07T05:31:56Z"
}
]{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Organization
List Organization Phone Numbers
List all phone numbers in your organization.
Returns phone numbers with their assignment status and assistant information.
GET
/
api
/
v1
/
assistants
/
organization
/
phone-numbers
List Organization Phone Numbers
curl --request GET \
--url https://api.example.com/api/v1/assistants/organization/phone-numbers \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.example.com/api/v1/assistants/organization/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/organization/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/organization/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/organization/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/organization/phone-numbers")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/assistants/organization/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[
{
"id": 123,
"phone_number": "<string>",
"twilio_sid": "<string>",
"is_active": true,
"capabilities": {},
"created_at": "2023-11-07T05:31:56Z",
"friendly_name": "<string>",
"assistant": {
"id": 123,
"name": "<string>",
"is_active": true
},
"updated_at": "2023-11-07T05:31:56Z"
}
]{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}This endpoint retrieves a list of all phone numbers belonging to your organization. It includes information about each number’s assignment status.
Query Parameters
include_assigned(boolean, optional, default: true): Set tofalseto exclude numbers that are currently assigned to an assistant.include_unassigned(boolean, optional, default: true): Set tofalseto exclude numbers that are not currently assigned to any assistant.
Response
The response is a JSON array of phone number objects. If a number is assigned, theassistant field will contain details about the assistant it’s linked to.
Response
[
{
"id": 1,
"phone_number": "+15551234567",
"friendly_name": "Main Support Line",
"twilio_sid": "PNxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"is_active": true,
"capabilities": { "voice": true, "sms": true, "mms": true },
"assistant": {
"id": 123,
"name": "Customer Service Bot",
"is_active": true
},
"created_at": "2023-10-01T10:00:00Z",
"updated_at": "2023-10-26T11:00:00Z"
},
{
"id": 2,
"phone_number": "+15557654321",
"friendly_name": "Sales Department",
"twilio_sid": "PNyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy",
"is_active": true,
"capabilities": { "voice": true, "sms": false, "mms": false },
"assistant": null,
"created_at": "2023-10-02T12:00:00Z",
"updated_at": null
}
]
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Query Parameters
Include phone numbers assigned to assistants
Include unassigned phone numbers
Response
Successful Response
Show child attributes
Show child attributes
Minimal assistant info for phone number list.
Show child attributes
Show child attributes