List phone numbers
curl --request GET \
--url https://api.lehar.ai/ca/api/v0/phone-numbers \
--header 'X-API-KEY: <api-key>'import requests
url = "https://api.lehar.ai/ca/api/v0/phone-numbers"
headers = {"X-API-KEY": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-KEY': '<api-key>'}};
fetch('https://api.lehar.ai/ca/api/v0/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.lehar.ai/ca/api/v0/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>"
],
]);
$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.lehar.ai/ca/api/v0/phone-numbers"
req, _ := http.NewRequest("GET", url, nil)
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.lehar.ai/ca/api/v0/phone-numbers")
.header("X-API-KEY", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.lehar.ai/ca/api/v0/phone-numbers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-KEY"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": [
{
"id": "pn_a1b2c3d4",
"number": "+919876543210",
"display_name": "Sales line",
"source": "byo_trunk",
"sip_trunk_id": "trunk_x1y2z3",
"sip_trunk_name": "Acme SIP",
"status": "active",
"outbound_enabled": true,
"inbound_enabled": false,
"inbound_agent_id": null,
"provider": "acme-telecom",
"metadata": {},
"created_at": "2026-09-01T12:00:00Z",
"updated_at": "2026-09-01T12:00:00Z"
}
],
"pagination": {
"limit": 20,
"offset": 0,
"total": 1
},
"shared_caller_id": "+911234561989"
}{
"error": {
"code": "invalid_request",
"message": "customer_id is required for phone number APIs. Use a customer-scoped user or send X-Customer-ID with a platform bearer token."
}
}{
"error": {
"code": "unauthorized",
"message": "Authentication required"
}
}{
"error": {
"code": "forbidden",
"message": "Scope 'phone_numbers:read' is required"
}
}{
"error": {
"code": "not_found",
"message": "Customer not found"
}
}Phone Numbers
List phone numbers
List the workspace’s registered phone numbers (BYON inventory), optionally filtered by status and source. Archived rows are hidden unless status=archived is passed. Scope phone_numbers:read.
GET
/
phone-numbers
List phone numbers
curl --request GET \
--url https://api.lehar.ai/ca/api/v0/phone-numbers \
--header 'X-API-KEY: <api-key>'import requests
url = "https://api.lehar.ai/ca/api/v0/phone-numbers"
headers = {"X-API-KEY": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-KEY': '<api-key>'}};
fetch('https://api.lehar.ai/ca/api/v0/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.lehar.ai/ca/api/v0/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>"
],
]);
$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.lehar.ai/ca/api/v0/phone-numbers"
req, _ := http.NewRequest("GET", url, nil)
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.lehar.ai/ca/api/v0/phone-numbers")
.header("X-API-KEY", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.lehar.ai/ca/api/v0/phone-numbers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-KEY"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": [
{
"id": "pn_a1b2c3d4",
"number": "+919876543210",
"display_name": "Sales line",
"source": "byo_trunk",
"sip_trunk_id": "trunk_x1y2z3",
"sip_trunk_name": "Acme SIP",
"status": "active",
"outbound_enabled": true,
"inbound_enabled": false,
"inbound_agent_id": null,
"provider": "acme-telecom",
"metadata": {},
"created_at": "2026-09-01T12:00:00Z",
"updated_at": "2026-09-01T12:00:00Z"
}
],
"pagination": {
"limit": 20,
"offset": 0,
"total": 1
},
"shared_caller_id": "+911234561989"
}{
"error": {
"code": "invalid_request",
"message": "customer_id is required for phone number APIs. Use a customer-scoped user or send X-Customer-ID with a platform bearer token."
}
}{
"error": {
"code": "unauthorized",
"message": "Authentication required"
}
}{
"error": {
"code": "forbidden",
"message": "Scope 'phone_numbers:read' is required"
}
}{
"error": {
"code": "not_found",
"message": "Customer not found"
}
}Authorizations
ApiKeyAuthBearerAuth
Query Parameters
Maximum rows to return.
Required range:
0 <= x <= 100Number of rows to skip.
Required range:
x >= 0Filter by lifecycle status. When omitted, archived numbers are excluded; pass archived to see them.
Available options:
pending_verification, provisioning, active, failed, archived Filter by registration source.
Available options:
managed, byo_trunk, hosted Response
Paginated list of phone numbers. shared_caller_id is the caller ID presented for the shared "Platform default" number (null when unset).

