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

# List Agent Versions

> API key permission: Agents (Admin also opens it).



## OpenAPI

````yaml /api-reference/openapi.json get /agents/{agent_id}/versions
openapi: 3.1.0
info:
  title: Neural Factory API
  version: 0.1.0
  description: >-
    The endpoints a program can call with an API key. Exchange the key's secret
    for a token at POST /apikeys/token and send it as a Bearer token.
servers:
  - url: https://api.neuralfactory.ai
    description: SaaS
  - url: https://{apiHost}
    description: 'Enterprise: the API address of your own deployment'
    variables:
      apiHost:
        default: api.example.com
        description: Your deployment's API host
security:
  - bearerAuth: []
tags:
  - name: API keys
  - name: Chat
  - name: Runs
  - name: Agents
  - name: Workflows
  - name: Schedules
  - name: Knowledge bases
  - name: Documents
  - name: Search
  - name: Skills
  - name: Toolkits
  - name: Files
  - name: Interactions
  - name: Usage and billing
  - name: Catalogue
  - name: Browser
  - name: Users
  - name: Groups
  - name: Builds
paths:
  /agents/{agent_id}/versions:
    get:
      tags:
        - Agents
      summary: List Agent Versions
      description: 'API key permission: Agents (Admin also opens it).'
      operationId: list_agent_versions_agents__agent_id__versions_get
      parameters:
        - name: agent_id
          in: path
          required: true
          schema:
            type: string
            title: Agent Id
        - name: page
          in: query
          required: false
          schema:
            type: integer
            minimum: 1
            default: 1
            title: Page
        - name: page_size
          in: query
          required: false
          schema:
            type: integer
            maximum: 100
            minimum: 1
            default: 20
            title: Page Size
        - name: env
          in: query
          required: false
          schema:
            title: Env
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentVersionList'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    AgentVersionList:
      properties:
        items:
          items:
            $ref: '#/components/schemas/AgentVersionListItem'
          type: array
          title: Items
        meta:
          $ref: '#/components/schemas/PaginationMeta'
      type: object
      required:
        - items
        - meta
      title: AgentVersionList
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    AgentVersionListItem:
      properties:
        id:
          type: string
          title: Id
        agent_id:
          type: string
          title: Agent Id
        version_number:
          type: integer
          title: Version Number
        label:
          anyOf:
            - type: string
            - type: 'null'
          title: Label
        created_at:
          type: string
          format: date-time
          title: Created At
        created_by:
          $ref: '#/components/schemas/AgentVersionCreatedBy'
        is_current:
          type: boolean
          title: Is Current
        published_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Published At
        published_by:
          anyOf:
            - $ref: '#/components/schemas/AgentVersionCreatedBy'
            - type: 'null'
      type: object
      required:
        - id
        - agent_id
        - version_number
        - label
        - created_at
        - created_by
        - is_current
      title: AgentVersionListItem
    PaginationMeta:
      properties:
        total:
          type: integer
          title: Total
        page:
          type: integer
          title: Page
        page_size:
          type: integer
          title: Page Size
        total_pages:
          type: integer
          title: Total Pages
      type: object
      required:
        - total
        - page
        - page_size
        - total_pages
      title: PaginationMeta
    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
    AgentVersionCreatedBy:
      properties:
        id:
          type: string
          title: Id
        email:
          type: string
          title: Email
        name:
          type: string
          title: Name
      type: object
      required:
        - id
        - email
        - name
      title: AgentVersionCreatedBy
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        The access_token returned by POST /apikeys/token for an API key's
        secret.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.