> ## 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.

# Create Replay Run

> Start a replay run against one or more voice clip sets.

Plays each clip set's recorded caller turns back byte-identical, placing one call per
clip set and repetition, for inbound and outbound agents alike. Returns 202 while the
calls run asynchronously; poll List Replay Runs for progress.



## OpenAPI

````yaml https://api.usetuner.ai/public/openapi.json post /api/v1/workspaces/{workspace_id}/agents/{agent_id}/replay-runs
openapi: 3.1.0
info:
  title: Tuner API
  description: >-
    Send calls to Tuner and manage agents, evaluation settings, simulations and
    workspace settings.
  version: 1.0.0
servers:
  - url: https://api.usetuner.ai
security: []
tags:
  - name: calls
    description: Send call recordings and transcripts to Tuner and retrieve call details.
    x-group: Calls
  - name: workspaces
    description: >-
      Manage your workspaces, the API keys used to access them, and their PII
      redaction and data retention settings.
    x-group: Workspaces
  - name: simulation
    description: >-
      Run simulated calls against your agents, manage simulation profiles, and
      look up the caller personas and background-noise environments they can
      use.
    x-group: Simulation
  - name: scenarios
    description: Manage the test scenarios that simulated calls follow.
    x-group: Scenarios
  - name: replay-testing
    description: >-
      Replay recorded caller audio against a new version of your agent: upload
      or extract voice clips from real calls, then run them as replay runs.
    x-group: Replay Testing
  - name: agents
    description: Create, update and list the voice agents connected to your workspace.
    x-group: Agents
  - name: agent-settings
    description: >-
      Configure how Tuner evaluates an agent's calls, including evaluations,
      call outcomes, intents, data extraction, rules and alerts, plus the
      agent's SIP and outbound call configuration.
    x-group: Agent Settings
  - name: traces
    description: Send OpenTelemetry traces from your agent to Tuner.
    x-group: Traces
  - name: providers
    description: List the voice providers Tuner can connect to.
    x-group: Providers
