curl --request GET \
--url https://api.starleads.co/Agent/{agentId} \
--header 'X-Api-Key: <api-key>'import requests
url = "https://api.starleads.co/Agent/{agentId}"
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.starleads.co/Agent/{agentId}', 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.starleads.co/Agent/{agentId}",
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.starleads.co/Agent/{agentId}"
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.starleads.co/Agent/{agentId}")
.header("X-Api-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.starleads.co/Agent/{agentId}")
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{
"agentId": "<string>",
"agentName": "<string>",
"channel": "<string>",
"direction": "<string>",
"language": "<string>",
"tags": [
"<string>"
],
"createdAt": "2023-11-07T05:31:56Z",
"prompt": "<string>",
"outboundWelcomeMessage": "<string>",
"inboundWelcomeMessage": "<string>",
"fields": [
{
"name": "<string>",
"isMandatory": true,
"isSystem": true
}
],
"classificationTags": [
{
"name": "<string>",
"definition": "<string>",
"isSystem": true
}
],
"extractedValues": [
{
"name": "<string>",
"definition": "<string>",
"type": "<string>"
}
],
"isCallTransferEnabled": true,
"tools": [
{
"id": "<string>",
"name": "<string>",
"technicalName": "<string>"
}
],
"subAgents": [
{
"id": "<string>",
"name": "<string>",
"technicalName": "<string>",
"description": "<string>"
}
],
"knowledgeBaseChatId": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>"
}Get an agent
Returns everything needed to work with the agent through the other endpoints: its channel and direction, its prompt and welcome messages, the variables it expects (fields, to pass as dataBag or variables), the classification tags and extracted values found in results, and what is connected to it (tools, sub-agents, knowledge base chat). The agent must belong to the same company as the API key used for authentication.
curl --request GET \
--url https://api.starleads.co/Agent/{agentId} \
--header 'X-Api-Key: <api-key>'import requests
url = "https://api.starleads.co/Agent/{agentId}"
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.starleads.co/Agent/{agentId}', 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.starleads.co/Agent/{agentId}",
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.starleads.co/Agent/{agentId}"
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.starleads.co/Agent/{agentId}")
.header("X-Api-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.starleads.co/Agent/{agentId}")
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{
"agentId": "<string>",
"agentName": "<string>",
"channel": "<string>",
"direction": "<string>",
"language": "<string>",
"tags": [
"<string>"
],
"createdAt": "2023-11-07T05:31:56Z",
"prompt": "<string>",
"outboundWelcomeMessage": "<string>",
"inboundWelcomeMessage": "<string>",
"fields": [
{
"name": "<string>",
"isMandatory": true,
"isSystem": true
}
],
"classificationTags": [
{
"name": "<string>",
"definition": "<string>",
"isSystem": true
}
],
"extractedValues": [
{
"name": "<string>",
"definition": "<string>",
"type": "<string>"
}
],
"isCallTransferEnabled": true,
"tools": [
{
"id": "<string>",
"name": "<string>",
"technicalName": "<string>"
}
],
"subAgents": [
{
"id": "<string>",
"name": "<string>",
"technicalName": "<string>",
"description": "<string>"
}
],
"knowledgeBaseChatId": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>"
}Authorizations
Headers
Api key to pass as a X-Api-Key request header.
Path Parameters
ID of the agent.
Response
Success
An agent: its identity and channel, its prompt, the variables it expects, how it classifies conversations, and what is connected to it (tools, sub-agents, knowledge base chat)
Agent identifier
Agent name
Channel the agent talks on: Phone, SMS, Web or WhatsApp. Phone and WhatsApp campaigns need a phone number; Web agents are reached through the web widget.
Inbound: the agent answers contacts who reach it. Outbound: the agent initiates, its campaign items are dialed or messaged.
Language of the agent, as an ISO code such as fr or en
Tags set on the agent in the interface, for organisation only. Not related to classification tags.
Creation date (UTC)
Prompt of the agent
First sentence the agent says when it initiates the conversation (outbound campaign items, callbacks). Placeholders such as {firstName} are replaced by the field values.
First sentence the agent says when a contact reaches it (inbound call, message or web widget). Placeholders such as {firstName} are replaced by the field values.
Variables the prompt expects. Pass their values as dataBag when creating or updating a campaign item or starting a simulation chat, and as variables of a simulation test. System fields are filled by the platform.
Show child attributes
Show child attributes
Tags the agent can assign to a conversation once it ends. A classification test expects one of these names in tagExpected, and campaign item results carry the assigned tag.
Show child attributes
Show child attributes
Values the agent extracts from a conversation once it ends, returned with the campaign item results
Show child attributes
Show child attributes
Whether the agent may transfer the call to a human. When true, mockCallTransfer is relevant in simulation tests.
Tools connected to the agent
Show child attributes
Show child attributes
Sub-agents the agent can delegate to. Their ids are the ones accepted by mockedSubAgents in simulation tests.
Show child attributes
Show child attributes
Identifier of the knowledge base chat connected to the agent, if any (see GET /Agent/{agentId}/chat)

