Get Agents
Return the list of agents accessible to the current API-key-authenticated frontend user.
POST
/
get-agents
Get agents information
curl --request POST \
--url https://app.phonely.ai/api/get-agents \
--header 'Content-Type: application/json' \
--header 'X-Authorization: <api-key>' \
--data '
{
"uid": "<string>"
}
'import requests
url = "https://app.phonely.ai/api/get-agents"
payload = { "uid": "<string>" }
headers = {
"X-Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Authorization': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({uid: '<string>'})
};
fetch('https://app.phonely.ai/api/get-agents', 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://app.phonely.ai/api/get-agents",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'uid' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Authorization: <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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.phonely.ai/api/get-agents"
payload := strings.NewReader("{\n \"uid\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.phonely.ai/api/get-agents")
.header("X-Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"uid\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.phonely.ai/api/get-agents")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"uid\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body[
{
"orgId": "<string>",
"name": "<string>"
}
]{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}Get Agents
Retrieves a list of all agents accessible to the authenticated user.Request
Method:POSTEndpoint:
/api/get-agentsHeaders:
X-Authorization: Your API key (required)Content-Type:application/json
{
"uid": "string"
}
uid(string, required): Your user ID
Response
Success Response (200):[
{
"uid": "string",
"agentId": "string",
"name": "string",
"country": "string",
"businessPhoneNumber": "string"
}
]
400 Bad Request: Invalid request body401 Unauthorized: Invalid or missing API key500 Internal Server Error: Server error
Example
curl -X POST https://app.phonely.ai/api/get-agents \
-H "X-Authorization: your-api-key" \
-H "Content-Type: application/json" \
-d '{
"uid": "user123"
}'
Last modified on July 11, 2026
⌘I
Get agents information
curl --request POST \
--url https://app.phonely.ai/api/get-agents \
--header 'Content-Type: application/json' \
--header 'X-Authorization: <api-key>' \
--data '
{
"uid": "<string>"
}
'import requests
url = "https://app.phonely.ai/api/get-agents"
payload = { "uid": "<string>" }
headers = {
"X-Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Authorization': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({uid: '<string>'})
};
fetch('https://app.phonely.ai/api/get-agents', 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://app.phonely.ai/api/get-agents",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'uid' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Authorization: <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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.phonely.ai/api/get-agents"
payload := strings.NewReader("{\n \"uid\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.phonely.ai/api/get-agents")
.header("X-Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"uid\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.phonely.ai/api/get-agents")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"uid\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body[
{
"orgId": "<string>",
"name": "<string>"
}
]{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}
