> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cognigy.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Generate scenarios from uploaded transcripts

> Generate 3 distinct simulation scenarios from previously uploaded and parsed transcript files.
This is the third and final step in the three-step workflow.

The endpoint:
1. Retrieves all uploaded files from Redis for the given requestId
2. Combines all transcript content
3. Validates minimum word count
4. Calls the LLM via RPC to generate 3 scenarios
5. Cleans up Redis data after successful generation

Each generated scenario includes a simulationName, personaName, personaDescription,
mission, and success criteria - ready to be used for creating simulations.




## OpenAPI

````yaml https://api-trial.cognigy.ai/testing/openapi/openapi-viewer.json post /v1/generate-from-transcript
openapi: 3.0.0
info:
  title: SIMULATOR OPENAPI REST-ful-API Reference
  version: 2025.20.0
  description: >

    ### Introduction

    This is the [OpenAPI 3.0](https://swagger.io/specification/) documentation

    of the
    [REST](https://en.wikipedia.org/wiki/Representational_state_transfer)-ful
    SIMULATOR OPENAPI API.


    ### Cross-Origin Resource Sharing

    This API features Cross-Origin Resource Sharing (CORS) implemented in

    compliance with [W3C spec](https://www.w3.org/TR/cors/), which allows

    cross-domain communication from the browser. All responses have a wildcard

    same-origin header which makes the API completely accessible.


    ### Authentication

    SIMULATOR OPENAPI offers following forms of authentication:

    - Bearer Token (JWT)

    - API Key


    ### Error Handling

    This API uses HTTP status codes equal or above 400 to indicate errors. Error

    details are generated in compliance with [RFC 7807 - "Problem Details for
    HTTP APIs"](https://tools.ietf.org/html/rfc7807).


    Every error response contains a traceId, which should be provided to the
    SIMULATOR OPENAPI Technical Support when reporting an error.
  contact:
    name: Cognigy Technical Support
    url: https://www.cognigy.com
    email: support@cognigy.com
  license:
    name: Cognigy Proprietary License
servers:
  - url: https://api-trial.cognigy.ai/testing
    description: Cognigy Service Testing API
security:
  - bearerAuth: []
  - apiKeyAuth: []
tags:
  - name: Simulations
    description: >-
      Simulation management operations - Create, read, update, and delete
      simulations
externalDocs:
  description: SIMULATOR OPENAPI Documentation
  url: https://docs.cognigy.com/docs/service-testing/
paths:
  /v1/generate-from-transcript:
    post:
      tags:
        - Transcript Scenario Generation
      summary: Generate scenarios from uploaded transcripts
      description: >
        Generate 3 distinct simulation scenarios from previously uploaded and
        parsed transcript files.

        This is the third and final step in the three-step workflow.


        The endpoint:

        1. Retrieves all uploaded files from Redis for the given requestId

        2. Combines all transcript content

        3. Validates minimum word count

        4. Calls the LLM via RPC to generate 3 scenarios

        5. Cleans up Redis data after successful generation


        Each generated scenario includes a simulationName, personaName,
        personaDescription,

        mission, and success criteria - ready to be used for creating
        simulations.
      operationId: generateFromTranscript
      parameters:
        - name: projectId
          in: query
          required: false
          schema:
            type: string
          description: Project identifier
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                projectId:
                  type: string
                  description: Project identifier
                requestId:
                  type: string
                  description: >-
                    Request ID from the create-request step (all files uploaded
                    for this request are used)
                flowReference:
                  type: string
                  pattern: ^[a-fA-F0-9]{24}$
                  description: >-
                    Optional flow reference (MongoDB ObjectId) for context-aware
                    generation
                numberOfSuccessCriteria:
                  type: integer
                  minimum: 1
                  maximum: 10
                  description: Number of success criteria per scenario (required, 1-10)
              required:
                - requestId
                - numberOfSuccessCriteria
            example:
              projectId: 683ef2a378a878cc6550f78b
              requestId: a1b2c3d4-e5f6-7890-abcd-ef1234567890
              flowReference: 683ef3d978a878cc6550fb9d
              numberOfSuccessCriteria: 3
      responses:
        '200':
          description: Scenarios generated successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  scenarios:
                    type: array
                    description: 3 generated simulation scenarios
                    items:
                      type: object
                      properties:
                        simulationName:
                          type: string
                          description: Descriptive name for the simulation
                        personaName:
                          type: string
                          description: Role-based persona name
                        personaDescription:
                          type: string
                          description: Detailed persona behavioral profile
                        mission:
                          type: string
                          description: Clear, testable mission objective
                        successCriteria:
                          type: array
                          items:
                            type: object
                            properties:
                              type:
                                type: string
                                enum:
                                  - text
                                  - goalCompleted
                              params:
                                type: object
                                properties:
                                  name:
                                    type: string
                                  text:
                                    type: string
                                required:
                                  - name
                                  - text
                          description: Measurable success criteria
                      required:
                        - simulationName
                        - personaName
                        - personaDescription
                        - mission
                        - successCriteria
                  metadata:
                    type: object
                    properties:
                      requestId:
                        type: string
                      filesProcessed:
                        type: integer
                      totalTextLength:
                        type: integer
                      model:
                        type: string
                      processedAt:
                        type: string
                        format: date-time
                      generationTimeMs:
                        type: integer
                required:
                  - success
                  - scenarios
                  - metadata
              example:
                success: true
                scenarios:
                  - simulationName: Order Status Inquiry
                    personaName: Impatient Online Shopper
                    personaDescription: >-
                      A busy professional who ordered a product 3 days ago and
                      hasn't received shipping updates. They are growing
                      increasingly frustrated and want immediate answers.
                    mission: >-
                      Get a definitive answer about the order status and
                      expected delivery date
                    successCriteria:
                      - type: text
                        params:
                          name: Order Located
                          text: >-
                            The agent successfully locates and identifies the
                            customer's order
                      - type: text
                        params:
                          name: Status Communicated
                          text: >-
                            The current shipping status is clearly communicated
                            to the customer
                      - type: text
                        params:
                          name: Delivery Date Provided
                          text: >-
                            An expected delivery date is provided to the
                            customer
                  - simulationName: Return Process Assistance
                    personaName: Confused Return Requester
                    personaDescription: >-
                      A customer who received a damaged item and wants to return
                      it but is unfamiliar with the return process. They need
                      step-by-step guidance.
                    mission: >-
                      Successfully initiate a return for a damaged item and
                      understand the refund timeline
                    successCriteria:
                      - type: text
                        params:
                          name: Return Initiated
                          text: >-
                            A return request is successfully created for the
                            damaged item
                      - type: text
                        params:
                          name: Process Explained
                          text: >-
                            The return process steps are clearly explained to
                            the customer
                      - type: text
                        params:
                          name: Refund Timeline
                          text: The expected refund timeline is communicated
                  - simulationName: Account Access Recovery
                    personaName: Locked Out Account Holder
                    personaDescription: >-
                      A long-time customer who has been locked out of their
                      account after multiple failed login attempts. They are
                      anxious about accessing recent purchase history.
                    mission: >-
                      Regain access to the locked account and verify recent
                      purchase information
                    successCriteria:
                      - type: text
                        params:
                          name: Identity Verified
                          text: >-
                            The customer's identity is verified through security
                            questions
                      - type: text
                        params:
                          name: Account Unlocked
                          text: >-
                            The account is successfully unlocked and access is
                            restored
                      - type: text
                        params:
                          name: Purchase History
                          text: >-
                            The customer can access their recent purchase
                            history
                metadata:
                  requestId: a1b2c3d4-e5f6-7890-abcd-ef1234567890
                  filesProcessed: 2
                  totalTextLength: 4500
                  model: default
                  processedAt: '2026-02-08T14:35:00.000Z'
                  generationTimeMs: 12500
        '400':
          description: Bad Request - Invalid parameters or insufficient content
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
              examples:
                missingRequestId:
                  value:
                    error: requestId is required
                invalidSuccessCriteria:
                  value:
                    error: >-
                      numberOfSuccessCriteria is required and must be a number
                      between 1 and 10
                insufficientContent:
                  value:
                    error: >-
                      Insufficient transcript content: 50 words found (minimum:
                      100)
        '401':
          description: Unauthorized
        '403':
          description: Forbidden - Insufficient permissions
        '404':
          description: Not Found - Request or file not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
        '504':
          description: Gateway Timeout - Generation timed out
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
              example:
                error: >-
                  Scenario generation timed out. Your uploaded files are still
                  available for retry.
      security:
        - bearerAuth: []
        - apiKeyAuth: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: JWT Bearer Token for authentication
    apiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: API Key for authentication

````