paths:
  /api/v1/workspaces/{workspace_id}/agents/{agent_id}/replay-runs:
    post:
      tags:
        - replay-testing
      summary: Create Replay Run
      description: >-
        Start a replay run against one or more voice clip sets.


        Plays each clip set's recorded caller turns back byte-identical, placing
        one call per

        clip set and repetition, for inbound and outbound agents alike. Returns
        202 while the

        calls run asynchronously; poll List Replay Runs for progress.
      operationId: >-
        create_replay_run_api_v1_workspaces__workspace_id__agents__agent_id__replay_runs_post
      parameters:
        - 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.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateReplayRunRequest'
      responses:
        '202':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimulationRunResponse'
        '400':
          description: >-
            One or more `voice_clip_set_ids` are not `ready`, or do not belong
            to this agent.
          content:
            application/json:
              example:
                detail: >-
                  Voice clip set(s) [12, 13] are not ready, or do not belong to
                  this agent.
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Missing or invalid API key.
          content:
            application/json:
              example:
                detail: Not authenticated
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '402':
          description: >-
            The workspace has no credits remaining, or its plan does not include
            simulations.
          content:
            application/json:
              example:
                detail: You have no credits remaining.
              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 not found.
          content:
            application/json:
              example:
                detail: Agent with ID 17 not found
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '409':
          description: A simulation run is already in progress for this agent.
          content:
            application/json:
              example:
                detail: You have a simulation run in progress. Come back later.
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: >-
            The agent has no settings configured, its provider does not support
            simulations for its call direction, `selected_eval_ids` or
            `selected_intent_ids` contains an unknown id, a selected clip set's
            worst-case call duration exceeds `max_call_duration_minutes`, or the
            agent's SIP endpoint could not be reached.
          content:
            application/json:
              example:
                detail: >-
                  Voice clip set 'Angry refund caller' (id=12) has a worst-case
                  call duration of 185000ms, which exceeds the 3-minute cap.
                  Increase max_call_duration_minutes.
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '503':
          description: >-
            The run was created but could not be started (for example, its calls
            could not be queued). The run is marked failed; retry the request.
          content:
            application/json:
              example:
                detail: Could not start the simulation run. Please try again.
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - Bearer: []
components:
  schemas:
    CreateReplayRunRequest:
      properties:
        voice_clip_set_ids:
          items:
            type: integer
          type: array
          maxItems: 10
          minItems: 1
          title: Voice Clip Set Ids
          description: IDs of the voice clip sets to replay, 1 to 10 sets.
          examples:
            - - 5
              - 6
        repeat_count:
          type: integer
          maximum: 20
          minimum: 1
          title: Repeat Count
          description: >-
            Number of times to replay each clip set (1-20). Defaults to 1.
            `len(voice_clip_set_ids) * repeat_count` must be at most 20.
          default: 1
          examples:
            - 2
        max_call_duration_minutes:
          type: integer
          maximum: 12
          minimum: 1
          title: Max Call Duration Minutes
          description: >-
            Maximum length of each replayed call, in minutes (1-12). Defaults to
            3. A clip set whose worst-case call duration exceeds this is
            rejected.
          default: 3
          examples:
            - 3
        selected_eval_ids:
          anyOf:
            - items:
                type: integer
              type: array
            - type: 'null'
          title: Selected Eval Ids
          description: >-
            IDs of `PASS_FAIL` evals to grade the replayed calls with. Omit,
            `null` or `[]` means no evals are run (a latency-only run).
          examples:
            - - 101
              - 102
        selected_intent_ids:
          anyOf:
            - items:
                type: integer
              type: array
            - type: 'null'
          title: Selected Intent Ids
          description: IDs of call intents to detect on the replayed calls.
          examples:
            - - 7
              - 8
        replay_settings:
          anyOf:
            - $ref: '#/components/schemas/ReplaySettingsInput'
            - type: 'null'
          description: >-
            Overrides for the replay's turn-timing. Omitted fields use their
            defaults.
          examples:
            - max_wait_ms: 15000
              silence_ms: 700
      type: object
      required:
        - voice_clip_set_ids
      title: CreateReplayRunRequest
      description: >-
        Request to launch a deterministic replay run against one or more voice
        clip sets.
    SimulationRunResponse:
      properties:
        simulation_run_id:
          type: integer
          title: Simulation Run Id
          description: ID of the new simulation run.
        generated_count:
          type: integer
          title: Generated Count
          description: >-
            Number of test scenarios created so far. 0 for Run AI-Generated
            Scenarios, because generation is asynchronous; the full count for
            replay runs and runs from saved scenarios.
        success:
          type: boolean
          title: Success
          description: Whether the run was accepted.
        caller_persona_id:
          anyOf:
            - type: integer
            - type: 'null'
          title: Caller Persona Id
          description: ID of the caller persona used. Null for replay runs.
        caller_persona:
          anyOf:
            - $ref: '#/components/schemas/CallerPersonaResponse'
            - type: 'null'
          description: The caller persona used. Null for replay runs.
        simulation_profile_id:
          anyOf:
            - type: integer
            - type: 'null'
          title: Simulation Profile Id
          description: ID of the simulation profile used, if one was given.
        simulation_profile_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Simulation Profile Name
          description: Name of the simulation profile used, if one was given.
        simulation_profile_snapshot:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Simulation Profile Snapshot
          description: Copy of the profile's fields as they were when the run started.
        noise_environment_id:
          anyOf:
            - type: integer
            - type: 'null'
          title: Noise Environment Id
          description: ID of the background-noise environment used, if one was given.
        noise_intensity:
          anyOf:
            - type: number
            - type: 'null'
          title: Noise Intensity
          description: Gain applied to the background noise, if noise was used.
        noise_environment:
          anyOf:
            - $ref: '#/components/schemas/NoiseEnvironmentResponse'
            - type: 'null'
          description: The background-noise environment used, if one was given.
      type: object
      required:
        - simulation_run_id
        - generated_count
        - success
      title: SimulationRunResponse
      description: The simulation run that was just started.
    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.
    ReplaySettingsInput:
      properties:
        silence_ms:
          anyOf:
            - type: integer
              maximum: 3000
              minimum: 200
            - type: 'null'
          title: Silence Ms
          description: >-
            Milliseconds of trailing silence that mark the end of the agent's
            turn (200-3000). Defaults to 700.
          examples:
            - 700
        min_speech_ms:
          anyOf:
            - type: integer
              maximum: 2000
              minimum: 50
            - type: 'null'
          title: Min Speech Ms
          description: >-
            Milliseconds of speech required in a turn before trailing silence
            can end it (50-2000). Defaults to 250.
          examples:
            - 250
        inter_turn_delay_ms:
          anyOf:
            - type: integer
              maximum: 5000
              minimum: 0
            - type: 'null'
          title: Inter Turn Delay Ms
          description: >-
            Pause in milliseconds before the caller replies after the agent's
            turn (0-5000). Defaults to 300.
          examples:
            - 300
        max_wait_ms:
          anyOf:
            - type: integer
              maximum: 60000
              minimum: 1000
            - type: 'null'
          title: Max Wait Ms
          description: >-
            Maximum milliseconds to wait for the agent to finish speaking after
            a caller turn (1000-60000). Defaults to 15000.
          examples:
            - 15000
        initial_agent_wait_ms:
          anyOf:
            - type: integer
              maximum: 60000
              minimum: 1000
            - type: 'null'
          title: Initial Agent Wait Ms
          description: >-
            Maximum milliseconds to wait for the agent's opening turn
            (1000-60000). Defaults to 12000.
          examples:
            - 12000
      type: object
      title: ReplaySettingsInput
      description: >-
        Optional overrides for the turn-timing of a replay run. Omitted fields
        use their defaults.
    CallerPersonaResponse:
      properties:
        id:
          type: integer
          title: Id
          description: >-
            Persona ID. Pass as `caller_persona_id` when creating a simulation
            run.
          examples:
            - 1
        name:
          type: string
          title: Name
          description: Display name of the persona.
          examples:
            - English (British)
        language:
          type: string
          title: Language
          description: Language name.
          examples:
            - English
        language_code:
          type: string
          title: Language Code
          description: Language code.
          examples:
            - en
        accent:
          type: string
          title: Accent
          description: Accent identifier.
          examples:
            - British
        label:
          type: string
          title: Label
          description: Short accent label for display.
          examples:
            - UK
        country_code:
          type: string
          title: Country Code
          description: ISO 3166-1 alpha-2 country code of the accent.
          examples:
            - GB
      type: object
      required:
        - id
        - name
        - language
        - language_code
        - accent
        - label
        - country_code
      title: CallerPersonaResponse
      description: >-
        A caller persona: the language and accent a simulated caller speaks
        with.
    NoiseEnvironmentResponse:
      properties:
        id:
          type: integer
          title: Id
          description: >-
            Environment ID. Pass as `noise_environment_id` when creating a
            simulation run.
          examples:
            - 1
        name:
          type: string
          title: Name
          description: Display name of the environment.
          examples:
            - Café
        slug:
          type: string
          title: Slug
          description: Stable text identifier of the environment.
          examples:
            - cafe
      type: object
      required:
        - id
        - name
        - slug
      title: NoiseEnvironmentResponse
      description: One selectable background environment.
  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.