curl --request POST \
--url https://api.starleads.co/AgentTest/classification \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"agentId": "<string>",
"name": "<string>",
"conversationContext": {
"messages": [
{
"role": "<string>",
"text": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}
],
"dataBag": {}
},
"tagExpected": "<string>",
"folderId": "<string>"
}
'import requests
url = "https://api.starleads.co/AgentTest/classification"
payload = {
"agentId": "<string>",
"name": "<string>",
"conversationContext": {
"messages": [
{
"role": "<string>",
"text": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}
],
"dataBag": {}
},
"tagExpected": "<string>",
"folderId": "<string>"
}
headers = {
"X-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
agentId: '<string>',
name: '<string>',
conversationContext: {
messages: [{role: '<string>', text: '<string>', timestamp: '2023-11-07T05:31:56Z'}],
dataBag: {}
},
tagExpected: '<string>',
folderId: '<string>'
})
};
fetch('https://api.starleads.co/AgentTest/classification', 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/AgentTest/classification",
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([
'agentId' => '<string>',
'name' => '<string>',
'conversationContext' => [
'messages' => [
[
'role' => '<string>',
'text' => '<string>',
'timestamp' => '2023-11-07T05:31:56Z'
]
],
'dataBag' => [
]
],
'tagExpected' => '<string>',
'folderId' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.starleads.co/AgentTest/classification"
payload := strings.NewReader("{\n \"agentId\": \"<string>\",\n \"name\": \"<string>\",\n \"conversationContext\": {\n \"messages\": [\n {\n \"role\": \"<string>\",\n \"text\": \"<string>\",\n \"timestamp\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"dataBag\": {}\n },\n \"tagExpected\": \"<string>\",\n \"folderId\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Api-Key", "<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://api.starleads.co/AgentTest/classification")
.header("X-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"agentId\": \"<string>\",\n \"name\": \"<string>\",\n \"conversationContext\": {\n \"messages\": [\n {\n \"role\": \"<string>\",\n \"text\": \"<string>\",\n \"timestamp\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"dataBag\": {}\n },\n \"tagExpected\": \"<string>\",\n \"folderId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.starleads.co/AgentTest/classification")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"agentId\": \"<string>\",\n \"name\": \"<string>\",\n \"conversationContext\": {\n \"messages\": [\n {\n \"role\": \"<string>\",\n \"text\": \"<string>\",\n \"timestamp\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"dataBag\": {}\n },\n \"tagExpected\": \"<string>\",\n \"folderId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"kind": "Simulation",
"agentId": "<string>",
"folderId": "<string>",
"name": "<string>",
"lastRunId": "<string>",
"lastRunStatus": "Queued",
"lastRunAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"scenario": "<string>",
"criteria": [
"<string>"
],
"maxTurns": 123,
"conversationMessages": [
{
"role": "<string>",
"text": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}
],
"variables": {},
"toolMocking": {
"mockedTools": [
{
"toolId": "<string>",
"resultTemplate": "<string>",
"delaySeconds": 30
}
],
"mockAllTools": true,
"mockCallTransfer": true
},
"conversationContext": {
"messages": [
{
"role": "<string>",
"text": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}
],
"dataBag": {}
},
"tagExpected": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>"
}Create a classification test
Creates a classification test on one of your agents: a conversation and the tag the agent is expected to produce for it.
curl --request POST \
--url https://api.starleads.co/AgentTest/classification \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"agentId": "<string>",
"name": "<string>",
"conversationContext": {
"messages": [
{
"role": "<string>",
"text": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}
],
"dataBag": {}
},
"tagExpected": "<string>",
"folderId": "<string>"
}
'import requests
url = "https://api.starleads.co/AgentTest/classification"
payload = {
"agentId": "<string>",
"name": "<string>",
"conversationContext": {
"messages": [
{
"role": "<string>",
"text": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}
],
"dataBag": {}
},
"tagExpected": "<string>",
"folderId": "<string>"
}
headers = {
"X-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
agentId: '<string>',
name: '<string>',
conversationContext: {
messages: [{role: '<string>', text: '<string>', timestamp: '2023-11-07T05:31:56Z'}],
dataBag: {}
},
tagExpected: '<string>',
folderId: '<string>'
})
};
fetch('https://api.starleads.co/AgentTest/classification', 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/AgentTest/classification",
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([
'agentId' => '<string>',
'name' => '<string>',
'conversationContext' => [
'messages' => [
[
'role' => '<string>',
'text' => '<string>',
'timestamp' => '2023-11-07T05:31:56Z'
]
],
'dataBag' => [
]
],
'tagExpected' => '<string>',
'folderId' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.starleads.co/AgentTest/classification"
payload := strings.NewReader("{\n \"agentId\": \"<string>\",\n \"name\": \"<string>\",\n \"conversationContext\": {\n \"messages\": [\n {\n \"role\": \"<string>\",\n \"text\": \"<string>\",\n \"timestamp\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"dataBag\": {}\n },\n \"tagExpected\": \"<string>\",\n \"folderId\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Api-Key", "<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://api.starleads.co/AgentTest/classification")
.header("X-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"agentId\": \"<string>\",\n \"name\": \"<string>\",\n \"conversationContext\": {\n \"messages\": [\n {\n \"role\": \"<string>\",\n \"text\": \"<string>\",\n \"timestamp\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"dataBag\": {}\n },\n \"tagExpected\": \"<string>\",\n \"folderId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.starleads.co/AgentTest/classification")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"agentId\": \"<string>\",\n \"name\": \"<string>\",\n \"conversationContext\": {\n \"messages\": [\n {\n \"role\": \"<string>\",\n \"text\": \"<string>\",\n \"timestamp\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"dataBag\": {}\n },\n \"tagExpected\": \"<string>\",\n \"folderId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"kind": "Simulation",
"agentId": "<string>",
"folderId": "<string>",
"name": "<string>",
"lastRunId": "<string>",
"lastRunStatus": "Queued",
"lastRunAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"scenario": "<string>",
"criteria": [
"<string>"
],
"maxTurns": 123,
"conversationMessages": [
{
"role": "<string>",
"text": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}
],
"variables": {},
"toolMocking": {
"mockedTools": [
{
"toolId": "<string>",
"resultTemplate": "<string>",
"delaySeconds": 30
}
],
"mockAllTools": true,
"mockCallTransfer": true
},
"conversationContext": {
"messages": [
{
"role": "<string>",
"text": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}
],
"dataBag": {}
},
"tagExpected": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<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.
Body
Classification test to create
Agent owning the test
11Conversation used as input of a classification test
Show child attributes
Show child attributes
Tag the agent is expected to produce
1Folder of the agent; null for the root
Response
Success
A test of an agent. Depending on kind, either the simulation fields (scenario, criteria, maxTurns, variables) or the classification fields (conversationContext, tagExpected) are set.
Simulation, Classification Folder containing the test, null at the root
Most recent run of the test
Queued, Running, Passed, Failed, Error, Cancelled Simulation only: persona and intent of the simulated user
Simulation only: success criteria, each judged independently
Simulation only: maximum number of user/agent exchanges (1-30)
Simulation only: messages the conversation starts from, in chronological order; empty when the run starts from scratch
Show child attributes
Show child attributes
Simulation only: values of the agent variables (name → value)
Show child attributes
Show child attributes
Which tools of the agent are mocked (not really executed) during a simulation. Every mock is opt-in: nothing is mocked unless asked for here, and mockAllTools does not imply mockCallTransfer. The knowledge base retrieval always runs for real.
Show child attributes
Show child attributes
Conversation used as input of a classification test
Show child attributes
Show child attributes
Classification only: expected tag

