> ## 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.

# Update scenario

> Update an existing scenario with new configuration.



## OpenAPI

````yaml https://api-trial.cognigy.ai/testing/openapi/openapi-viewer.json patch /simulations/{simulationReference}
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:
  /simulations/{simulationReference}:
    patch:
      tags:
        - Simulations
      summary: Update scenario
      description: Update an existing scenario with new configuration.
      operationId: updateSimulation
      parameters:
        - name: projectId
          in: query
          required: true
          schema:
            type: string
          description: Project identifier
        - in: path
          name: simulationReference
          required: true
          schema:
            type: string
          description: Reference ID of the scenario
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: Name of the scenario
                persona:
                  type: string
                  description: Persona description
                personaName:
                  type: string
                  description: Name of the persona
                mission:
                  type: string
                  description: Mission description
                successCriteria:
                  type: array
                  description: List of success criteria (structured objects)
                  items:
                    type: object
                    properties:
                      type:
                        type: string
                        description: Success criterion type
                      params:
                        type: object
                        description: Success criterion parameters
                    required:
                      - type
                      - params
                maxTurns:
                  type: integer
                  description: Maximum number of turns
                timeout:
                  type: integer
                  description: Timeout in seconds
                aiAgentReferenceId:
                  type: string
                  description: Reference ID of the AI Agent
                flowReferenceId:
                  type: string
                  description: Reference ID of the Flow
                jobNodeId:
                  type: string
                  description: Job Node ID
      responses:
        '200':
          description: Scenario updated successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    description: Unique identifier for the scenario
                  referenceId:
                    type: string
                    description: Reference ID for the scenario
                  name:
                    type: string
                    description: Name of the scenario
                  persona:
                    type: string
                    description: Persona description
                  personaName:
                    type: string
                    description: Name of the persona
                  mission:
                    type: string
                    description: Mission description
                  successCriteria:
                    type: array
                    description: List of success criteria (structured objects)
                    items:
                      type: object
                      properties:
                        type:
                          type: string
                          description: Success criterion type
                        params:
                          type: object
                          description: Success criterion parameters
                      required:
                        - type
                        - params
                  maxTurns:
                    type: integer
                    description: Maximum number of turns
                  timeout:
                    type: integer
                    description: Timeout in seconds
                  aiAgentReferenceId:
                    type: string
                    description: Reference ID of the AI Agent
                  aiAgentId:
                    type: string
                    description: Database ID of the AI Agent
                  flowReferenceId:
                    type: string
                    description: Reference ID of the Flow
                  flowId:
                    type: string
                    description: Database ID of the Flow
                  jobNodeId:
                    type: string
                    description: Job Node ID
                  organisationReference:
                    type: string
                    description: Organization reference
                  projectReference:
                    type: string
                    description: Project reference
                  createdAt:
                    type: integer
                    format: int64
                    description: Creation timestamp
                  createdBy:
                    type: string
                    description: User who created the scenario
                  updatedAt:
                    type: integer
                    format: int64
                    description: Last update timestamp
                  updatedBy:
                    type: string
                    description: User who last updated the scenario
                  lastChanged:
                    type: integer
                    format: int64
                    description: Last change timestamp
                  lastChangedBy:
                    type: string
                    description: User who made the last change
                required:
                  - id
                  - referenceId
                  - name
                  - persona
                  - personaName
                  - mission
                  - successCriteria
                  - organisationReference
                  - projectReference
                  - createdAt
                  - createdBy
                  - lastChanged
                  - lastChangedBy
        '400':
          description: Bad Request - Invalid input parameters
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Validation error message
                  field:
                    type: string
                    description: Field that failed validation
                  code:
                    type: string
                    description: Validation error code
                  traceId:
                    type: string
                    description: Trace ID for debugging
                required:
                  - error
                  - field
        '401':
          description: Unauthorized - Invalid or missing authentication
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Unauthorized error message
                  code:
                    type: string
                    description: Unauthorized error code
                  traceId:
                    type: string
                    description: Trace ID for debugging
                required:
                  - error
        '403':
          description: Forbidden - Insufficient permissions
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Forbidden error message
                  code:
                    type: string
                    description: Forbidden error code
                  traceId:
                    type: string
                    description: Trace ID for debugging
                required:
                  - error
        '404':
          description: Not Found - Resource not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Not found error message
                  code:
                    type: string
                    description: Not found error code
                  traceId:
                    type: string
                    description: Trace ID for debugging
                required:
                  - error
        '500':
          description: Internal Server Error - Server error
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Error message
                  code:
                    type: string
                    description: Error code
                  traceId:
                    type: string
                    description: Trace ID for debugging
                required:
                  - error
      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

````