Update scenario
Update an existing scenario with new configuration.
curl --request PATCH \
--url https://api-trial.cognigy.ai/testing/simulations/{simulationReference} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"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/{simulationReference}"
payload = {
"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.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
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/{simulationReference}', 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/{simulationReference}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'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/{simulationReference}"
payload := strings.NewReader("{\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("PATCH", 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.patch("https://api-trial.cognigy.ai/testing/simulations/{simulationReference}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\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/{simulationReference}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\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>"
}{
"error": "<string>",
"code": "<string>",
"traceId": "<string>"
}Authorizations
JWT Bearer Token for authentication
Path Parameters
Reference ID of the scenario
Query Parameters
Project identifier
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
Response
Scenario updated 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 PATCH \
--url https://api-trial.cognigy.ai/testing/simulations/{simulationReference} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"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/{simulationReference}"
payload = {
"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.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
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/{simulationReference}', 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/{simulationReference}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'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/{simulationReference}"
payload := strings.NewReader("{\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("PATCH", 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.patch("https://api-trial.cognigy.ai/testing/simulations/{simulationReference}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\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/{simulationReference}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\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>"
}{
"error": "<string>",
"code": "<string>",
"traceId": "<string>"
}