Get Phone Numbers
curl --request GET \
--url https://api.trillet.ai/v1/api/twilio/user-phone-numbers \
--header 'x-api-key: <api-key>' \
--header 'x-workspace-id: <x-workspace-id>'import requests
url = "https://api.trillet.ai/v1/api/twilio/user-phone-numbers"
headers = {
"x-workspace-id": "<x-workspace-id>",
"x-api-key": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'x-workspace-id': '<x-workspace-id>', 'x-api-key': '<api-key>'}
};
fetch('https://api.trillet.ai/v1/api/twilio/user-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.trillet.ai/v1/api/twilio/user-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 => [
"x-api-key: <api-key>",
"x-workspace-id: <x-workspace-id>"
],
]);
$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.trillet.ai/v1/api/twilio/user-phone-numbers"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-workspace-id", "<x-workspace-id>")
req.Header.Add("x-api-key", "<api-key>")
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.trillet.ai/v1/api/twilio/user-phone-numbers")
.header("x-workspace-id", "<x-workspace-id>")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.trillet.ai/v1/api/twilio/user-phone-numbers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-workspace-id"] = '<x-workspace-id>'
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"_id": "123abc456def789gh012i345jkl6789",
"workspaceId": "987xyz654abc321mno987pqr654stu",
"phoneNumber": "+12345678901",
"country": "US",
"type": "local",
"status": "released",
"recordingEnabled": true,
"pathwayId": "xyz123abc456",
"monthlyPrice": 19.99,
"expiresAt": "2025-12-31T11:59:59.999Z",
"transferEnabled": true,
"createdAt": "2025-01-01T00:00:00.000Z",
"updatedAt": "2025-01-10T15:30:00.000Z",
"agentId": "789xyz123abc456def",
"flowType": "outbound",
"messagePathwayId": "123abc456xyz789",
"omniFlowAgentId": "omni123flow456agent789"
}
Calls
Get Phone Numbers
Retrieve a list of phone numbers associated with the user.
GET
/
v1
/
api
/
twilio
/
user-phone-numbers
Get Phone Numbers
curl --request GET \
--url https://api.trillet.ai/v1/api/twilio/user-phone-numbers \
--header 'x-api-key: <api-key>' \
--header 'x-workspace-id: <x-workspace-id>'import requests
url = "https://api.trillet.ai/v1/api/twilio/user-phone-numbers"
headers = {
"x-workspace-id": "<x-workspace-id>",
"x-api-key": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'x-workspace-id': '<x-workspace-id>', 'x-api-key': '<api-key>'}
};
fetch('https://api.trillet.ai/v1/api/twilio/user-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.trillet.ai/v1/api/twilio/user-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 => [
"x-api-key: <api-key>",
"x-workspace-id: <x-workspace-id>"
],
]);
$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.trillet.ai/v1/api/twilio/user-phone-numbers"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-workspace-id", "<x-workspace-id>")
req.Header.Add("x-api-key", "<api-key>")
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.trillet.ai/v1/api/twilio/user-phone-numbers")
.header("x-workspace-id", "<x-workspace-id>")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.trillet.ai/v1/api/twilio/user-phone-numbers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-workspace-id"] = '<x-workspace-id>'
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"_id": "123abc456def789gh012i345jkl6789",
"workspaceId": "987xyz654abc321mno987pqr654stu",
"phoneNumber": "+12345678901",
"country": "US",
"type": "local",
"status": "released",
"recordingEnabled": true,
"pathwayId": "xyz123abc456",
"monthlyPrice": 19.99,
"expiresAt": "2025-12-31T11:59:59.999Z",
"transferEnabled": true,
"createdAt": "2025-01-01T00:00:00.000Z",
"updatedAt": "2025-01-10T15:30:00.000Z",
"agentId": "789xyz123abc456def",
"flowType": "outbound",
"messagePathwayId": "123abc456xyz789",
"omniFlowAgentId": "omni123flow456agent789"
}
Headers
Workspace identifier for the API.
Response Fields
An array of phone numbers associated with the user, in E.164 format.
Example Response
{
"_id": "123abc456def789gh012i345jkl6789",
"workspaceId": "987xyz654abc321mno987pqr654stu",
"phoneNumber": "+12345678901",
"country": "US",
"type": "local",
"status": "released",
"recordingEnabled": true,
"pathwayId": "xyz123abc456",
"monthlyPrice": 19.99,
"expiresAt": "2025-12-31T11:59:59.999Z",
"transferEnabled": true,
"createdAt": "2025-01-01T00:00:00.000Z",
"updatedAt": "2025-01-10T15:30:00.000Z",
"agentId": "789xyz123abc456def",
"flowType": "outbound",
"messagePathwayId": "123abc456xyz789",
"omniFlowAgentId": "omni123flow456agent789"
}
⌘I
