Skip to main content
GET
/
phone
List All Phone Numbers
curl --request GET \
  --url https://server.sellagent.ai/api/phone \
  --header 'Content-Type: <content-type>' \
  --header 'x-api-key: <x-api-key>'
import requests

url = "https://server.sellagent.ai/api/phone"

headers = {
"x-api-key": "<x-api-key>",
"Content-Type": "<content-type>"
}

response = requests.get(url, headers=headers)

print(response.text)
const options = {
method: 'GET',
headers: {'x-api-key': '<x-api-key>', 'Content-Type': '<content-type>'}
};

fetch('https://server.sellagent.ai/api/phone', 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://server.sellagent.ai/api/phone",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Content-Type: <content-type>",
"x-api-key: <x-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://server.sellagent.ai/api/phone"

req, _ := http.NewRequest("GET", url, nil)

req.Header.Add("x-api-key", "<x-api-key>")
req.Header.Add("Content-Type", "<content-type>")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.get("https://server.sellagent.ai/api/phone")
.header("x-api-key", "<x-api-key>")
.header("Content-Type", "<content-type>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://server.sellagent.ai/api/phone")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<x-api-key>'
request["Content-Type"] = '<content-type>'

response = http.request(request)
puts response.read_body
[
  {
    "_id": "685bb187dc7279fb63ed11d",
    "phoneNumber": "+17245868135",
    "userId": "6855d390cadc9740fe720a",
    "workspaceId": "685846b162e555e53cd3ae",
    "terminationUri": "sell-agent.pstn.twilio.com",
    "nickName": "production",
    "outboundTrunk": "ST_B7t6CbWDG6G",
    "inboundTrunk": "ST_2FKEA6i8392",
    "createdAt": "2025-06-25T08:21:27.806Z",
    "updatedAt": "2025-06-25T08:34:28.172Z",
    "__v": 0,
    "inboundAgentId": {
      "_id": "6855717a08af648abd4a69",
      "name": "SellAgent Cold Calling Agent",
      "type": "Single Prompt"
    },
    "outboundAgentId": {
      "_id": "6855717a08af648abd4a6964",
      "name": "SellAgent Cold Calling Agent",
      "type": "Single Prompt"
    }
  }
]
{
"status": "error",
"message": "API key is missing or invalid."
}
{
"status": "error",
"message": "An unexpected server error occurred."
}

Headers

x-api-key
string
required

Your API key for authentication

Content-Type
enum<string>
required

Must be application/json

Available options:
application/json
x-workspace-id
string

Optional Workspace ID. If not provided, defaults to the user's current workspace.

Response

Successfully retrieved all phones

_id
string
required

Unique ID of the phone record

Example:

"685bb187dc7279fb63ed11d"

phoneNumber
string
required

The actual phone number

Example:

"+17245868135"

userId
string

ID of the user who owns the phone

Example:

"6855d390cadc9740fe720a"

workspaceId
string

Workspace associated with this phone number

Example:

"685846b162e555e53cd3ae"

terminationUri
string

SIP termination URI

Example:

"sell-agent.pstn.twilio.com"

nickName
string

Nickname for the phone number

Example:

"production"

outboundTrunk
string

Outbound trunk identifier

Example:

"ST_B7t6CbWDG6G"

inboundTrunk
string

Inbound trunk identifier

Example:

"ST_2FKEA6i8392"

createdAt
string<date-time>

Date and time when the phone record was created

Example:

"2025-06-25T08:21:27.806Z"

updatedAt
string<date-time>

Date and time when the phone record was last updated

Example:

"2025-06-25T08:34:28.172Z"

__v
integer

Document version key

Example:

0

inboundAgentId
object

Inbound agent details

outboundAgentId
object

Outbound agent details