Personas
Create scenario from transcript
Create a scenario draft by analyzing a conversation transcript. The system uses LLM to extract user intent, conversation goals, and user characteristics from the transcript, then generates an appropriate persona package.
The endpoint supports:
- Fetching transcript via sessionId from analytics service (RPC call)
- Direct transcript content via transcriptContent
- Optional flow context for enhanced persona generation
- Content safety validation (warnings only, non-blocking)
Priority: If both sessionId and transcriptContent are provided, sessionId takes precedence.
Returns a complete persona package and metadata about the analysis.
POST
/
personas
/
from-transcript
curl --request POST \
--url https://api-trial.cognigy.ai/testing/personas/from-transcript \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"projectReference": "683ef2a378a878cc6550f78b",
"sessionId": "session-8f9046b1-6f80-474c-9ce7-24866dbd7cf3",
"flowId": "683ef3d978a878cc6550fb9d",
"numberOfSuccessCriteria": 5
}
'{
"success": true,
"personaPackage": {
"simulationName": "Account Unlock Request",
"personaName": "Frustrated Traveler",
"personaDescription": "A business traveler who is tech-savvy but stressed due to being locked out of their account before an important flight. Communicates directly and expects quick resolutions.",
"mission": "Unlock the account quickly to access booking information for an upcoming flight",
"successCriteria": [
{
"name": "Account Unlocked",
"text": "User successfully regains access to their account"
},
{
"name": "Booking Confirmed",
"text": "User can view and confirm their flight booking details"
},
{
"name": "Security Verified",
"text": "Account security is verified and strengthened"
}
]
},
"metadata": {
"transcriptSummary": "8-turn conversation (4 user, 4 bot): \"Hi, I need help unlocking my account. I have a flight in 2 hours...\"",
"analysisTimestamp": "2024-10-22T10:00:43.000Z",
"warnings": [],
"turnCount": 8,
"extractedIntents": [
"Unlock account",
"Access flight booking",
"Verify travel details"
],
"messages": [
{
"source": "user",
"content": "Hi, I need help unlocking my account. I have a flight in 2 hours and I cannot access my booking.",
"timestamp": "2024-10-22T10:00:00.000Z"
},
{
"source": "bot",
"content": "Hello! I can help you unlock your account. Can you please provide me with your email address?",
"timestamp": "2024-10-22T10:00:05.000Z"
},
{
"source": "user",
"content": "My email is traveler@example.com",
"timestamp": "2024-10-22T10:00:15.000Z"
},
{
"source": "bot",
"content": "Thank you. I have found your account. For security purposes, can you verify your date of birth?",
"timestamp": "2024-10-22T10:00:20.000Z"
},
{
"source": "user",
"content": "January 15, 1985",
"timestamp": "2024-10-22T10:00:30.000Z"
},
{
"source": "bot",
"content": "Perfect. Your account has been unlocked. You should now be able to access your booking.",
"timestamp": "2024-10-22T10:00:35.000Z"
},
{
"source": "user",
"content": "Thank you! Can you confirm my flight details?",
"timestamp": "2024-10-22T10:00:45.000Z"
},
{
"source": "bot",
"content": "Your flight is scheduled for today at 12:00 PM, Flight AB123 to New York.",
"timestamp": "2024-10-22T10:00:50.000Z"
}
]
}
}Authorizations
bearerAuthapiKeyAuth
Body
application/json
⌘I
curl --request POST \
--url https://api-trial.cognigy.ai/testing/personas/from-transcript \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"projectReference": "683ef2a378a878cc6550f78b",
"sessionId": "session-8f9046b1-6f80-474c-9ce7-24866dbd7cf3",
"flowId": "683ef3d978a878cc6550fb9d",
"numberOfSuccessCriteria": 5
}
'{
"success": true,
"personaPackage": {
"simulationName": "Account Unlock Request",
"personaName": "Frustrated Traveler",
"personaDescription": "A business traveler who is tech-savvy but stressed due to being locked out of their account before an important flight. Communicates directly and expects quick resolutions.",
"mission": "Unlock the account quickly to access booking information for an upcoming flight",
"successCriteria": [
{
"name": "Account Unlocked",
"text": "User successfully regains access to their account"
},
{
"name": "Booking Confirmed",
"text": "User can view and confirm their flight booking details"
},
{
"name": "Security Verified",
"text": "Account security is verified and strengthened"
}
]
},
"metadata": {
"transcriptSummary": "8-turn conversation (4 user, 4 bot): \"Hi, I need help unlocking my account. I have a flight in 2 hours...\"",
"analysisTimestamp": "2024-10-22T10:00:43.000Z",
"warnings": [],
"turnCount": 8,
"extractedIntents": [
"Unlock account",
"Access flight booking",
"Verify travel details"
],
"messages": [
{
"source": "user",
"content": "Hi, I need help unlocking my account. I have a flight in 2 hours and I cannot access my booking.",
"timestamp": "2024-10-22T10:00:00.000Z"
},
{
"source": "bot",
"content": "Hello! I can help you unlock your account. Can you please provide me with your email address?",
"timestamp": "2024-10-22T10:00:05.000Z"
},
{
"source": "user",
"content": "My email is traveler@example.com",
"timestamp": "2024-10-22T10:00:15.000Z"
},
{
"source": "bot",
"content": "Thank you. I have found your account. For security purposes, can you verify your date of birth?",
"timestamp": "2024-10-22T10:00:20.000Z"
},
{
"source": "user",
"content": "January 15, 1985",
"timestamp": "2024-10-22T10:00:30.000Z"
},
{
"source": "bot",
"content": "Perfect. Your account has been unlocked. You should now be able to access your booking.",
"timestamp": "2024-10-22T10:00:35.000Z"
},
{
"source": "user",
"content": "Thank you! Can you confirm my flight details?",
"timestamp": "2024-10-22T10:00:45.000Z"
},
{
"source": "bot",
"content": "Your flight is scheduled for today at 12:00 PM, Flight AB123 to New York.",
"timestamp": "2024-10-22T10:00:50.000Z"
}
]
}
}