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

# List Agent Versions



## OpenAPI

````yaml /api-v2.json get /agents/{agent_id}/versions
openapi: 3.1.0
info:
  title: Meibel AI API
  summary: Meibel Gateway Service
  description: >-
    Our API allows you to interact with our services. Read the
    [docs](https://docs.meibel.ai) to learn how to use it.
  version: 0.6.4
servers:
  - url: https://api.meibel.ai/v2
    description: Meibel API (v2)
  - url: https://api.dev.meibel.ai/v2
    description: Meibel Dev API (v2)
  - url: http://localhost:8000/v2
    description: Local Development
security: []
tags:
  - name: Datasources
    description: v2 datasource management
  - name: Data Elements
    description: v2 data element CRUD and search
  - name: File Upload
    description: Upload files to a datasource and track upload progress
  - name: Ingest
    description: Trigger and monitor datasource ingestion
  - name: Datasource Downloads
    description: Export all datasource content as a zip archive
  - name: Table Descriptions
    description: v2 table and column descriptions
  - name: Metadata Model Catalog
    description: v2 metadata model catalog
  - name: Confidence Scoring
    description: v2 confidence scoring jobs and summaries
  - name: Documents
    description: Parse and transform documents into structured data
  - name: Agents
    description: Agent definition management
  - name: Sessions
    description: Agent session (execution) management and chat
  - name: Execution Policies
    description: Data access and tool usage constraints scoped to agent sessions
  - name: Artifact Schemas
    description: Agent artifact schema management
paths:
  /agents/{agent_id}/versions:
    get:
      tags:
        - Agents
      summary: List Agent Versions
      operationId: listAgentVersions
      parameters:
        - name: agent_id
          in: path
          required: true
          schema:
            type: string
            title: Agent Id
        - name: published
          in: query
          required: false
          schema:
            anyOf:
              - type: boolean
              - type: 'null'
            description: >-
              If true, return only published versions. If omitted, return all
              versions.
            title: Published
          description: >-
            If true, return only published versions. If omitted, return all
            versions.
        - name: offset
          in: query
          required: false
          schema:
            type: integer
            minimum: 0
            description: Number of items to skip
            default: 0
            title: Offset
          description: Number of items to skip
        - name: limit
          in: query
          required: false
          schema:
            anyOf:
              - type: integer
                minimum: 1
              - type: 'null'
            description: Maximum number of items to return
            title: Limit
          description: Maximum number of items to return
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentVersionListResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
      x-codeSamples:
        - lang: Python
          label: Python
          source: |-
            import os
            from meibel import MeibelClient

            client = MeibelClient(api_key=os.environ["MEIBEL_API_KEY"])

            agent_id = "agent_5f3a1c9e"

            for version in client.agents.list_versions(agent_id=agent_id):
                print(f"{version.version} - {version.display_name} (published: {version.is_published})")
        - lang: TypeScript
          label: TypeScript
          source: >-
            const client = new MeibelClient({ apiKey: process.env.MEIBEL_API_KEY
            });


            const agentId = "agent_abc123";


            for await (const version of client.agents.listVersions(agentId)) {
              console.log(`${version.version} - ${version.display_name} (published: ${version.is_published})`);
            }
        - lang: Go
          label: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\n\t\"github.com/meibel-ai/meibel-go/v2\"\n)\n\nfunc main() {\n\tclient := v2.NewClient(v2.WithAPIKey(os.Getenv(\"MEIBEL_API_KEY\")))\n\n\titer := client.Agents.ListVersions(context.Background(), \"agent_abc123\")\n\tfor iter.Next() {\n\t\tversion := iter.Current()\n\t\tfmt.Printf(\"%s (%s) published=%v\\n\", version.DisplayName, version.Version, version.IsPublished)\n\t}\n\tif err := iter.Err(); err != nil {\n\t\tpanic(err)\n\t}\n}"
components:
  schemas:
    AgentVersionListResponse:
      properties:
        data:
          items:
            $ref: '#/components/schemas/AgentVersionSummary'
          type: array
          title: Data
        total:
          type: integer
          title: Total
        offset:
          type: integer
          title: Offset
        limit:
          anyOf:
            - type: integer
            - type: 'null'
          title: Limit
      type: object
      required:
        - data
        - total
        - offset
      title: AgentVersionListResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    AgentVersionSummary:
      properties:
        id:
          type: string
          title: Id
        display_name:
          type: string
          title: Display Name
        version:
          type: string
          title: Version
        parent_version:
          anyOf:
            - type: string
            - type: 'null'
          title: Parent Version
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        llm_model:
          type: string
          title: Llm Model
        created_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Created At
        created_by:
          anyOf:
            - type: string
            - type: 'null'
          title: Created By
        is_published:
          type: boolean
          title: Is Published
        published_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Published At
        commit_message:
          anyOf:
            - type: string
            - type: 'null'
          title: Commit Message
      type: object
      required:
        - id
        - display_name
        - version
        - llm_model
        - is_published
      title: AgentVersionSummary
    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
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: Meibel-API-Key

````