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

# List agent versions

> List the version history for an agent, newest first. The newest entry is the agent's current live config; earlier entries are prior states displaced by later saves. Only behavioral config is versioned; identity and cosmetic fields are not.



## OpenAPI

````yaml /api-reference/v1/agents-v1.yaml get /agents/{agent_id}/versions
openapi: 3.0.3
info:
  title: Coval Agents API
  version: 1.0.0
  description: |

    Manage configurations for simulations and evaluations.
  contact:
    name: Coval API Support
    email: support@coval.dev
    url: https://docs.coval.ai
  license:
    name: Proprietary
    url: https://coval.dev/terms
servers:
  - url: https://api.coval.dev/v1
    description: Production API
security:
  - ApiKeyAuth: []
tags:
  - name: Agents
    description: CRUD operations for AI agent configurations
paths:
  /agents/{agent_id}/versions:
    get:
      tags:
        - Agents
      summary: List agent versions
      description: >-
        List the version history for an agent, newest first. The newest entry is
        the agent's current live config; earlier entries are prior states
        displaced by later saves. Only behavioral config is versioned; identity
        and cosmetic fields are not.
      operationId: listAgentVersions
      parameters:
        - name: agent_id
          in: path
          required: true
          schema:
            type: string
            pattern: ^[A-Za-z0-9]{22}$
          description: Agent resource ID
          example: abc123def456ghi789jklm
      responses:
        '200':
          description: Agent version history retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListAgentVersionsResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          description: Agent not found, inactive, or belongs to different organization
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                notFound:
                  $ref: '#/components/examples/AgentNotFoundError'
        '500':
          $ref: '#/components/responses/InternalError'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    ListAgentVersionsResponse:
      type: object
      description: Response for GET /v1/agents/{agent_id}/versions (newest first)
      required:
        - versions
      properties:
        versions:
          type: array
          items:
            $ref: '#/components/schemas/AgentVersionResource'
    ErrorResponse:
      type: object
      description: Standard error response
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
            - details
          properties:
            code:
              type: string
              description: Error code enum
              enum:
                - INVALID_ARGUMENT
                - UNAUTHENTICATED
                - NOT_FOUND
                - ALREADY_EXISTS
                - INTERNAL
              example: INVALID_ARGUMENT
            message:
              type: string
              description: Human-readable error message
              example: Invalid request parameter
            details:
              type: array
              description: Detailed error information
              items:
                type: object
                properties:
                  field:
                    type: string
                    nullable: true
                    description: Field name that caused the error
                    example: page_size
                  description:
                    type: string
                    description: Detailed error description
                    example: page_size must be between 1 and 100
    AgentVersionResource:
      type: object
      description: >-
        A single snapshot of an agent's behavioral config from its version
        history.
      required:
        - name
        - ulid
        - version_number
        - change_type
        - model_type
        - created_by
      properties:
        name:
          type: string
          description: Resource name
          example: agents/abc123def456ghi789jklm/versions/01KKWQYSF737ZN6X1Q1RYX8M2D
        ulid:
          type: string
          description: Version identifier (26-char ULID)
          example: 01KKWQYSF737ZN6X1Q1RYX8M2D
        version_number:
          type: integer
          description: Per-agent monotonic version number, 1-based
          example: 2
        change_type:
          type: string
          description: >-
            How this version came about. A revert is a save whose new state
            mirrors an older version.
          enum:
            - save
            - revert
        label:
          type: string
          nullable: true
          description: Optional user-supplied tag
          example: v1.2 prod
        model_type:
          type: string
          description: Agent model type at snapshot time
        phone_number:
          type: string
          nullable: true
        endpoint:
          type: string
          nullable: true
        metadata:
          type: object
          additionalProperties: true
          nullable: true
        attributes:
          type: object
          additionalProperties: true
          nullable: true
        workflows:
          type: object
          additionalProperties: true
          description: Verbatim workflow-config snapshot
        prompt:
          type: string
          nullable: true
        language:
          type: string
          nullable: true
        test_set_ids:
          type: array
          nullable: true
          items:
            type: string
        metric_ids:
          type: array
          nullable: true
          items:
            type: string
        created_by:
          type: string
          description: Who created this version (user ULID)
        create_time:
          type: string
          format: date-time
          nullable: true
          description: When this version became current
  responses:
    Unauthorized:
      description: Authentication failed
      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
    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
  examples:
    AgentNotFoundError:
      summary: Agent not found
      value:
        error:
          code: NOT_FOUND
          message: Agent not found
          details:
            - field: agent_id
              description: Agent not found or not accessible by your organization
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: API key for authentication

````