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

# Update Agent Version

> Changes a version's label or change summary. The config of a version never changes.



## OpenAPI

````yaml /api-reference/openapi.json patch /v2/voice-agents/{voiceAgentId}/versions/{versionId}
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/{versionId}:
    patch:
      summary: Rename an agent version
      description: >-
        Changes a version's label or change summary. The config of a version
        never changes.
      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: path
          name: versionId
          required: true
          description: ID of the version (from List Agent Versions).
          schema:
            type: string
            format: uuid
            example: 3b9e2c71-8f4d-4a6b-9c1e-2d7f5a8b0c34
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              description: Send at least one of the two fields.
              properties:
                versionLabel:
                  type: string
                  minLength: 1
                  maxLength: 100
                  description: Short name, 1-100 characters.
                  example: Arabic greeting
                changeSummary:
                  type: string
                  maxLength: 500
                  description: What changed, up to 500 characters.
                  example: Rewrote the opening line.
            examples:
              both:
                summary: Label and summary
                value:
                  versionLabel: Arabic greeting
                  changeSummary: Rewrote the opening line.
              label:
                summary: Label only
                value:
                  versionLabel: Holiday hours
              summary:
                summary: Summary only
                value:
                  changeSummary: Shorter goodbye message.
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: success
                  data:
                    $ref: '#/components/schemas/AgentVersion'
        '400':
          description: >-
            Invalid body, or neither `versionLabel` nor `changeSummary` was
            sent.
          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:publish` permission.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentVersionError'
        '404':
          description: Voice agent or version not found.
          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.