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

> Every voice agent has three environments: `dev`, `staging` and `prod`. Each one runs a version of the agent and has its own values for environment variables, which the agent reads as `{{key}}` (for example an API host that differs between testing and production). `prod` is live: calls and phone numbers not routed elsewhere run there. Returns the three environments with their values and the version each one runs.



## OpenAPI

````yaml /api-reference/openapi.json get /v2/voice-agents/{voiceAgentId}/environments
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:
    get:
      summary: List an agent's environments
      description: >-
        Every voice agent has three environments: `dev`, `staging` and `prod`.
        Each one runs a version of the agent and has its own values for
        environment variables, which the agent reads as `{{key}}` (for example
        an API host that differs between testing and production). `prod` is
        live: calls and phone numbers not routed elsewhere run there. Returns
        the three environments with their values and the version each one runs.
      parameters:
        - in: path
          name: voiceAgentId
          required: true
          description: ID of the voice agent.
          schema:
            type: string
            format: uuid
            example: d949f13f-40d2-4e48-ac86-b66633070603
      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:
                      agentId:
                        type: string
                        format: uuid
                        example: d949f13f-40d2-4e48-ac86-b66633070603
                      environments:
                        type: array
                        items:
                          $ref: '#/components/schemas/AgentEnvironment'
                        description: >-
                          The three environments, in the order `dev`, `staging`,
                          `prod`.
                    example:
                      agentId: d949f13f-40d2-4e48-ac86-b66633070603
                      environments:
                        - id: 3f2a8c4e-1b7d-4e9a-9c25-6d8e0f1a2b3c
                          name: dev
                          isDefault: false
                          isLocked: true
                          revision: e1f2a3b4-c5d6-4e7f-8a9b-0c1d2e3f4a5b
                          variables:
                            - key: api_host
                              value: https://dev.example.com
                          savedBy:
                            id: b7d9e979-4a16-437b-8571-4ed92a94faa8
                            name: Lina Haddad
                          updatedAt: '2026-10-28T09:14:02.000Z'
                          publishedVersionId: a1b2c3d4-5e6f-4a7b-8c9d-0e1f2a3b4c5d
                          deployedBy:
                            id: b7d9e979-4a16-437b-8571-4ed92a94faa8
                            name: Lina Haddad
                          deployedAt: '2026-10-30T15:40:11.000Z'
                        - id: 5b9d1e7f-2c3a-4f8b-8d16-7e9f0a1b2c3d
                          name: staging
                          isDefault: false
                          isLocked: true
                          revision: f2a3b4c5-d6e7-4f8a-9b0c-1d2e3f4a5b6c
                          variables:
                            - key: api_host
                              value: https://staging.example.com
                          savedBy:
                            id: b7d9e979-4a16-437b-8571-4ed92a94faa8
                            name: Lina Haddad
                          updatedAt: '2026-10-28T09:14:02.000Z'
                          publishedVersionId: null
                        - id: 8c4e2a6b-3d9f-4a1c-9e27-0f1b2c3d4e5f
                          name: prod
                          isDefault: true
                          isLocked: true
                          revision: a3b4c5d6-e7f8-4a9b-8c1d-2e3f4a5b6c7d
                          variables:
                            - key: api_host
                              value: https://api.example.com
                          savedBy:
                            id: b7d9e979-4a16-437b-8571-4ed92a94faa8
                            name: Lina Haddad
                          updatedAt: '2026-10-28T09:14:02.000Z'
                          publishedVersionId: a1b2c3d4-5e6f-4a7b-8c9d-0e1f2a3b4c5d
                          deployedBy:
                            id: b7d9e979-4a16-437b-8571-4ed92a94faa8
                            name: Lina Haddad
                          deployedAt: '2026-10-30T15:40:11.000Z'
        '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 in this project.
          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:
    AgentEnvironment:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: Environment ID.
          example: 5b9d1e7f-2c3a-4f8b-8d16-7e9f0a1b2c3d
        name:
          type: string
          enum:
            - dev
            - staging
            - prod
          description: Every agent has exactly these three environments.
          example: staging
        isDefault:
          type: boolean
          description: >-
            `true` for `prod` only: anything not routed to another environment
            runs there.
          example: false
        isLocked:
          type: boolean
          description: 'Always `true`: environments can''t be added, renamed or removed.'
          example: true
        revision:
          type: string
          format: uuid
          description: >-
            ID of the current values. Send it back in `baseRevisions` when you
            save, to detect edits made by someone else.
          example: f2a3b4c5-d6e7-4f8a-9b0c-1d2e3f4a5b6c
        variables:
          type: array
          items:
            $ref: '#/components/schemas/AgentEnvironmentVariable'
          description: The environment's values.
        savedBy:
          $ref: '#/components/schemas/AgentEnvironmentActor'
          description: Who last saved the values.
        updatedAt:
          type: string
          format: date-time
          description: When the values were last saved.
          example: '2026-10-28T09:14:02.000Z'
        publishedVersionId:
          type: string
          format: uuid
          nullable: true
          description: >-
            The version this environment runs. `null` until a version is
            deployed to it.
          example: a1b2c3d4-5e6f-4a7b-8c9d-0e1f2a3b4c5d
        deployedBy:
          $ref: '#/components/schemas/AgentEnvironmentActor'
          description: Who deployed `publishedVersionId`. Absent until then.
        deployedAt:
          type: string
          format: date-time
          description: When `publishedVersionId` was deployed. Absent until then.
          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
    AgentEnvironmentVariable:
      type: object
      required:
        - key
        - value
      properties:
        key:
          type: string
          minLength: 1
          maxLength: 64
          pattern: ^[A-Za-z][A-Za-z0-9_]*$
          description: >-
            Variable name, used as `{{key}}` in the agent. Starts with a letter;
            letters, digits and `_` only. Keys are case-insensitive, can't
            repeat a name the runtime fills in (such as `current_time`,
            `call_id`, `agent_name`, or anything starting with `current_time_`
            or `current_calendar_`), and can't match one of the agent's own
            variables.
          example: api_host
        value:
          type: string
          minLength: 1
          maxLength: 4096
          description: The value in this environment. It can't be empty.
          example: https://staging.example.com
    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.