Create scenario
Create a scenario with the provided configuration.
curl --request POST \
--url https://api-trial.cognigy.ai/testing/simulations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"projectReference": "<string>",
"name": "<string>",
"persona": "<string>",
"personaName": "<string>",
"mission": "<string>",
"successCriteria": [
{
"type": "<string>",
"params": {}
}
],
"maxTurns": 123,
"timeout": 123,
"aiAgentReferenceId": "<string>",
"flowReferenceId": "<string>",
"jobNodeId": "<string>"
}
'import requests
url = "https://api-trial.cognigy.ai/testing/simulations"
payload = {
"projectReference": "<string>",
"name": "<string>",
"persona": "<string>",
"personaName": "<string>",
"mission": "<string>",
"successCriteria": [
{
"type": "<string>",
"params": {}
}
],
"maxTurns": 123,
"timeout": 123,
"aiAgentReferenceId": "<string>",
"flowReferenceId": "<string>",
"jobNodeId": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
projectReference: '<string>',
name: '<string>',
persona: '<string>',
personaName: '<string>',
mission: '<string>',
successCriteria: [{type: '<string>', params: {}}],
maxTurns: 123,
timeout: 123,
aiAgentReferenceId: '<string>',
flowReferenceId: '<string>',
jobNodeId: '<string>'
})
};
fetch('https://api-trial.cognigy.ai/testing/simulations', 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-trial.cognigy.ai/testing/simulations",
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([
'projectReference' => '<string>',
'name' => '<string>',
'persona' => '<string>',
'personaName' => '<string>',
'mission' => '<string>',
'successCriteria' => [
[
'type' => '<string>',
'params' => [
]
]
],
'maxTurns' => 123,
'timeout' => 123,
'aiAgentReferenceId' => '<string>',
'flowReferenceId' => '<string>',
'jobNodeId' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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-trial.cognigy.ai/testing/simulations"
payload := strings.NewReader("{\n \"projectReference\": \"<string>\",\n \"name\": \"<string>\",\n \"persona\": \"<string>\",\n \"personaName\": \"<string>\",\n \"mission\": \"<string>\",\n \"successCriteria\": [\n {\n \"type\": \"<string>\",\n \"params\": {}\n }\n ],\n \"maxTurns\": 123,\n \"timeout\": 123,\n \"aiAgentReferenceId\": \"<string>\",\n \"flowReferenceId\": \"<string>\",\n \"jobNodeId\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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-trial.cognigy.ai/testing/simulations")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"projectReference\": \"<string>\",\n \"name\": \"<string>\",\n \"persona\": \"<string>\",\n \"personaName\": \"<string>\",\n \"mission\": \"<string>\",\n \"successCriteria\": [\n {\n \"type\": \"<string>\",\n \"params\": {}\n }\n ],\n \"maxTurns\": 123,\n \"timeout\": 123,\n \"aiAgentReferenceId\": \"<string>\",\n \"flowReferenceId\": \"<string>\",\n \"jobNodeId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-trial.cognigy.ai/testing/simulations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"projectReference\": \"<string>\",\n \"name\": \"<string>\",\n \"persona\": \"<string>\",\n \"personaName\": \"<string>\",\n \"mission\": \"<string>\",\n \"successCriteria\": [\n {\n \"type\": \"<string>\",\n \"params\": {}\n }\n ],\n \"maxTurns\": 123,\n \"timeout\": 123,\n \"aiAgentReferenceId\": \"<string>\",\n \"flowReferenceId\": \"<string>\",\n \"jobNodeId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"referenceId": "<string>",
"name": "<string>",
"persona": "<string>",
"personaName": "<string>",
"mission": "<string>",
"successCriteria": [
{
"type": "<string>",
"params": {}
}
],
"organisationReference": "<string>",
"projectReference": "<string>",
"createdAt": 123,
"createdBy": "<string>",
"lastChanged": 123,
"lastChangedBy": "<string>",
"maxTurns": 123,
"timeout": 123,
"aiAgentReferenceId": "<string>",
"aiAgentId": "<string>",
"flowReferenceId": "<string>",
"flowId": "<string>",
"jobNodeId": "<string>",
"updatedAt": 123,
"updatedBy": "<string>"
}{
"error": "<string>",
"field": "<string>",
"code": "<string>",
"traceId": "<string>"
}{
"error": "<string>",
"code": "<string>",
"traceId": "<string>"
}{
"error": "<string>",
"code": "<string>",
"traceId": "<string>"
}{
"error": "<string>",
"code": "<string>",
"traceId": "<string>"
}Authorizations
JWT Bearer Token for authentication
Query Parameters
Project identifier
Body
Project reference (required in body)
Name of the scenario
Persona description
Name of the persona
Mission description
List of success criteria (structured objects)
Show child attributes
Show child attributes
Maximum number of turns
Timeout in seconds
Reference ID of the AI Agent
Reference ID of the Flow
Job Node ID for precise tool context tracking
Response
Scenario created successfully
Unique identifier for the scenario
Reference ID for the scenario
Name of the scenario
Persona description
Name of the persona
Mission description
List of success criteria (structured objects)
Show child attributes
Show child attributes
Organization reference
Project reference
Creation timestamp
User who created the scenario
Last change timestamp
User who made the last change
Maximum number of turns
Timeout in seconds
Reference ID of the AI Agent
Database ID of the AI Agent
Reference ID of the Flow
Database ID of the Flow
Job Node ID
Last update timestamp
User who last updated the scenario
curl --request POST \
--url https://api-trial.cognigy.ai/testing/simulations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"projectReference": "<string>",
"name": "<string>",
"persona": "<string>",
"personaName": "<string>",
"mission": "<string>",
"successCriteria": [
{
"type": "<string>",
"params": {}
}
],
"maxTurns": 123,
"timeout": 123,
"aiAgentReferenceId": "<string>",
"flowReferenceId": "<string>",
"jobNodeId": "<string>"
}
'import requests
url = "https://api-trial.cognigy.ai/testing/simulations"
payload = {
"projectReference": "<string>",
"name": "<string>",
"persona": "<string>",
"personaName": "<string>",
"mission": "<string>",
"successCriteria": [
{
"type": "<string>",
"params": {}
}
],
"maxTurns": 123,
"timeout": 123,
"aiAgentReferenceId": "<string>",
"flowReferenceId": "<string>",
"jobNodeId": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
projectReference: '<string>',
name: '<string>',
persona: '<string>',
personaName: '<string>',
mission: '<string>',
successCriteria: [{type: '<string>', params: {}}],
maxTurns: 123,
timeout: 123,
aiAgentReferenceId: '<string>',
flowReferenceId: '<string>',
jobNodeId: '<string>'
})
};
fetch('https://api-trial.cognigy.ai/testing/simulations', 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-trial.cognigy.ai/testing/simulations",
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([
'projectReference' => '<string>',
'name' => '<string>',
'persona' => '<string>',
'personaName' => '<string>',
'mission' => '<string>',
'successCriteria' => [
[
'type' => '<string>',
'params' => [
]
]
],
'maxTurns' => 123,
'timeout' => 123,
'aiAgentReferenceId' => '<string>',
'flowReferenceId' => '<string>',
'jobNodeId' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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-trial.cognigy.ai/testing/simulations"
payload := strings.NewReader("{\n \"projectReference\": \"<string>\",\n \"name\": \"<string>\",\n \"persona\": \"<string>\",\n \"personaName\": \"<string>\",\n \"mission\": \"<string>\",\n \"successCriteria\": [\n {\n \"type\": \"<string>\",\n \"params\": {}\n }\n ],\n \"maxTurns\": 123,\n \"timeout\": 123,\n \"aiAgentReferenceId\": \"<string>\",\n \"flowReferenceId\": \"<string>\",\n \"jobNodeId\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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-trial.cognigy.ai/testing/simulations")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"projectReference\": \"<string>\",\n \"name\": \"<string>\",\n \"persona\": \"<string>\",\n \"personaName\": \"<string>\",\n \"mission\": \"<string>\",\n \"successCriteria\": [\n {\n \"type\": \"<string>\",\n \"params\": {}\n }\n ],\n \"maxTurns\": 123,\n \"timeout\": 123,\n \"aiAgentReferenceId\": \"<string>\",\n \"flowReferenceId\": \"<string>\",\n \"jobNodeId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-trial.cognigy.ai/testing/simulations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"projectReference\": \"<string>\",\n \"name\": \"<string>\",\n \"persona\": \"<string>\",\n \"personaName\": \"<string>\",\n \"mission\": \"<string>\",\n \"successCriteria\": [\n {\n \"type\": \"<string>\",\n \"params\": {}\n }\n ],\n \"maxTurns\": 123,\n \"timeout\": 123,\n \"aiAgentReferenceId\": \"<string>\",\n \"flowReferenceId\": \"<string>\",\n \"jobNodeId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"referenceId": "<string>",
"name": "<string>",
"persona": "<string>",
"personaName": "<string>",
"mission": "<string>",
"successCriteria": [
{
"type": "<string>",
"params": {}
}
],
"organisationReference": "<string>",
"projectReference": "<string>",
"createdAt": 123,
"createdBy": "<string>",
"lastChanged": 123,
"lastChangedBy": "<string>",
"maxTurns": 123,
"timeout": 123,
"aiAgentReferenceId": "<string>",
"aiAgentId": "<string>",
"flowReferenceId": "<string>",
"flowId": "<string>",
"jobNodeId": "<string>",
"updatedAt": 123,
"updatedBy": "<string>"
}{
"error": "<string>",
"field": "<string>",
"code": "<string>",
"traceId": "<string>"
}{
"error": "<string>",
"code": "<string>",
"traceId": "<string>"
}{
"error": "<string>",
"code": "<string>",
"traceId": "<string>"
}{
"error": "<string>",
"code": "<string>",
"traceId": "<string>"
}