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

# Get Environment Deploy History

> Lists every change to what the environment runs, newest first: deploys, rollbacks and A/B test changes. Pages by time: pass the `nextBefore` from one page as `before` to get the next.



## OpenAPI

````yaml /api-reference/openapi.json get /v2/voice-agents/{voiceAgentId}/environments/{environmentId}/history
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}/environments/{environmentId}/history:
    get:
      summary: Get an environment's deploy history
      description: >-
        Lists every change to what the environment runs, newest first: deploys,
        rollbacks and A/B test changes. Pages by time: pass the `nextBefore`
        from one page as `before` to get the next.
      parameters:
        - in: path
          name: voiceAgentId
          required: true
          description: ID of the voice agent.
          schema:
            type: string
            format: uuid
            example: d949f13f-40d2-4e48-ac86-b66633070603
        - in: path
          name: environmentId
          required: true
          description: ID of the environment (from the list of environments).
          schema:
            type: string
            format: uuid
            example: 5b9d1e7f-2c3a-4f8b-8d16-7e9f0a1b2c3d
        - in: query
          name: limit
          required: false
          description: Entries per page (1-100). Default 50.
          schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 50
            example: 20
        - in: query
          name: before
          required: false
          description: >-
            Return entries older than this: the `nextBefore` of the previous
            page, or a UTC time such as `2026-10-21T08:02:45.000Z`.
          schema:
            type: string
            pattern: ^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?Z(_[0-9a-fA-F-]{36})?$
            example: 2026-10-21T08:02:45.000Z_9f8e7d6c-5b4a-4c3d-8e2f-1a0b9c8d7e6f
      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:
                      entries:
                        type: array
                        items:
                          $ref: '#/components/schemas/AgentEnvironmentHistoryEntry'
                      nextBefore:
                        type: string
                        description: Cursor for the next page. Absent on the last page.
                        example: >-
                          2026-10-21T08:02:45.000Z_9f8e7d6c-5b4a-4c3d-8e2f-1a0b9c8d7e6f
        '400':
          description: Invalid query parameters.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSchema'
        '401':
          description: 'Unauthorized: missing or invalid API key.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSchema'
        '403':
          description: Your API key or role does not have the `agents:read` permission.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSchema'
        '404':
          description: Voice agent not found, or the environment is not on this agent.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSchema'
        '500':
          description: Server Side Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSchema'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    AgentEnvironmentHistoryEntry:
      type: object
      properties:
        environmentId:
          type: string
          format: uuid
          example: 8c4e2a6b-3d9f-4a1c-9e27-0f1b2c3d4e5f
        versionId:
          type: string
          format: uuid
          example: a1b2c3d4-5e6f-4a7b-8c9d-0e1f2a3b4c5d
        versionNumber:
          type: integer
          example: 4
        kind:
          type: string
          enum:
            - deploy
            - rollback
            - split_start
            - split_change
            - split_finish
            - split_stop
          description: >-
            `deploy`: a version was deployed. `rollback`: an older version was
            deployed. `split_start`, `split_change`, `split_finish`,
            `split_stop`: an A/B test on `prod` started, changed, finished or
            stopped.
          example: deploy
        split:
          type: object
          description: The A/B test, on `split_*` entries only.
          properties:
            candidateVersionNumber:
              type: integer
              example: 5
            weight:
              type: integer
              description: Share of calls the candidate gets, in percent.
              example: 20
        deployedBy:
          $ref: '#/components/schemas/AgentEnvironmentActor'
        deployedAt:
          type: string
          format: date-time
          example: '2026-10-30T15:40:11.000Z'
    ErrorSchema:
      type: object
      properties:
        code:
          type: integer
          description: >-
            Service error code: the HTTP status with a service prefix (for
            example `8404`). Missing when the service has no code for that
            status.
          example: 8404
        message:
          type: string
          description: >-
            What went wrong. Some services (calls and recordings) put the error
            key here, for example `CallNotFoundOrUnavailable`, and send no
            `messageKey`.
          example: Policy not found!
        messageKey:
          type: string
          description: >-
            Stable key for the error, safe to match on in code. Not returned by
            every service.
          example: PolicyNotFound
        params:
          type: object
          additionalProperties: true
          description: >-
            Details for some errors (for example `reason`). Not returned by
            every service.
          example:
            reason: NO_DRAFT
    AgentEnvironmentActor:
      type: object
      description: A project member.
      properties:
        id:
          type: string
          format: uuid
          example: b7d9e979-4a16-437b-8571-4ed92a94faa8
        name:
          type: string
          example: Lina Haddad
  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.