curl --request POST \
--url https://api.starleads.co/AgentTest/simulation \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"agentId": "<string>",
"name": "<string>",
"scenario": "<string>",
"criteria": [
"<string>"
],
"maxTurns": 123,
"conversationContext": [
{
"role": "<string>",
"text": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}
],
"variables": {},
"toolMocking": {
"mockedTools": [
{
"toolId": "<string>",
"resultTemplate": "<string>",
"delaySeconds": 30
}
],
"mockAllTools": true,
"mockCallTransfer": true
},
"folderId": "<string>"
}
'import requests
url = "https://api.starleads.co/AgentTest/simulation"
payload = {
"agentId": "<string>",
"name": "<string>",
"scenario": "<string>",
"criteria": ["<string>"],
"maxTurns": 123,
"conversationContext": [
{
"role": "<string>",
"text": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}
],
"variables": {},
"toolMocking": {
"mockedTools": [
{
"toolId": "<string>",
"resultTemplate": "<string>",
"delaySeconds": 30
}
],
"mockAllTools": True,
"mockCallTransfer": True
},
"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>',
scenario: '<string>',
criteria: ['<string>'],
maxTurns: 123,
conversationContext: [{role: '<string>', text: '<string>', timestamp: '2023-11-07T05:31:56Z'}],
variables: {},
toolMocking: {
mockedTools: [{toolId: '<string>', resultTemplate: '<string>', delaySeconds: 30}],
mockAllTools: true,
mockCallTransfer: true
},
folderId: '<string>'
})
};
fetch('https://api.starleads.co/AgentTest/simulation', 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/simulation",
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>',
'scenario' => '<string>',
'criteria' => [
'<string>'
],
'maxTurns' => 123,
'conversationContext' => [
[
'role' => '<string>',
'text' => '<string>',
'timestamp' => '2023-11-07T05:31:56Z'
]
],
'variables' => [
],
'toolMocking' => [
'mockedTools' => [
[
'toolId' => '<string>',
'resultTemplate' => '<string>',
'delaySeconds' => 30
]
],
'mockAllTools' => true,
'mockCallTransfer' => true
],
'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/simulation"
payload := strings.NewReader("{\n \"agentId\": \"<string>\",\n \"name\": \"<string>\",\n \"scenario\": \"<string>\",\n \"criteria\": [\n \"<string>\"\n ],\n \"maxTurns\": 123,\n \"conversationContext\": [\n {\n \"role\": \"<string>\",\n \"text\": \"<string>\",\n \"timestamp\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"variables\": {},\n \"toolMocking\": {\n \"mockedTools\": [\n {\n \"toolId\": \"<string>\",\n \"resultTemplate\": \"<string>\",\n \"delaySeconds\": 30\n }\n ],\n \"mockAllTools\": true,\n \"mockCallTransfer\": true\n },\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/simulation")
.header("X-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"agentId\": \"<string>\",\n \"name\": \"<string>\",\n \"scenario\": \"<string>\",\n \"criteria\": [\n \"<string>\"\n ],\n \"maxTurns\": 123,\n \"conversationContext\": [\n {\n \"role\": \"<string>\",\n \"text\": \"<string>\",\n \"timestamp\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"variables\": {},\n \"toolMocking\": {\n \"mockedTools\": [\n {\n \"toolId\": \"<string>\",\n \"resultTemplate\": \"<string>\",\n \"delaySeconds\": 30\n }\n ],\n \"mockAllTools\": true,\n \"mockCallTransfer\": true\n },\n \"folderId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.starleads.co/AgentTest/simulation")
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 \"scenario\": \"<string>\",\n \"criteria\": [\n \"<string>\"\n ],\n \"maxTurns\": 123,\n \"conversationContext\": [\n {\n \"role\": \"<string>\",\n \"text\": \"<string>\",\n \"timestamp\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"variables\": {},\n \"toolMocking\": {\n \"mockedTools\": [\n {\n \"toolId\": \"<string>\",\n \"resultTemplate\": \"<string>\",\n \"delaySeconds\": 30\n }\n ],\n \"mockAllTools\": true,\n \"mockCallTransfer\": true\n },\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 simulation test
Creates a simulation test on one of your agents: a scenario describing the simulated user, one or more success criteria judged independently, a maximum number of turns and the values of the agent variables. Use toolMocking to keep the agent’s tools from triggering real actions on your systems when the test runs.
curl --request POST \
--url https://api.starleads.co/AgentTest/simulation \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"agentId": "<string>",
"name": "<string>",
"scenario": "<string>",
"criteria": [
"<string>"
],
"maxTurns": 123,
"conversationContext": [
{
"role": "<string>",
"text": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}
],
"variables": {},
"toolMocking": {
"mockedTools": [
{
"toolId": "<string>",
"resultTemplate": "<string>",
"delaySeconds": 30
}
],
"mockAllTools": true,
"mockCallTransfer": true
},
"folderId": "<string>"
}
'import requests
url = "https://api.starleads.co/AgentTest/simulation"
payload = {
"agentId": "<string>",
"name": "<string>",
"scenario": "<string>",
"criteria": ["<string>"],
"maxTurns": 123,
"conversationContext": [
{
"role": "<string>",
"text": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}
],
"variables": {},
"toolMocking": {
"mockedTools": [
{
"toolId": "<string>",
"resultTemplate": "<string>",
"delaySeconds": 30
}
],
"mockAllTools": True,
"mockCallTransfer": True
},
"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>',
scenario: '<string>',
criteria: ['<string>'],
maxTurns: 123,
conversationContext: [{role: '<string>', text: '<string>', timestamp: '2023-11-07T05:31:56Z'}],
variables: {},
toolMocking: {
mockedTools: [{toolId: '<string>', resultTemplate: '<string>', delaySeconds: 30}],
mockAllTools: true,
mockCallTransfer: true
},
folderId: '<string>'
})
};
fetch('https://api.starleads.co/AgentTest/simulation', 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/simulation",
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>',
'scenario' => '<string>',
'criteria' => [
'<string>'
],
'maxTurns' => 123,
'conversationContext' => [
[
'role' => '<string>',
'text' => '<string>',
'timestamp' => '2023-11-07T05:31:56Z'
]
],
'variables' => [
],
'toolMocking' => [
'mockedTools' => [
[
'toolId' => '<string>',
'resultTemplate' => '<string>',
'delaySeconds' => 30
]
],
'mockAllTools' => true,
'mockCallTransfer' => true
],
'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/simulation"
payload := strings.NewReader("{\n \"agentId\": \"<string>\",\n \"name\": \"<string>\",\n \"scenario\": \"<string>\",\n \"criteria\": [\n \"<string>\"\n ],\n \"maxTurns\": 123,\n \"conversationContext\": [\n {\n \"role\": \"<string>\",\n \"text\": \"<string>\",\n \"timestamp\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"variables\": {},\n \"toolMocking\": {\n \"mockedTools\": [\n {\n \"toolId\": \"<string>\",\n \"resultTemplate\": \"<string>\",\n \"delaySeconds\": 30\n }\n ],\n \"mockAllTools\": true,\n \"mockCallTransfer\": true\n },\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/simulation")
.header("X-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"agentId\": \"<string>\",\n \"name\": \"<string>\",\n \"scenario\": \"<string>\",\n \"criteria\": [\n \"<string>\"\n ],\n \"maxTurns\": 123,\n \"conversationContext\": [\n {\n \"role\": \"<string>\",\n \"text\": \"<string>\",\n \"timestamp\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"variables\": {},\n \"toolMocking\": {\n \"mockedTools\": [\n {\n \"toolId\": \"<string>\",\n \"resultTemplate\": \"<string>\",\n \"delaySeconds\": 30\n }\n ],\n \"mockAllTools\": true,\n \"mockCallTransfer\": true\n },\n \"folderId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.starleads.co/AgentTest/simulation")
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 \"scenario\": \"<string>\",\n \"criteria\": [\n \"<string>\"\n ],\n \"maxTurns\": 123,\n \"conversationContext\": [\n {\n \"role\": \"<string>\",\n \"text\": \"<string>\",\n \"timestamp\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"variables\": {},\n \"toolMocking\": {\n \"mockedTools\": [\n {\n \"toolId\": \"<string>\",\n \"resultTemplate\": \"<string>\",\n \"delaySeconds\": 30\n }\n ],\n \"mockAllTools\": true,\n \"mockCallTransfer\": true\n },\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
Simulation test to create
Agent owning the test
11Persona and intent of the simulated user
1Success criteria in plain text, each judged independently (at least one)
Maximum number of user/agent exchanges (1-30)
Messages the conversation starts from, in chronological order. Empty starts from scratch. When the last message is from the assistant the simulated user answers it; when it is from the user the agent answers it first.
Show child attributes
Show child attributes
Values of the agent variables (name → value) used to render the prompt
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
Folder 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

