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

> Lists the agent's phone numbers and the environment each one answers from. A number answers from an environment, and the environment decides the version, so deploying to an environment changes what callers on its number hear. An agent has at most one number per environment; outbound calls use the `prod` number.



## OpenAPI

````yaml /api-reference/openapi.json get /v2/voice-agents/{voiceAgentId}/phone-numbers/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}/phone-numbers/environments:
    get:
      summary: List which environment each phone number answers from
      description: >-
        Lists the agent's phone numbers and the environment each one answers
        from. A number answers from an environment, and the environment decides
        the version, so deploying to an environment changes what callers on its
        number hear. An agent has at most one number per environment; outbound
        calls use the `prod` number.
      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:
                      bindings:
                        type: array
                        items:
                          $ref: '#/components/schemas/AgentEnvironmentNumberBinding'
        '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:
    AgentEnvironmentNumberBinding:
      type: object
      properties:
        phoneNumberId:
          type: string
          format: uuid
          example: c7e5a3b1-9d8f-4e6c-a2b4-1f3e5d7c9a0b
        number:
          type: string
          example: '+14155550100'
        label:
          type: string
          example: Support line
        agentId:
          type: string
          format: uuid
          example: d949f13f-40d2-4e48-ac86-b66633070603
        environmentId:
          type: string
          format: uuid
          nullable: true
          description: Environment the number answers from. `null` means `prod`.
          example: 5b9d1e7f-2c3a-4f8b-8d16-7e9f0a1b2c3d
        environment:
          type: string
          enum:
            - dev
            - staging
            - prod
          description: Name of that environment.
          example: staging
    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
  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.