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

ID of the scenario

agent_id
string
required

Tuner's numeric agent ID, or your Agent ID from Agent Settings > Agent Connection. Digits-only values are read as the numeric ID.

workspace_id
integer
required

Workspace ID. Find this in Workspace > General Settings.

Body

application/json

Authored fields of a scenario, used to create or update it.

name
string
required

Name of the scenario, up to 200 characters.

Required string length: 1 - 200
Example:

"Customer disputes a charge"

type
enum<string>
required

routine for an ordinary call or pressure for an adversarial, stress-testing call.

Available options:
routine,
pressure
Example:

"routine"

situation
string
required

Description of the situation the simulated caller is in, up to 8000 characters. Must not be blank.

Required string length: 1 - 8000
Example:

"The caller was charged twice for the same order and wants one charge refunded."

goal
string | null

What the caller is trying to achieve, up to 2000 characters.

Maximum string length: 2000
Example:

"Get the duplicate charge refunded."

first_line
string | null

Exact opening line the caller speaks first, up to 500 characters.

Maximum string length: 500
Example:

"Hi, I think I was charged twice for my last order."

stop_condition
string | null

When the caller should hang up, up to 1000 characters.

Maximum string length: 1000
Example:

"The agent confirms the refund or says it cannot be done."

intent_id
integer | null

ID of the call intent this scenario exercises. Must belong to this agent.

Example:

8

target_ai_evaluation
TargetAiEvaluation · object | null

The eval or call outcome this scenario targets. For type eval, value must be the name of one of the agent's PASS_FAIL evals.

tags
string[] | null

Free-form labels for the scenario, up to 20 tags of 50 characters each.

Maximum array length: 20
Maximum string length: 50
Example:

Response

Successful Response

Response schema for a single library scenario.

id
integer
required

Scenario ID.

agent_id
integer
required

ID of the agent the scenario belongs to.

workspace_id
integer
required

ID of the workspace the scenario belongs to.

name
string
required

Name of the scenario.

type
string
required

routine or pressure.

format
string
required

How the caller follows the scenario. Currently always freeform.

origin
string
required

How the scenario entered the library: manual or ai_saved.

situation
string
required

The situation the simulated caller is in.

goal
string | null
required

What the caller is trying to achieve.

first_line
string | null
required

Exact opening line the caller speaks first.

stop_condition
string | null
required

When the caller should hang up.

intent_id
integer | null
required

ID of the call intent the scenario exercises.

target_ai_evaluation
Target Ai Evaluation · object | null
required

The eval or call outcome the scenario targets, as type and value.

tags
string[] | null
required

Free-form labels on the scenario.

source_run_id
integer | null
required

ID of the simulation run the scenario was saved from, if any.

created_at
string<date-time>
required

When the scenario was created.

updated_at
string<date-time>
required

When the scenario was last updated.

last_run
ScenarioExecutionItem · object | null

The scenario's most recent execution. Only populated by List Scenarios; null if the scenario has never been run.