Skip to main content
PUT
Update 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.

Body

application/json

Input schema for hand-authoring a scenario (used by both create and update).

Named "authoring" rather than a generic "Input"/"Create" name because this shape is deliberately restricted to the fields a human can edit -- origin, format, and source_run_id are never part of this request; the endpoints that consume it set those fields themselves (see ScenarioService.create_manual_scenario).

name
string
required
Required string length: 1 - 200
type
enum<string>
required
Available options:
routine,
pressure
situation
string
required
Required string length: 1 - 8000
goal
string | null
Maximum string length: 2000
first_line
string | null
Maximum string length: 500
stop_condition
string | null
Maximum string length: 1000
intent_id
integer | null
target_ai_evaluation
TargetAiEvaluation · object | null
tags
string[] | null
Maximum array length: 20
Maximum string length: 50

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.