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

# Get voicemail

> Returns the voicemail settings for a phone number



## OpenAPI

````yaml https://telnyx-openapi-ng.s3.us-east-1.amazonaws.com/numbers-identity/voicemail.yml get /phone_numbers/{phone_number_id}/voicemail
openapi: 3.1.0
info:
  title: Telnyx Voicemail API
  version: 2.0.0
  description: API for Voicemail.
  contact:
    email: support@telnyx.com
servers:
  - url: https://api.telnyx.com/v2
security:
  - bearerAuth: []
paths:
  /phone_numbers/{phone_number_id}/voicemail:
    parameters:
      - name: phone_number_id
        in: path
        description: The ID of the phone number.
        example: '123455678900'
        required: true
        schema:
          type: string
    get:
      tags:
        - Voicemail
      summary: Get voicemail
      description: Returns the voicemail settings for a phone number
      operationId: GetVoicemail
      responses:
        '200':
          $ref: '#/components/responses/VoicemailResponse'
        '400':
          description: Bad request
        '401':
          description: Unauthorized
        '404':
          description: Resource not found
      x-codeSamples:
        - lang: JavaScript
          source: >-
            import Telnyx from 'telnyx';


            const client = new Telnyx({
              apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
            });


            const voicemail = await
            client.phoneNumbers.voicemail.retrieve('123455678900');


            console.log(voicemail.data);
        - lang: Python
          source: |-
            import os
            from telnyx import Telnyx

            client = Telnyx(
                api_key=os.environ.get("TELNYX_API_KEY"),  # This is the default and can be omitted
            )
            voicemail = client.phone_numbers.voicemail.retrieve(
                "123455678900",
            )
            print(voicemail.data)
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/team-telnyx/telnyx-go\"\n\t\"github.com/team-telnyx/telnyx-go/option\"\n)\n\nfunc main() {\n\tclient := telnyx.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tvoicemail, err := client.PhoneNumbers.Voicemail.Get(context.TODO(), \"123455678900\")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", voicemail.Data)\n}\n"
        - lang: Java
          source: >-
            package com.telnyx.sdk.example;


            import com.telnyx.sdk.client.TelnyxClient;

            import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;

            import
            com.telnyx.sdk.models.phonenumbers.voicemail.VoicemailRetrieveParams;

            import
            com.telnyx.sdk.models.phonenumbers.voicemail.VoicemailRetrieveResponse;


            public final class Main {
                private Main() {}

                public static void main(String[] args) {
                    TelnyxClient client = TelnyxOkHttpClient.fromEnv();

                    VoicemailRetrieveResponse voicemail = client.phoneNumbers().voicemail().retrieve("123455678900");
                }
            }
        - lang: Ruby
          source: |-
            require "telnyx"

            telnyx = Telnyx::Client.new(api_key: "My API Key")

            voicemail = telnyx.phone_numbers.voicemail.retrieve("123455678900")

            puts(voicemail)
        - lang: CLI
          source: |-
            telnyx phone-numbers:voicemail retrieve \
              --api-key 'My API Key' \
              --phone-number-id 123455678900
components:
  responses:
    VoicemailResponse:
      description: Successful response
      content:
        application/json:
          schema:
            type: object
            properties:
              data:
                $ref: '#/components/schemas/VoicemailPrefResponse'
  schemas:
    VoicemailPrefResponse:
      type: object
      example:
        enabled: true
        pin: '1234'
      properties:
        enabled:
          type: boolean
          example: true
          description: Whether voicemail is enabled.
        pin:
          type: string
          example: '1234'
          description: The pin used for the voicemail.
  securitySchemes:
    bearerAuth:
      scheme: bearer
      type: http

````