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

# Revert test set version

> Re-apply a prior version's content (config + test-case grid) to the live test set. A revert is forward-only: it mints a new version (change_type=revert) and advances the test set, so the response reflects the test set's new live config. Reverting to the version the test set already points at is rejected with 400. Test cases are not included in the response; fetch them separately via GET /test-cases.



## OpenAPI

````yaml /api-reference/v1/test-sets-v1.yaml post /test-sets/{test_set_id}/versions/{version_id}/revert
openapi: 3.0.3
info:
  title: Test Sets API
  version: 1.0.0
  description: >
    API for managing test sets - collections of test cases for evaluation.


    Test sets organize test cases and can define parameters for test case
    generation.
  contact:
    name: Coval API Support
    url: https://coval.dev
    email: support@coval.dev
servers:
  - url: https://api.coval.dev/v1
    description: Production API
security:
  - apiKey: []
tags:
  - name: Test Sets
    description: Operations for managing test sets
paths:
  /test-sets/{test_set_id}/versions/{version_id}/revert:
    post:
      tags:
        - Test Sets
      summary: Revert test set version
      description: >-
        Re-apply a prior version's content (config + test-case grid) to the live
        test set. A revert is forward-only: it mints a new version
        (change_type=revert) and advances the test set, so the response reflects
        the test set's new live config. Reverting to the version the test set
        already points at is rejected with 400. Test cases are not included in
        the response; fetch them separately via GET /test-cases.
      operationId: revertTestSetVersion
      parameters:
        - name: test_set_id
          in: path
          required: true
          description: Test set ID (8-character ID)
          schema:
            type: string
            minLength: 8
            maxLength: 8
          example: abc12345
        - name: version_id
          in: path
          required: true
          description: ULID of the target version to re-apply
          schema:
            type: string
            minLength: 26
            maxLength: 26
            pattern: ^[0-9A-HJKMNP-TV-Z]{26}$
          example: 01KKWQYSF737ZN6X1Q1RYX8M22
      responses:
        '200':
          description: Test set reverted successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  test_set:
                    $ref: '#/components/schemas/TestSetResource'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalError'
components:
  schemas:
    TestSetResource:
      type: object
      description: |
        Test set resource representation.
      properties:
        name:
          type: string
          description: Resource name in format `test-sets/{id}`
          example: test-sets/abc12345
        id:
          type: string
          description: Test set ID (8-character ID)
          minLength: 8
          maxLength: 8
          example: abc12345
        slug:
          type: string
          description: URL-friendly identifier (unique per organization)
          example: customer-support-scenarios
        display_name:
          type: string
          description: Human-readable test set name
          example: Customer Support Scenarios
        description:
          type: string
          nullable: true
          description: Test set description
          example: Test cases for customer support agent
        test_set_type:
          type: string
          nullable: true
          description: Test set type (e.g., DEFAULT, SCENARIO, TRANSCRIPT, WORKFLOW)
          example: SCENARIO
        test_set_metadata:
          type: object
          description: Additional test set configuration (JSON)
          additionalProperties: true
          example:
            category: support
            priority: high
        parameters:
          type: object
          description: 'Test case parameterization (e.g., {"name": ["Alice", "Bob"]})'
          additionalProperties: true
          example:
            customer_name:
              - Alice
              - Bob
            issue_type:
              - billing
              - technical
        test_case_count:
          type: integer
          description: Number of active test cases (GET endpoint only)
          example: 42
        tags:
          type: array
          description: Tags associated with this test set
          items:
            type: string
          default: []
          example:
            - regression
            - voice
        create_time:
          type: string
          format: date-time
          description: Timestamp when test set was created
          example: '2025-10-14T12:00:00Z'
        update_time:
          type: string
          format: date-time
          nullable: true
          description: Timestamp when test set was last updated
          example: '2025-10-15T14:30:00Z'
    ErrorResponse:
      type: object
      description: Standard error response
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
            - details
          properties:
            code:
              type: string
              description: Machine-readable error code
              example: INVALID_ARGUMENT
            message:
              type: string
              description: Human-readable error message
              example: Invalid request parameters
            details:
              type: array
              description: Detailed error information
              items:
                type: object
                properties:
                  field:
                    type: string
                    description: Field that caused the error
                    example: slug
                  description:
                    type: string
                    description: Description of the error
                    example: slug already exists for this organization
  responses:
    BadRequest:
      description: Invalid request parameters
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error:
              code: INVALID_ARGUMENT
              message: Invalid request parameters
              details:
                - field: display_name
                  description: display_name is required and cannot be empty
    Unauthorized:
      description: Authentication failed or missing API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error:
              code: UNAUTHENTICATED
              message: Authentication failed
              details:
                - field: X-API-Key
                  description: Invalid or missing API key
    NotFound:
      description: Resource not found or doesn't belong to organization
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error:
              code: NOT_FOUND
              message: Test set not found
              details:
                - field: test_set_id
                  description: Test set 'abc12345' not found
    InternalError:
      description: Internal server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error:
              code: INTERNAL
              message: Internal server error
              details:
                - description: An unexpected error occurred while processing the request
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: X-API-Key
      description: Organization API key for authentication

````