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

# Update Simulation

> Endpoint to update a simulation by its ID.



## OpenAPI

````yaml https://api-prod.interactly.ai/api-docs/workflows/api.json patch /workflows/v1/simulations/{simulation_id}
openapi: 3.1.0
info:
  title: Interactly API
  description: API for building interactly.ai services
  version: 1.1.0
  contact:
    name: Interactly
    url: https://interactly.ai
    email: developers@interactly.ai
servers:
  - url: https://api-prod.interactly.ai
    description: API Server
security: []
paths:
  /workflows/v1/simulations/{simulation_id}:
    patch:
      tags:
        - Simulations
      summary: Update Simulation
      description: Endpoint to update a simulation by its ID.
      operationId: workflow_service_update_simulation_v1_simulations__simulation_id__patch
      parameters:
        - name: simulation_id
          in: path
          required: true
          schema:
            $ref: '#/components/schemas/PydanticObjectId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties: true
              title: Body
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimulationResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - bearer: []
components:
  schemas:
    PydanticObjectId:
      type: string
      maxLength: 24
      minLength: 24
      pattern: ^[0-9a-f]{24}$
      example: 5eb7cf5a86d9755df3a6c593
    SimulationResponse:
      properties:
        simulation:
          $ref: '#/components/schemas/SimulationConfigModel'
          description: Single simulation object
      type: object
      required:
        - simulation
      title: SimulationResponse
      description: |-
        Response model for a single simulation.
        Contains a SimulationConfigModel object.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    SimulationConfigModel:
      properties:
        team_id:
          anyOf:
            - type: string
            - type: 'null'
          description: ID of the team that owns this edge
        created_by:
          anyOf:
            - type: string
            - type: 'null'
          description: ID of the user who created this edge
        updated_by:
          anyOf:
            - type: string
            - type: 'null'
          description: ID of the user who last updated this edge
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          type: string
          format: date-time
          title: Updated At
        _id:
          anyOf:
            - $ref: '#/components/schemas/PydanticObjectId'
            - type: 'null'
          description: MongoDB document ObjectID
        simulation_config:
          anyOf:
            - $ref: '#/components/schemas/SimulationConfig-Output'
            - type: 'null'
          description: Simulation Configuration
      type: object
      title: SimulationConfigModel
      description: Stores the simulation configurations in the workflow system.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    SimulationConfig-Output:
      properties:
        logical_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Simulation Logical ID
          description: Unique identifier for the simulation
          input_field_disallowed: true
        status:
          anyOf:
            - $ref: '#/components/schemas/SimulationStatus'
            - type: 'null'
          title: Simulation Status
          description: Current status of the simulation
          default: pending
          input_field_not_visible: true
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Simulation Name
          description: Name of the simulation
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Simulation Description
          description: Description of the simulation
        selected_workflow:
          anyOf:
            - $ref: '#/components/schemas/SimulationWorkflowDetails-Output'
            - type: 'null'
          title: Selected Workflow Details
          description: Details about the selected workflow execution
          input_field_not_visible: true
        counter_workflow:
          anyOf:
            - $ref: '#/components/schemas/SimulationWorkflowDetails-Output'
            - type: 'null'
          title: Counter Workflow Details
          description: Details about the counter workflow execution
          input_field_not_visible: true
        timeout_seconds:
          anyOf:
            - type: integer
            - type: 'null'
          title: Timeout Seconds
          description: Maximum time in seconds to run the simulation
          default: 120
        max_events:
          anyOf:
            - type: integer
            - type: 'null'
          title: Max Events
          description: Maximum number of events to process in the simulation
          default: 3000
        number_of_simulations:
          anyOf:
            - type: integer
            - type: 'null'
          title: Number of Simulations
          description: Number of times to run the simulation
          default: 1
        max_concurrent_runs:
          anyOf:
            - type: integer
            - type: 'null'
          title: Max Concurrent Runs
          description: Maximum number of concurrent simulation runs allowed
          default: 1
        assistant_starts_first:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Assistant Starts First
          description: >-
            If True, the assistant workflow will kick off first, else it will be
            the user workflow.
          default: true
        stop_on_failure:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Stop on Failure
          description: Whether to stop the simulation on failure
          default: false
        run_by:
          anyOf:
            - type: string
            - type: 'null'
          title: Workflow Simulation Initiator
          description: >-
            Identifier of the user or system that initiated the workflow
            simulation
          input_field_not_visible: true
      type: object
      title: SimulationConfig
    SimulationStatus:
      type: string
      enum:
        - pending
        - running
        - completed
        - failed
        - cancelled
      title: SimulationStatus
    SimulationWorkflowDetails-Output:
      properties:
        workflow_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Workflow DB Object ID
          description: DB Object ID of the workflow this simulation is associated with
        version_number:
          anyOf:
            - type: integer
            - type: 'null'
          title: Workflow Version Number
          description: >-
            Version number of the workflow this simulation is associated with. 0
            is the initial version (default).
          default: 0
        version_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Workflow Version Name
          description: Version name of the workflow this simulation is associated with
        dynamic_variables:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Workflow Dynamic Variables
          description: Dynamic variables to apply to the workflow
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Selected Workflow Name
          description: Name of the selected workflow
          input_field_not_visible: true
        total_events:
          anyOf:
            - type: integer
            - type: 'null'
          title: Total Events
          description: Total number of events processed in the selected workflow
          default: 0
          input_field_not_visible: true
        total_nodes:
          anyOf:
            - type: integer
            - type: 'null'
          title: Total Nodes
          description: Total number of nodes in the selected workflow
          default: 0
          input_field_not_visible: true
        total_duration_seconds:
          anyOf:
            - type: integer
            - type: 'null'
          title: Total Duration Seconds
          description: Total duration in seconds for the selected workflow
          default: 0
          input_field_not_visible: true
        run_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Workflow Run ID
          description: Workflow Run ID of the executed workflow
      type: object
      title: SimulationWorkflowDetails
  securitySchemes:
    bearer:
      scheme: bearer
      bearerFormat: Bearer
      type: http
      description: >-
        Retrieve your API Key from [Dashboard API Keys
        Section](https://dashboard.interactly.ai/api-keys).

````