## Documentation Index

Fetch the complete documentation index at: [/llms.txt](https://docs.cognigy.com/llms.txt)

Use this file to discover all available pages before exploring further.

PATCH

/simulations/{simulationReference}

Try it

Update scenario

cURL

```
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>\"}")

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>\"}")
  .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>\"}"

response = http.request(request)
puts response.read_body
```

200

400

401

403

404

500

```
{
  "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>",
  "code": "<string>"
}
```
