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

# Get Scenario Run History

> List every past execution of a library scenario, across all simulation runs.

Powers the scenario detail page's "run history" panel: newest owning run first.
Each execution carries the same raw ingredients the web's `getScenarioVerdict()`
helper already uses to compute pass/fail client-side (`status`, `call_id`,
`duration`, `analysis_stopped`, `evals`, `type`, `target_eval_label`) -- no
pass/fail verdict is computed here.



## OpenAPI

````yaml https://api.usetuner.ai/public/openapi.json get /api/v1/workspaces/{workspace_id}/agents/{agent_id}/scenarios/{scenario_id}/runs
openapi: 3.1.0
info:
  title: My Public API
  version: 1.0.0
servers:
  - url: https://api.usetuner.ai
security: []
tags:
  - name: calls
    x-group: Calls
  - name: workspaces
    x-group: Workspaces
  - name: simulation
    x-group: Simulation
  - name: agent-settings
    x-group: Agent Settings
  - name: agents
    x-group: Agents
  - name: scenarios
    x-group: Scenarios
  - name: traces
    x-group: Traces
  - name: providers
    x-group: Providers
paths:
  /api/v1/workspaces/{workspace_id}/agents/{agent_id}/scenarios/{scenario_id}/runs:
    get:
      tags:
        - scenarios
      summary: Get Scenario Run History
      description: >-
        List every past execution of a library scenario, across all simulation
        runs.


        Powers the scenario detail page's "run history" panel: newest owning run
        first.

        Each execution carries the same raw ingredients the web's
        `getScenarioVerdict()`

        helper already uses to compute pass/fail client-side (`status`,
        `call_id`,

        `duration`, `analysis_stopped`, `evals`, `type`, `target_eval_label`) --
        no

        pass/fail verdict is computed here.
      operationId: >-
        get_scenario_run_history_api_v1_workspaces__workspace_id__agents__agent_id__scenarios__scenario_id__runs_get
      parameters:
        - name: scenario_id
          in: path
          required: true
          schema:
            type: integer
            title: Scenario Id
        - name: agent_id
          in: path
          required: true
          schema:
            type: integer
            description: Tuner's internal numeric ID for the agent.
            title: Agent Id
          description: Tuner's internal numeric ID for the agent.
        - name: workspace_id
          in: path
          required: true
          schema:
            type: integer
            description: Workspace ID. Find this in Workspace > General Settings.
            title: Workspace Id
          description: Workspace ID. Find this in Workspace > General Settings.
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            maximum: 200
            minimum: 1
            default: 50
            title: Limit
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ScenarioExecutionListResponse'
        '401':
          description: Missing or invalid API key.
          content:
            application/json:
              example:
                detail: Not authenticated
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: You do not have access to this workspace.
          content:
            application/json:
              example:
                detail: User does not have access to workspace 42
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Agent or scenario not found.
          content:
            application/json:
              example:
                detail: Scenario with ID 9 not found
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - Bearer: []
components:
  schemas:
    ScenarioExecutionListResponse:
      properties:
        executions:
          items:
            $ref: '#/components/schemas/ScenarioExecutionItem'
          type: array
          title: Executions
      type: object
      title: ScenarioExecutionListResponse
      description: |-
        Response envelope for a library scenario's run history.

        Backs the scenario detail page's "run history" panel
        (`GET /scenarios/{scenario_id}/runs`).
    ErrorResponse:
      properties:
        detail:
          type: string
          title: Detail
          description: Human-readable description of what went wrong.
      type: object
      required:
        - detail
      title: ErrorResponse
      description: Error body returned when a request fails.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ScenarioExecutionItem:
      properties:
        simulation_run_id:
          type: integer
          title: Simulation Run Id
        run_created_at:
          type: string
          format: date-time
          title: Run Created At
        status:
          anyOf:
            - type: string
            - type: 'null'
          title: Status
        duration:
          anyOf:
            - type: number
            - type: 'null'
          title: Duration
        call_id:
          anyOf:
            - type: integer
            - type: 'null'
          title: Call Id
        analysis_stopped:
          type: boolean
          title: Analysis Stopped
        target_eval_label:
          anyOf:
            - type: string
            - type: 'null'
          title: Target Eval Label
        evals:
          items:
            $ref: '#/components/schemas/SimulationCallEvalResult'
          type: array
          title: Evals
        type:
          type: string
          title: Type
        evals_expected:
          type: boolean
          title: Evals Expected
      type: object
      required:
        - simulation_run_id
        - run_created_at
        - status
        - duration
        - call_id
        - analysis_stopped
        - target_eval_label
        - type
        - evals_expected
      title: ScenarioExecutionItem
      description: >-
        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.
    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
    SimulationCallEvalResult:
      properties:
        label:
          type: string
          title: Label
        value:
          anyOf:
            - type: string
            - type: 'null'
          title: Value
        evidence:
          anyOf:
            - type: string
            - type: 'null'
          title: Evidence
      type: object
      required:
        - label
        - value
        - evidence
      title: SimulationCallEvalResult
  securitySchemes:
    Bearer:
      type: http
      description: >-
        Use Tuner API key (tr_api_...) or user session token. Find your API key
        in Workspace Settings > API Keys.
      scheme: bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.