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

# List Agent Versions

> Lists the agent's versions, newest first. An agent that has none gets version 1 (its current config) on the first call. Without `limit` every version is returned. To read a version's full config, call Get Voice Agent with `version`. How versions work: every agent edit goes into **your own draft** (Update Voice Agent and Save Agent Draft write to it). A draft becomes a **version** when a project member publishes it in the dashboard; API keys can propose a draft but not publish. 



## OpenAPI

````yaml /api-reference/openapi.json get /v2/voice-agents/{voiceAgentId}/versions
openapi: 3.0.1
info:
  title: Hamsa API
  description: >-
    The Hamsa API: voice agents and their calls, phone numbers, batch calls and
    knowledge bases; speech to text, text to speech, voices and AI content.
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.tryhamsa.com
security: []
paths:
  /v2/voice-agents/{voiceAgentId}/versions:
    get:
      summary: List agent versions
      description: >-
        Lists the agent's versions, newest first. An agent that has none gets
        version 1 (its current config) on the first call. Without `limit` every
        version is returned. To read a version's full config, call Get Voice
        Agent with `version`. How versions work: every agent edit goes into
        **your own draft** (Update Voice Agent and Save Agent Draft write to
        it). A draft becomes a **version** when a project member publishes it in
        the dashboard; API keys can propose a draft but not publish. 
      parameters:
        - in: path
          name: voiceAgentId
          required: true
          description: ID of the voice agent.
          schema:
            type: string
            format: uuid
            example: fc6f158b-24c2-45a6-957b-c57c0a8979b5
        - in: query
          name: limit
          required: false
          description: Page size (1-100).
          schema:
            type: integer
            minimum: 1
            maximum: 100
            example: 20
        - in: query
          name: before
          required: false
          description: >-
            Return versions older than this version number (the previous page's
            `nextBefore`).
          schema:
            type: integer
            minimum: 1
            example: 3
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: success
                  data:
                    type: object
                    properties:
                      versions:
                        type: array
                        items:
                          $ref: '#/components/schemas/AgentVersion'
                      total:
                        type: integer
                        description: Number of versions.
                        example: 4
                      currentVersionNumber:
                        type: integer
                        description: The newest version number.
                        example: 4
                      liveVersionNumbers:
                        type: array
                        items:
                          type: integer
                        example:
                          - 3
                        description: >-
                          Numbers of the versions callers hear, newest first:
                          one, or two during an A/B test. Present on every page,
                          even when those versions are on another page. Empty
                          when no version holds what callers hear yet.
                      nextBefore:
                        type: integer
                        nullable: true
                        description: >-
                          Only with `limit`: pass it as `before` to get the next
                          page. `null` on the last page.
                        example: 2
        '400':
          description: Invalid request (for example a missing or invalid field).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentVersionError'
        '401':
          description: 'Unauthorized: missing or invalid API key.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentVersionError'
        '403':
          description: Your API key or role does not have the `agents:read` permission.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentVersionError'
        '404':
          description: Voice agent not found in this project.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentVersionError'
        '500':
          description: Server Side Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentVersionError'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    AgentVersion:
      type: object
      description: >-
        A published version: a frozen copy of the agent's config. Versions are
        permanent.
      properties:
        id:
          type: string
          format: uuid
          description: Version ID.
          example: 3b9e2c71-8f4d-4a6b-9c1e-2d7f5a8b0c34
        agentId:
          type: string
          format: uuid
          example: fc6f158b-24c2-45a6-957b-c57c0a8979b5
        versionNumber:
          type: integer
          description: 'Version number: 1, 2, 3... Numbers are never reused.'
          example: 4
        versionLabel:
          type: string
          description: Short name. Left out when the version has none.
          example: Arabic greeting
        changeSummary:
          type: string
          description: What changed. Left out when the version has none.
          example: Rewrote the opening line.
        createdBy:
          $ref: '#/components/schemas/AgentVersionActor'
          description: Who published it.
        publishedBy:
          $ref: '#/components/schemas/AgentVersionActor'
          description: Same as `createdBy`.
        sources:
          type: array
          description: >-
            The proposed drafts it was published from, in the order applied.
            Left out when none.
          items:
            type: object
            properties:
              draftId:
                type: string
                format: uuid
                example: 9a4c1e6b-2f3d-4b8a-8e7c-5d1f0a2b3c47
              author:
                $ref: '#/components/schemas/AgentVersionActor'
        createdAt:
          type: string
          format: date-time
          example: '2026-10-28T09:15:00.000Z'
        status:
          type: string
          enum:
            - APPROVED
            - PENDING
          description: >-
            `APPROVED`: can be deployed. `PENDING`: waiting for approval, cannot
            be deployed.
          example: APPROVED
        isCurrentVersion:
          type: boolean
          description: >-
            `true` for the newest version. It is not necessarily the version
            callers hear: see `isLive`.
          example: true
        isLive:
          type: boolean
          example: false
          description: >-
            `true` when callers hear this version: prod serves it (both versions
            during an A/B test). `false` otherwise. After a roll back, an older
            version is live and the newest is not.
    AgentVersionError:
      type: object
      properties:
        code:
          type: integer
          description: Service error code (8400, 8403, 8404, 8409, ...).
          example: 8409
        message:
          type: string
          example: >-
            Your draft changed in another tab or through your API key. Reload it
            and try again.
        messageKey:
          type: string
          description: Stable error key.
          example: DraftStaleRevision
        params:
          type: object
          additionalProperties: true
          description: >-
            Details. `reason` names the case (for example `STALE_REVISION`,
            `NO_DRAFT`, `SESSION_ONLY`); `action` names a missing permission
            (for example `agents:deploy`).
          example:
            reason: STALE_REVISION
            revision: e2f7a9c3-6b1d-4e5f-a8c2-7d3b9f0e1a56
    AgentVersionActor:
      type: object
      description: A project member.
      properties:
        id:
          type: string
          format: uuid
          example: b7d9e979-4a16-437b-8571-4ed92a94faa8
        name:
          type: string
          example: Sara Ahmad
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: >-
        Pass the API key in the Authorization header, You need to put Token
        keyword before the API key. e.g. 'Authorization: Token <api-key>'

````

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