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

# Update a Mobile Phone Number

> Update the settings of a specific mobile phone number.



## OpenAPI

````yaml /openapi/source/external/mobile_phone_numbers/mobile_phone_numbers.json patch /v2/mobile_phone_numbers/{id}
openapi: 3.1.0
info:
  version: 2.0.0
  x-latency-category: responsive
  x-endpoint-cost: light
  title: Telnyx API
  description: SIP trunking, SMS, MMS, Call Control and Telephony Data Services.
  contact:
    email: support@telnyx.com
servers:
  - url: https://api.telnyx.com/v2
    description: Version 2.0.0 of the Telnyx API
security:
  - bearerAuth: []
tags:
  - name: Mobile Phone Numbers
    description: Mobile phone number operations
paths:
  /v2/mobile_phone_numbers/{id}:
    patch:
      tags:
        - Mobile Phone Numbers
      summary: Update a Mobile Phone Number
      description: Update the settings of a specific mobile phone number.
      operationId: updateMobilePhoneNumber
      parameters:
        - name: id
          in: path
          required: true
          description: The ID of the mobile phone number
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MobilePhoneNumberUpdate'
            example:
              noise_suppression: false
              inbound_call_screening: disabled
              caller_id_name_enabled: false
              tags:
                - string
              call_forwarding:
                forwarding_type: always
                call_forwarding_enabled: false
              cnam_listing:
                cnam_listing_enabled: false
              call_recording:
                inbound_call_recording_enabled: false
                inbound_call_recording_channels: single
                inbound_call_recording_format: wav
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/MobilePhoneNumber'
        '422':
          description: Unprocessable Entity
      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 mobilePhoneNumber = await
            client.mobilePhoneNumbers.update('id');


            console.log(mobilePhoneNumber.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
            )
            mobile_phone_number = client.mobile_phone_numbers.update(
                id="id",
            )
            print(mobile_phone_number.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\tmobilePhoneNumber, err := client.MobilePhoneNumbers.Update(\n\t\tcontext.TODO(),\n\t\t\"id\",\n\t\ttelnyx.MobilePhoneNumberUpdateParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", mobilePhoneNumber.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.mobilephonenumbers.MobilePhoneNumberUpdateParams;

            import
            com.telnyx.sdk.models.mobilephonenumbers.MobilePhoneNumberUpdateResponse;


            public final class Main {
                private Main() {}

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

                    MobilePhoneNumberUpdateResponse mobilePhoneNumber = client.mobilePhoneNumbers().update("id");
                }
            }
        - lang: Ruby
          source: |-
            require "telnyx"

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

            mobile_phone_number = telnyx.mobile_phone_numbers.update("id")

            puts(mobile_phone_number)
        - lang: PHP
          source: >-
            <?php


            require_once dirname(__DIR__) . '/vendor/autoload.php';


            use Telnyx\Client;

            use Telnyx\Core\Exceptions\APIException;


            $client = new Client(apiKey: getenv('TELNYX_API_KEY') ?: 'My API
            Key');


            try {
              $mobilePhoneNumber = $client->mobilePhoneNumbers->update(
                'id',
                callForwarding: [
                  'callForwardingEnabled' => true,
                  'forwardingType' => 'always',
                  'forwardsTo' => 'forwards_to',
                ],
                callRecording: [
                  'inboundCallRecordingChannels' => 'single',
                  'inboundCallRecordingEnabled' => true,
                  'inboundCallRecordingFormat' => 'wav',
                ],
                callerIDNameEnabled: true,
                cnamListing: [
                  'cnamListingDetails' => 'cnam_listing_details',
                  'cnamListingEnabled' => true,
                ],
                connectionID: 'connection_id',
                customerReference: 'customer_reference',
                inbound: ['interceptionAppID' => 'interception_app_id'],
                inboundCallScreening: 'disabled',
                noiseSuppression: true,
                outbound: ['interceptionAppID' => 'interception_app_id'],
                tags: ['string'],
              );

              var_dump($mobilePhoneNumber);
            } catch (APIException $e) {
              echo $e->getMessage();
            }
        - lang: CLI
          source: |-
            telnyx mobile-phone-numbers update \
              --api-key 'My API Key' \
              --id id
components:
  schemas:
    MobilePhoneNumberUpdate:
      type: object
      properties:
        customer_reference:
          type:
            - string
            - 'null'
        connection_id:
          type:
            - string
            - 'null'
        noise_suppression:
          type: boolean
        inbound_call_screening:
          type: string
          enum:
            - disabled
            - reject_calls
            - flag_calls
        caller_id_name_enabled:
          type: boolean
        tags:
          type: array
          items:
            type: string
        inbound:
          type: object
          properties:
            interception_app_id:
              type:
                - string
                - 'null'
              description: >-
                The ID of the CallControl or TeXML Application that will
                intercept inbound calls.
              x-format: int64
        outbound:
          type: object
          properties:
            interception_app_id:
              type:
                - string
                - 'null'
              description: >-
                The ID of the CallControl or TeXML Application that will
                intercept outbound calls.
              x-format: int64
        call_forwarding:
          type: object
          properties:
            call_forwarding_enabled:
              type: boolean
            forwards_to:
              type:
                - string
                - 'null'
            forwarding_type:
              type:
                - string
                - 'null'
              enum:
                - always
                - on-failure
        cnam_listing:
          type: object
          properties:
            cnam_listing_enabled:
              type: boolean
            cnam_listing_details:
              type:
                - string
                - 'null'
        call_recording:
          type: object
          properties:
            inbound_call_recording_enabled:
              type: boolean
            inbound_call_recording_channels:
              type: string
              enum:
                - single
                - dual
            inbound_call_recording_format:
              type: string
              enum:
                - wav
                - mp3
    MobilePhoneNumber:
      type: object
      properties:
        id:
          type: string
          description: Identifies the resource.
          readOnly: true
        record_type:
          type: string
          description: Identifies the type of the resource.
          example: mobile_phone_number
          readOnly: true
        phone_number:
          type: string
          description: The +E.164-formatted phone number.
          readOnly: true
        sim_card_id:
          type: string
          description: The ID of the SIM card associated with this number.
          format: uuid
          readOnly: true
        status:
          type: string
          description: The status of the phone number.
          readOnly: true
        connection_id:
          type:
            - string
            - 'null'
          description: The ID of the connection associated with this number.
          x-format: int64
        connection_name:
          type:
            - string
            - 'null'
          description: The name of the connection.
          readOnly: true
        connection_type:
          type:
            - string
            - 'null'
          description: The type of the connection.
          readOnly: true
        mobile_voice_enabled:
          type: boolean
          description: Indicates if mobile voice is enabled.
          readOnly: true
        tags:
          type: array
          items:
            type: string
          description: A list of tags associated with the number.
        customer_reference:
          type:
            - string
            - 'null'
          description: A customer reference string.
        created_at:
          type: string
          format: date-time
          description: ISO 8601 formatted date indicating when the resource was created.
          readOnly: true
        updated_at:
          type: string
          format: date-time
          description: >-
            ISO 8601 formatted date indicating when the resource was last
            updated.
          readOnly: true
        call_forwarding:
          type: object
          properties:
            call_forwarding_enabled:
              type: boolean
            forwards_to:
              type:
                - string
                - 'null'
            forwarding_type:
              type:
                - string
                - 'null'
              enum:
                - always
                - on-failure
        country_iso_alpha2:
          type: string
          description: The ISO 3166-1 alpha-2 country code of the number.
          readOnly: true
        noise_suppression:
          type: string
          description: The noise suppression setting.
          enum:
            - inbound
            - outbound
            - both
            - disabled
        inbound_call_screening:
          type:
            - string
            - 'null'
          description: The inbound call screening setting.
          enum:
            - disabled
            - reject_calls
            - flag_calls
        caller_id_name_enabled:
          type: boolean
          description: Indicates if caller ID name is enabled.
        call_recording:
          type: object
          properties:
            inbound_call_recording_enabled:
              type: boolean
            inbound_call_recording_channels:
              type: string
              enum:
                - single
                - dual
            inbound_call_recording_format:
              type: string
              enum:
                - wav
                - mp3
        cnam_listing:
          type: object
          properties:
            cnam_listing_enabled:
              type: boolean
            cnam_listing_details:
              type:
                - string
                - 'null'
        outbound:
          type: object
          properties:
            interception_app_id:
              type:
                - string
                - 'null'
              description: The ID of the app that will intercept outbound calls.
              x-format: int64
            interception_app_name:
              type:
                - string
                - 'null'
              description: The name of the app that will intercept outbound calls.
              readOnly: true
        inbound:
          type: object
          properties:
            interception_app_id:
              type:
                - string
                - 'null'
              description: The ID of the app that will intercept inbound calls.
              x-format: int64
            interception_app_name:
              type:
                - string
                - 'null'
              description: The name of the app that will intercept inbound calls.
              readOnly: true
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````