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

# Evaluate Simulation Variables

> Evaluate specific variables from a simulation.

This endpoint supports lazy variable evaluation:
- If UCPSolution exists in storage: returns variables already in parquet
- If only simulation_data exists and variables are present: returns from database
- If variables are missing: triggers a re-run job (returns 202 Accepted)

Parameters
----------
simulation_id : str
    ID of the simulation
body : EvaluateVariablesRequest
    Request body with list of variable names to evaluate

Returns
-------
dict
    Dictionary with time_series, steps, and metrics

Raises
------
HTTPException
    202 if re-run is triggered (includes job_id in detail)
    404 if simulation not found



## OpenAPI

````yaml https://api.ionworks.com/openapi.json post /simulations/{simulation_id}/evaluate
openapi: 3.1.0
info:
  title: FastAPI
  version: 0.1.0
servers:
  - url: https://api.ionworks.com
    description: Production
security: []
paths:
  /simulations/{simulation_id}/evaluate:
    post:
      tags:
        - Simulations
      summary: Evaluate Simulation Variables
      description: >-
        Evaluate specific variables from a simulation.


        This endpoint supports lazy variable evaluation:

        - If UCPSolution exists in storage: returns variables already in parquet

        - If only simulation_data exists and variables are present: returns from
        database

        - If variables are missing: triggers a re-run job (returns 202 Accepted)


        Parameters

        ----------

        simulation_id : str
            ID of the simulation
        body : EvaluateVariablesRequest
            Request body with list of variable names to evaluate

        Returns

        -------

        dict
            Dictionary with time_series, steps, and metrics

        Raises

        ------

        HTTPException
            202 if re-run is triggered (includes job_id in detail)
            404 if simulation not found
      operationId: evaluate_simulation_variables_simulations__simulation_id__evaluate_post
      parameters:
        - name: simulation_id
          in: path
          required: true
          schema:
            type: string
            title: Simulation Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EvaluateVariablesRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    EvaluateVariablesRequest:
      properties:
        variables:
          items:
            type: string
          type: array
          title: Variables
          description: List of variable names to evaluate from the simulation
      type: object
      required:
        - variables
      title: EvaluateVariablesRequest
      description: Request body for evaluating specific variables from a simulation.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    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

````