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

# Get Suggested Fix

> Fetch the suggestion for a failed test attempt. Poll this every couple of seconds after requesting one: `status` stays `running` while it is being prepared and becomes `ready` when `result` holds the suggestion. `failed` means it could not be prepared; request a new one.



## OpenAPI

````yaml GET /test-suites/{id}/attempts/{attemptId}/suggest-fix
openapi: 3.1.0
info:
  title: RevRing Voice AI API
  description: >-
    RevRing Voice AI platform API for managing AI voice agents, phone calls, SIP
    trunks, and analytics. Build intelligent voice applications that can handle
    inbound and outbound phone calls with AI-powered conversational agents.
  version: 1.0.0
  contact:
    name: RevRing Support
    url: https://revring.ai
servers:
  - url: https://api.revring.ai/v1
    description: Production API
security:
  - apiKeyAuth: []
tags:
  - name: Messaging Connections
    description: Connect messaging providers so agents can send text messages
  - name: Messages
    description: Send text messages and read your message log
  - name: Conversations
    description: List and clear managed conversation threads
  - name: SIP Trunks
    description: Manage SIP trunks for connecting agents to the phone network
  - name: Agents
    description: Manage AI voice agents and their configuration
  - name: Agent Folders
    description: Organize agents into folders for dashboard navigation
  - name: Calls
    description: Manage and query phone calls
  - name: Analytics
    description: Get analytics and metrics about your calls
  - name: Knowledge Bases
    description: >-
      Manage knowledge bases and sources for agent retrieval-augmented
      generation
  - name: Test Suites
    description: Manage test suites, test cases, and test runs for agent evaluation
  - name: Voices
    description: Browse the voices available to your organization for agent speech
paths:
  /test-suites/{id}/attempts/{attemptId}/suggest-fix:
    parameters:
      - name: id
        in: path
        required: true
        description: Test suite ID
        schema:
          type: string
          format: uuid
      - name: attemptId
        in: path
        required: true
        description: Test attempt ID, from a test run's `attempts`
        schema:
          type: string
          format: uuid
    get:
      tags:
        - Test Suites
      summary: Get Suggested Fix
      description: >-
        Fetch the suggestion for a failed test attempt. Poll this every couple
        of seconds after requesting one: `status` stays `running` while it is
        being prepared and becomes `ready` when `result` holds the suggestion.
        `failed` means it could not be prepared; request a new one.
      operationId: getSuggestedFix
      responses:
        '200':
          description: Current state of the suggestion
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/SuggestedFix'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '404':
          $ref: '#/components/responses/NotFoundError'
components:
  schemas:
    SuggestedFix:
      type: object
      description: A proposed prompt change that would make a failed test pass.
      properties:
        status:
          type: string
          enum:
            - idle
            - running
            - ready
            - failed
          description: >-
            `idle` = none requested for this attempt. `running` = being
            prepared. `ready` = `result` holds the suggestion. `failed` = could
            not be prepared, request another.
        result:
          type: object
          nullable: true
          description: The suggestion. Present when `status` is `ready`, otherwise null.
          properties:
            analysis:
              type: string
              description: Why the test failed
            changesSummary:
              type: array
              items:
                type: string
              description: Plain-language summary of what was changed
            suggestedPrompt:
              type: string
              description: The complete corrected prompt, ready to save to the agent
            currentPrompt:
              type: string
              description: >-
                The agent prompt the suggestion was written against, for
                comparison
            rubricIssues:
              type: array
              items:
                type: string
              description: Problems found in the test's pass criteria, if any
  responses:
    UnauthorizedError:
      description: Authentication required or API key invalid
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: string
                example: unauthorized
    NotFoundError:
      description: Resource not found
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: string
                example: not_found
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        API key for authentication. Generate API keys from the RevRing
        dashboard.

````