---
title: "Evaluate Simulation Variables"
method: POST
path: "/simulations/{simulation_id}/evaluate"
tags: ["Simulations"]
---

# Evaluate Simulation Variables

`POST /simulations/{simulation_id}/evaluate`

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

## Path parameters

- `simulation_id` string, required

## Query parameters

- `target_rows` integer, nullable — Maximum rows per returned variable
- `x_min` number, nullable — Lower x-range bound (inclusive)
- `x_max` number, nullable — Upper x-range bound (inclusive)
- `x_column` string — Column the window applies to

## Request body

- EvaluateVariablesRequest — Request body for evaluating specific variables from a simulation.
  - `variables` string[], required — List of variable names to evaluate from the simulation

## Response `200`

Successful Response

- unknown

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.dev/ionworks/apis/fastapi.md) · [All operations](https://skmtc.dev/ionworks/apis/fastapi/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/ionworks/fastapi/revisions/7337a3cbdaf2/schema)
