Bulk generate separated personas and missions - Cognigy Documentation
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
POST /personas/generate-bulk
Try it
Bulk generate separated personas and missions
cURL
curl --request POST \
--url https://api-trial.cognigy.ai/testing/personas/generate-bulk \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"flowReferenceId": "<string>",
"allMissionTypes": [
{
"name": "<string>",
"description": "<string>",
"successCriteria": [
{
"name": "<string>",
"description": "<string>"
}
]
}
],
"allPersonaTypes": [
{
"name": "<string>",
"description": "<string>"
}
],
"numberOfSuccessCriteria": 2,
"requestedPackages": 2,
"projectReference": "<string>"
}
'
Python
import requests
url = "https://api-trial.cognigy.ai/testing/personas/generate-bulk"
payload = {
"flowReferenceId": "<string>",
"allMissionTypes": [
{
"name": "<string>",
"description": "<string>",
"successCriteria": [
{
"name": "<string>",
"description": "<string>"
}
]
}
],
"allPersonaTypes": [
{
"name": "<string>",
"description": "<string>"
}
],
"numberOfSuccessCriteria": 2,
"requestedPackages": 2,
"projectReference": "<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({
flowReferenceId: '<string>',
allMissionTypes: [
{
name: '<string>',
description: '<string>',
successCriteria: [{name: '<string>', description: '<string>'}]
}
],
allPersonaTypes: [{name: '<string>', description: '<string>'}],
numberOfSuccessCriteria: 2,
requestedPackages: 2,
projectReference: '<string>'
})
};
fetch('https://api-trial.cognigy.ai/testing/personas/generate-bulk', 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/personas/generate-bulk",
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([
'flowReferenceId' => '<string>',
'allMissionTypes' => [
[
'name' => '<string>',
'description' => '<string>',
'successCriteria' => [
[
'name' => '<string>',
'description' => '<string>'
]
]
]
],
'allPersonaTypes' => [
[
'name' => '<string>',
'description' => '<string>'
]
],
'numberOfSuccessCriteria' => 2,
'requestedPackages' => 2,
'projectReference' => '<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;
}
Response
Successful requests return a JSON object:
{
"success": true,
"personas": {
"Customer Support Agent": [
{
"simulationName": "Customer Issue Resolution",
"personaName": "Sarah",
"personaDescription": "Experienced support agent..."
}
]
},
"missions": {
"Technical Support": [
{
"mission": "Resolve customer technical issue",
"successCriteria": [
{
"type": "goal",
"params": {
"description": "Issue resolved"
}
}
]
}
]
},
"metadata": {
"requestId": "<string>",
"processedAt": "<string>",
"model": "<string>",
"personaTypesCount": 123,
"missionTypesCount": 123
}
}
Authorizations
Authorization
- type: string
- location: header
- required: JWT Bearer Token for authentication
Query Parameters
projectId
- type: string
- Project identifier (alternative to projectReference in body)
Body
flowReferenceId
- type: string
- required: Flow reference ID for AI agent and tool discovery
allMissionTypes
- type: object[]
- required: All mission types to generate missions for
allPersonaTypes
- type: object[]
- required: All persona types to generate personas for
numberOfSuccessCriteria
- type: integer
- required: Number of success criteria to generate per mission
requestedPackages
- type: integer
- required: Number of packages to generate per type combination
projectReference
- type: string
- Project reference for context identification (alternative to projectId query parameter)
Response
200
- application/json
- Bulk personas and missions generated successfully