Skip to main content
GET
Get Scenario

Authorizations

Authorization
string
header
required

Use Tuner API key (tr_api_...) or user session token. Find your API key in Workspace Settings > API Keys.

Path Parameters

scenario_id
integer
required
agent_id
integer
required

Tuner's internal numeric ID for the agent.

workspace_id
integer
required

Workspace ID. Find this in Workspace > General Settings.

Response

Successful Response

Response schema for a single library scenario.

id
integer
required
agent_id
integer
required
workspace_id
integer
required
name
string
required
type
string
required
format
string
required
origin
string
required
situation
string
required
goal
string | null
required
first_line
string | null
required
stop_condition
string | null
required
intent_id
integer | null
required
target_ai_evaluation
Target Ai Evaluation · object | null
required
tags
string[] | null
required
source_run_id
integer | null
required
created_at
string<date-time>
required
updated_at
string<date-time>
required
last_run
ScenarioExecutionItem · object | null

One past execution of a library scenario, within one simulation run.

Deliberately its own class rather than a reuse of SimulationCallDetailResponse (app/schemas/simulation_run.py): that model already has a field called scenario_id meaning "the id of the simulation_run_scenarios row" (the execution record itself), which is a different concept from the library scenario.id this endpoint is scoped by. Reusing that model here would silently collide the two meanings under the same field name.

Carries the same raw ingredients as SimulationCallDetailResponse (status, call_id, duration, analysis_stopped, evals, type, target_eval_label) that the web's getScenarioVerdict() helper (voice-ray-web/src/lib/simulation/displayHelpers.ts) already consumes to compute pass/fail client-side -- no server-side verdict is computed here, by design.

Reused as-is (ENG-1541) for ScenarioResponse.last_run, the scenario list's additive "most recent execution" field -- same raw ingredients, one execution either way.