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

# Search Runs

> Search an agent's simulation runs by status.

A lighter alternative to List Runs for polling — e.g. checking whether a
just-created run has finished. Returns runs newest first.



## OpenAPI

````yaml https://api.usetuner.ai/public/openapi.json get /api/v1/workspaces/{workspace_id}/agents/{agent_id}/simulation-runs/search
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: agent-settings
    x-group: Agent Settings
  - name: agents
    x-group: Agents
  - name: simulation
    x-group: Simulation
  - name: providers
    x-group: Providers
paths:
  /api/v1/workspaces/{workspace_id}/agents/{agent_id}/simulation-runs/search:
    get:
      tags:
        - simulation
      summary: Search Runs
      description: |-
        Search an agent's simulation runs by status.

        A lighter alternative to List Runs for polling — e.g. checking whether a
        just-created run has finished. Returns runs newest first.
      operationId: >-
        search_simulation_runs_api_v1_workspaces__workspace_id__agents__agent_id__simulation_runs_search_get
      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.
        - name: run_status
          in: query
          required: true
          schema:
            enum:
              - pending
              - running
              - complete
              - partial
              - failed
            type: string
            title: Run Status
        - name: minutes_back
          in: query
          required: false
          schema:
            anyOf:
              - type: integer
                maximum: 10080
                minimum: 1
              - type: 'null'
            title: Minutes Back
        - 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/SimulationRunSearchResponse'
        '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 not found.
          content:
            application/json:
              example:
                detail: Agent with ID 17 not found
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - Bearer: []
components:
  schemas:
    SimulationRunSearchResponse:
      properties:
        simulation_runs:
          items:
            $ref: '#/components/schemas/SimulationRunSearchItem'
          type: array
          title: Simulation Runs
        total:
          type: integer
          title: Total
      type: object
      required:
        - simulation_runs
        - total
      title: SimulationRunSearchResponse
      description: Response envelope for the simulation-run search endpoint.
    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
    SimulationRunSearchItem:
      properties:
        id:
          type: integer
          title: Id
        agent_id:
          type: integer
          title: Agent Id
        status:
          type: string
          title: Status
        functional_count:
          type: integer
          title: Functional Count
        adversarial_count:
          type: integer
          title: Adversarial Count
        generated_count:
          type: integer
          title: Generated Count
        completed_count:
          type: integer
          title: Completed Count
        started_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Started At
        completed_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Completed At
        failure_reason:
          anyOf:
            - type: string
            - type: 'null'
          title: Failure Reason
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          type: string
          format: date-time
          title: Updated At
        caller_persona_id:
          anyOf:
            - type: integer
            - type: 'null'
          title: Caller Persona Id
        caller_persona:
          anyOf:
            - $ref: '#/components/schemas/CallerPersonaResponse'
            - type: 'null'
      type: object
      required:
        - id
        - agent_id
        - status
        - functional_count
        - adversarial_count
        - generated_count
        - completed_count
        - started_at
        - completed_at
        - failure_reason
        - created_at
        - updated_at
        - caller_persona_id
      title: SimulationRunSearchItem
      description: Summary view of a single simulation run returned by the search endpoint.
    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
    CallerPersonaResponse:
      properties:
        id:
          type: integer
          title: Id
        name:
          type: string
          title: Name
        language:
          type: string
          title: Language
        language_code:
          type: string
          title: Language Code
        accent:
          type: string
          title: Accent
        label:
          type: string
          title: Label
        country_code:
          type: string
          title: Country Code
      type: object
      required:
        - id
        - name
        - language
        - language_code
        - accent
        - label
        - country_code
      title: CallerPersonaResponse
  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

````