## 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.

### Clone scenario

POST  
/simulations/{simulationReference}/clone

```bash
curl --request POST \
  --url https://api-trial.cognigy.ai/testing/simulations/{simulationReference}/clone \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '\n{\n  "name": "<string>"\n}\n'"""
```

```python
import requests

url = "https://api-trial.cognigy.ai/testing/simulations/{simulationReference}/clone"

payload = { "name": "<string>" }
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
```

```javascript
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: JSON.stringify({name: '<string>'})
};

fetch('https://api-trial.cognigy.ai/testing/simulations/{simulationReference}/clone', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
```

```php
<?php

$curl = curl_init();

curl_setopt_array($curl, [\
  CURLOPT_URL => "https://api-trial.cognigy.ai/testing/simulations/{simulationReference}/clone",
  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([\
    'name' => '<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;
}
?>
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

url := "https://api-trial.cognigy.ai/testing/simulations/{simulationReference}/clone"

payload := strings.NewReader("{\n  \"name\": \"<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))
}
```

```java
HttpResponse<String> response = Unirest.post("https://api-trial.cognigy.ai/testing/simulations/{simulationReference}/clone")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"name\": \"<string>\"\n}")
  .asString();
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api-trial.cognigy.ai/testing/simulations/{simulationReference}/clone")

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  \"name\": \"<string>\"\n}"

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

### Response

#### Successful Response 201
```json
{
  "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 Responses
```json
{
  "error": "<string>",
  "field": "<string>",
  "code": "<string>",
  "traceId": "<string>"
}
```

```json
{
  "error": "<string>",
  "code": "<string>",
  "traceId": "<string>"
}
```

#### Authorization

- `Authorization`: JWT Bearer Token for authentication

### Path Parameters

- `simulationReference`: Reference ID of the scenario to clone.

### Query Parameters

- `projectId`: Project identifier (required).

### Body

- `name`: Optional new name for the cloned scenario (application/json).
