Get persona options (mission types and persona types) - Cognigy Documentation
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Get persona options (mission types and persona types)
POST /personas/options
cURL
curl --request POST \
--url https://api-trial.cognigy.ai/testing/personas/options \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '\n{\n "flowId": "<string>",\n "aiagentReferenceId": "<string>",\n "jobNodeId": "<string>"\n}\n'
Python
import requests
url = "https://api-trial.cognigy.ai/testing/personas/options"
payload = {
"flowId": "<string>",
"aiagentReferenceId": "<string>",
"jobNodeId": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)
JavaScript (Fetch)
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({flowId: '<string>', aiagentReferenceId: '<string>', jobNodeId: '<string>'})
};
fetch('https://api-trial.cognigy.ai/testing/personas/options', 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/personas/options",\
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([\
'flowId' => '<string>',\
'aiagentReferenceId' => '<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;
}
?>
Go
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api-trial.cognigy.ai/testing/personas/options"
payload := strings.NewReader("{\n \"flowId\": \"<string>\",\n \"aiagentReferenceId\": \"<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))
}
Responses
HTTP Status Codes:
200: Persona options retrieved successfully400: Bad request401: Unauthorized403: Forbidden500: Internal server error
Example Response (Success)
{
"simulationName": "<string>",
"missionTypes": [
{
"name": "<string>",
"description": "<string>",
"successCriteria": [
{
"name": "<string>",
"description": "<string>"
}
]
}
],
"personaTypes": [
{
"name": "<string>",
"description": "<string>"
}
]
}
Example Response (Error)
{
"error": "<string>",
"field": "<string>",
"code": "<string>",
"traceId": "<string>"
}