List Available Phone Numbers
curl --request GET \
--url https://api.example.com/api/v1/assistants/organization/phone-numbers/available \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.example.com/api/v1/assistants/organization/phone-numbers/available"
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/available', 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/available",
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/available"
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/available")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/assistants/organization/phone-numbers/available")
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"
}
]Organization
List Available Phone Numbers
List phone numbers available for assignment (not assigned to any assistant).
GET
/
api
/
v1
/
assistants
/
organization
/
phone-numbers
/
available
List Available Phone Numbers
curl --request GET \
--url https://api.example.com/api/v1/assistants/organization/phone-numbers/available \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.example.com/api/v1/assistants/organization/phone-numbers/available"
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/available', 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/available",
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/available"
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/available")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/assistants/organization/phone-numbers/available")
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"
}
]This endpoint is a convenient way to retrieve a list of all phone numbers in your organization that are not currently assigned to an assistant. This is useful for finding numbers that are available to be linked to a new or existing assistant.
This endpoint takes no parameters.
Response
The response is a JSON array of phone number objects. Theassistant field for each object will be null.
Response
[
{
"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.
Response
200 - application/json
Successful Response
Show child attributes
Show child attributes
Minimal assistant info for phone number list.
Show child attributes
Show child attributes