curl --request POST \
--url https://api.starleads.co/SimulationChat/start \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"agentId": "<string>",
"dataBag": {},
"toolMocking": {
"mockedTools": [
{
"toolId": "<string>",
"resultTemplate": "<string>",
"delaySeconds": 30
}
],
"mockAllTools": true,
"mockCallTransfer": true
}
}
'import requests
url = "https://api.starleads.co/SimulationChat/start"
payload = {
"agentId": "<string>",
"dataBag": {},
"toolMocking": {
"mockedTools": [
{
"toolId": "<string>",
"resultTemplate": "<string>",
"delaySeconds": 30
}
],
"mockAllTools": True,
"mockCallTransfer": True
}
}
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>',
dataBag: {},
toolMocking: {
mockedTools: [{toolId: '<string>', resultTemplate: '<string>', delaySeconds: 30}],
mockAllTools: true,
mockCallTransfer: true
}
})
};
fetch('https://api.starleads.co/SimulationChat/start', 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/SimulationChat/start",
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>',
'dataBag' => [
],
'toolMocking' => [
'mockedTools' => [
[
'toolId' => '<string>',
'resultTemplate' => '<string>',
'delaySeconds' => 30
]
],
'mockAllTools' => true,
'mockCallTransfer' => true
]
]),
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/SimulationChat/start"
payload := strings.NewReader("{\n \"agentId\": \"<string>\",\n \"dataBag\": {},\n \"toolMocking\": {\n \"mockedTools\": [\n {\n \"toolId\": \"<string>\",\n \"resultTemplate\": \"<string>\",\n \"delaySeconds\": 30\n }\n ],\n \"mockAllTools\": true,\n \"mockCallTransfer\": true\n }\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/SimulationChat/start")
.header("X-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"agentId\": \"<string>\",\n \"dataBag\": {},\n \"toolMocking\": {\n \"mockedTools\": [\n {\n \"toolId\": \"<string>\",\n \"resultTemplate\": \"<string>\",\n \"delaySeconds\": 30\n }\n ],\n \"mockAllTools\": true,\n \"mockCallTransfer\": true\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.starleads.co/SimulationChat/start")
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 \"dataBag\": {},\n \"toolMocking\": {\n \"mockedTools\": [\n {\n \"toolId\": \"<string>\",\n \"resultTemplate\": \"<string>\",\n \"delaySeconds\": 30\n }\n ],\n \"mockAllTools\": true,\n \"mockCallTransfer\": true\n }\n}"
response = http.request(request)
puts response.read_body{
"simulationChatId": "<string>",
"messages": [
{
"role": "<string>",
"text": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"isConversationEnded": true,
"endReason": "<string>"
}
],
"agent": {
"agentId": "<string>",
"agentName": "<string>",
"prompt": "<string>",
"tools": [
{
"id": "<string>",
"name": "<string>",
"technicalName": "<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>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>"
}Start a simulation chat with an agent
Starts a new text conversation with the agent and returns its identifier, the messages so far (the agent’s welcome message, if any) and the agent definition. The agent must belong to the same company as the API key. Use toolMocking to keep the agent’s tools from triggering real actions on your systems during the chat.
curl --request POST \
--url https://api.starleads.co/SimulationChat/start \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"agentId": "<string>",
"dataBag": {},
"toolMocking": {
"mockedTools": [
{
"toolId": "<string>",
"resultTemplate": "<string>",
"delaySeconds": 30
}
],
"mockAllTools": true,
"mockCallTransfer": true
}
}
'import requests
url = "https://api.starleads.co/SimulationChat/start"
payload = {
"agentId": "<string>",
"dataBag": {},
"toolMocking": {
"mockedTools": [
{
"toolId": "<string>",
"resultTemplate": "<string>",
"delaySeconds": 30
}
],
"mockAllTools": True,
"mockCallTransfer": True
}
}
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>',
dataBag: {},
toolMocking: {
mockedTools: [{toolId: '<string>', resultTemplate: '<string>', delaySeconds: 30}],
mockAllTools: true,
mockCallTransfer: true
}
})
};
fetch('https://api.starleads.co/SimulationChat/start', 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/SimulationChat/start",
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>',
'dataBag' => [
],
'toolMocking' => [
'mockedTools' => [
[
'toolId' => '<string>',
'resultTemplate' => '<string>',
'delaySeconds' => 30
]
],
'mockAllTools' => true,
'mockCallTransfer' => true
]
]),
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/SimulationChat/start"
payload := strings.NewReader("{\n \"agentId\": \"<string>\",\n \"dataBag\": {},\n \"toolMocking\": {\n \"mockedTools\": [\n {\n \"toolId\": \"<string>\",\n \"resultTemplate\": \"<string>\",\n \"delaySeconds\": 30\n }\n ],\n \"mockAllTools\": true,\n \"mockCallTransfer\": true\n }\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/SimulationChat/start")
.header("X-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"agentId\": \"<string>\",\n \"dataBag\": {},\n \"toolMocking\": {\n \"mockedTools\": [\n {\n \"toolId\": \"<string>\",\n \"resultTemplate\": \"<string>\",\n \"delaySeconds\": 30\n }\n ],\n \"mockAllTools\": true,\n \"mockCallTransfer\": true\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.starleads.co/SimulationChat/start")
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 \"dataBag\": {},\n \"toolMocking\": {\n \"mockedTools\": [\n {\n \"toolId\": \"<string>\",\n \"resultTemplate\": \"<string>\",\n \"delaySeconds\": 30\n }\n ],\n \"mockAllTools\": true,\n \"mockCallTransfer\": true\n }\n}"
response = http.request(request)
puts response.read_body{
"simulationChatId": "<string>",
"messages": [
{
"role": "<string>",
"text": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"isConversationEnded": true,
"endReason": "<string>"
}
],
"agent": {
"agentId": "<string>",
"agentName": "<string>",
"prompt": "<string>",
"tools": [
{
"id": "<string>",
"name": "<string>",
"technicalName": "<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>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>"
}Authorizations
Headers
Api key to pass as a X-Api-Key request header.
Body
ID of the agent to test
1Optional values for the agent's fields (the variables used in the prompt), e.g. { "firstName": "Marie" }
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
Response
Success
State of a simulation chat, returned by SimulationChat/start and GET SimulationChat/{simulationChatId}
Identifier of the simulation chat (the conversation id). Pass it to SimulationChat/send-message.
All the messages of the conversation so far, in chronological order
Show child attributes
Show child attributes
An agent: its name, prompt and connected tools
Show child attributes
Show child attributes

