Stop simulation - Cognigy Documentation
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Stop Simulation Endpoint
POST
/simulations/{simulationReference}/batches/{simulationRunBatchReference}
cURL Example
curl --request POST \
--url https://api-trial.cognigy.ai/testing/simulations/{simulationReference}/batches/{simulationRunBatchReference} \
--header 'Authorization: Bearer <token>'
Python Example
import requests
url = "https://api-trial.cognigy.ai/testing/simulations/{simulationReference}/batches/{simulationRunBatchReference}"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)
JavaScript Example (Fetch)
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api-trial.cognigy.ai/testing/simulations/{simulationReference}/batches/{simulationRunBatchReference}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
PHP Example
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-trial.cognigy.ai/testing/simulations/{simulationReference}/batches/{simulationRunBatchReference}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
?>
Go Example
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api-trial.cognigy.ai/testing/simulations/{simulationReference}/batches/{simulationRunBatchReference}"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}
HTTP Response Codes
- 200: Simulation stop signal sent successfully.
- 400: Bad Request.
- 401: Unauthorized.
- 403: Forbidden.
- 500: Internal Server Error.
Example Success Response
{
"message": "Simulation stop signal sent successfully.",
"simulationRunBatchId": "<string>"
}
Example Error Responses
{
"error": "<string>",
"field": "<string>",
"code": "<string>",
"traceId": "<string>"
}
{
"error": "<string>",
"code": "<string>",
"traceId": "<string>"
}
Authorizations
- Authorization: JWT Bearer Token for authentication. (required)
Path Parameters
- simulationReference: Reference ID of the scenario (required).
- simulationRunBatchReference: Reference ID of the simulation (required).
Query Parameters
- projectId: Project identifier (required).
Response
- 200: Simulation stop signal sent successfully.