curl --request GET \
--url https://agent-api.treble.ai/agent/company/agents \
--header 'Authorization: <authorization>'import requests
url = "https://agent-api.treble.ai/agent/company/agents"
headers = {"Authorization": "<authorization>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<authorization>'}};
fetch('https://agent-api.treble.ai/agent/company/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://agent-api.treble.ai/agent/company/agents",
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: <authorization>"
],
]);
$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://agent-api.treble.ai/agent/company/agents"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<authorization>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://agent-api.treble.ai/agent/company/agents")
.header("Authorization", "<authorization>")
.asString();require 'uri'
require 'net/http'
url = URI("https://agent-api.treble.ai/agent/company/agents")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<authorization>'
response = http.request(request)
puts response.read_body[
{
"id": 4567,
"first_name": "Andrea",
"last_name": "Soto",
"email": "andrea.soto@yourcompany.com",
"tags": [
{
"id": 12,
"name": "Default"
},
{
"id": 18,
"name": "Comercial"
}
]
}
]Get your company's agents
Returns the agents in your account that can receive conversations. Use it to find out each agent’s id and email, which are the values you must return from your endpoint when using the API destination of the Transfer Methods block.
Only active agents are returned, so any agent in the response can receive a conversation.
This endpoint lives on the agent platform host, agent-api.treble.ai, and not on main.treble.ai.
curl --request GET \
--url https://agent-api.treble.ai/agent/company/agents \
--header 'Authorization: <authorization>'import requests
url = "https://agent-api.treble.ai/agent/company/agents"
headers = {"Authorization": "<authorization>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<authorization>'}};
fetch('https://agent-api.treble.ai/agent/company/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://agent-api.treble.ai/agent/company/agents",
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: <authorization>"
],
]);
$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://agent-api.treble.ai/agent/company/agents"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<authorization>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://agent-api.treble.ai/agent/company/agents")
.header("Authorization", "<authorization>")
.asString();require 'uri'
require 'net/http'
url = URI("https://agent-api.treble.ai/agent/company/agents")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<authorization>'
response = http.request(request)
puts response.read_body[
{
"id": 4567,
"first_name": "Andrea",
"last_name": "Soto",
"email": "andrea.soto@yourcompany.com",
"tags": [
{
"id": 12,
"name": "Default"
},
{
"id": 18,
"name": "Comercial"
}
]
}
]Headers
Authorization API Key. It can be obtained at https://app.treble.ai/en/dashboard/settings/developers
Response
Agent list retrieved successfully
The agent's identifier in Treble. It's the recommended value to return from your assignment endpoint.
4567
The agent's first name.
"Andrea"
The agent's last name.
"Soto"
The agent's email, as registered in Treble. Your assignment endpoint can also return it instead of the id.
"andrea.soto@yourcompany.com"
Teams the agent belongs to.
Show child attributes
Show child attributes
Was this page helpful?