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

# Change the bundle status for a phone number (set to being in a bundle or remove from a bundle)



## OpenAPI

````yaml https://telnyx-openapi-ng.s3.us-east-1.amazonaws.com/numbers-identity/management-config.yml patch /phone_numbers/{id}/actions/bundle_status_change
openapi: 3.1.0
info:
  title: Telnyx Phone Number Management API
  version: 2.0.0
  description: API for managing and configuring phone numbers.
  contact:
    email: support@telnyx.com
servers:
  - url: https://api.telnyx.com/v2
security:
  - bearerAuth: []
paths:
  /phone_numbers/{id}/actions/bundle_status_change:
    patch:
      tags:
        - Phone Number Configurations
      summary: >-
        Change the bundle status for a phone number (set to being in a bundle or
        remove from a bundle)
      operationId: PhoneNumberBundleStatusChange
      parameters:
        - $ref: '#/components/parameters/IntId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PhoneNumberBundleStatusChangeRequest'
      responses:
        '200':
          description: Phone number bundle status change success
          content:
            application/json:
              schema:
                type: object
                title: Phone Number Bundle Status Change
                properties:
                  data:
                    $ref: '#/components/schemas/PhoneNumberWithVoiceSettings'
        '400':
          $ref: '#/components/responses/numbers_BadRequestResponse'
        '401':
          $ref: '#/components/responses/numbers_UnauthorizedResponse'
        '404':
          $ref: '#/components/responses/numbers_NotFoundResponse'
        '422':
          $ref: '#/components/responses/numbers_UnprocessableEntity'
        '500':
          $ref: '#/components/responses/numbers_GenericErrorResponse'
      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 response = await
            client.phoneNumbers.actions.changeBundleStatus('1293384261075731499',
            {
              bundle_id: '5194d8fc-87e6-4188-baa9-1c434bbe861b',
            });


            console.log(response.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
            )
            response = client.phone_numbers.actions.change_bundle_status(
                id="1293384261075731499",
                bundle_id="5194d8fc-87e6-4188-baa9-1c434bbe861b",
            )
            print(response.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\tresponse, err := client.PhoneNumbers.Actions.ChangeBundleStatus(\n\t\tcontext.TODO(),\n\t\t\"1293384261075731499\",\n\t\ttelnyx.PhoneNumberActionChangeBundleStatusParams{\n\t\t\tBundleID: \"5194d8fc-87e6-4188-baa9-1c434bbe861b\",\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", response.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.actions.ActionChangeBundleStatusParams;

            import
            com.telnyx.sdk.models.phonenumbers.actions.ActionChangeBundleStatusResponse;


            public final class Main {
                private Main() {}

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

                    ActionChangeBundleStatusParams params = ActionChangeBundleStatusParams.builder()
                        .id("1293384261075731499")
                        .bundleId("5194d8fc-87e6-4188-baa9-1c434bbe861b")
                        .build();
                    ActionChangeBundleStatusResponse response = client.phoneNumbers().actions().changeBundleStatus(params);
                }
            }
        - lang: Ruby
          source: |-
            require "telnyx"

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

            response = telnyx.phone_numbers.actions.change_bundle_status(
              "1293384261075731499",
              bundle_id: "5194d8fc-87e6-4188-baa9-1c434bbe861b"
            )

            puts(response)
        - 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 {
              $response = $client->phoneNumbers->actions->changeBundleStatus(
                '1293384261075731499', bundleID: '5194d8fc-87e6-4188-baa9-1c434bbe861b'
              );

              var_dump($response);
            } catch (APIException $e) {
              echo $e->getMessage();
            }
        - lang: CLI
          source: |-
            telnyx phone-numbers:actions change-bundle-status \
              --api-key 'My API Key' \
              --id 1293384261075731499 \
              --bundle-id 5194d8fc-87e6-4188-baa9-1c434bbe861b
components:
  parameters:
    IntId:
      name: id
      description: Identifies the resource.
      in: path
      required: true
      schema:
        type: string
        example: '1293384261075731499'
  schemas:
    PhoneNumberBundleStatusChangeRequest:
      type: object
      required:
        - bundle_id
      properties:
        bundle_id:
          type: string
          description: >-
            The new bundle_id setting for the number. If you are assigning the
            number to a bundle, this is the unique ID of the bundle you wish to
            use. If you are removing the number from a bundle, this must be
            null. You cannot assign a number from one bundle to another
            directly. You must first remove it from a bundle, and then assign it
            to a new bundle.
      example:
        bundle_id: 5194d8fc-87e6-4188-baa9-1c434bbe861b
    PhoneNumberWithVoiceSettings:
      type: object
      properties:
        id:
          type: string
          example: '1293384261075731499'
          description: Identifies the type of resource.
          readOnly: true
        record_type:
          type: string
          example: voice_settings
          description: Identifies the type of the resource.
          readOnly: true
        phone_number:
          type: string
          example: '+13035551234'
          description: The phone number in +E164 format.
          readOnly: true
        connection_id:
          type: string
          example: 1d0e6cb8-8668-462e-94c6-49ae0f0ed48b
          description: Identifies the connection associated with this phone number.
        customer_reference:
          type: string
          description: A customer reference string for customer look ups.
          example: MY REF 001
        tech_prefix_enabled:
          type: boolean
          default: false
          example: false
          description: Controls whether a tech prefix is enabled for this phone number.
        translated_number:
          type: string
          example: '+13035559999'
          default: ''
          description: >-
            This field allows you to rewrite the destination number of an
            inbound call before the call is routed to you. The value of this
            field may be any alphanumeric value, and the value will replace the
            number originally dialed.
        call_forwarding:
          $ref: '#/components/schemas/CallForwarding'
        cnam_listing:
          $ref: '#/components/schemas/CnamListing'
        emergency:
          $ref: '#/components/schemas/EmergencySettings'
        usage_payment_method:
          type: string
          enum:
            - pay-per-minute
            - channel
          default: pay-per-minute
          example: pay-per-minute
          description: >-
            Controls whether a number is billed per minute or uses your
            concurrent channels.
        media_features:
          $ref: '#/components/schemas/MediaFeatures'
        call_recording:
          $ref: '#/components/schemas/CallRecording'
        inbound_call_screening:
          type: string
          enum:
            - disabled
            - reject_calls
            - flag_calls
          default: disabled
          description: >-
            The inbound_call_screening setting is a phone number configuration
            option variable that allows users to configure their settings to
            block or flag fraudulent calls. It can be set to disabled,
            reject_calls, or flag_calls. This feature has an additional
            per-number monthly cost associated with it.
      example:
        id: '1293384261075731499'
        record_type: voice_settings
        connection_id: 1d0e6cb8-8668-462e-94c6-49ae0f0ed48b
        customer_reference: customer-reference
        tech_prefix_enabled: false
        translated_number: '+13035559999'
        call_forwarding:
          call_forwarding_enabled: true
          forwards_to: '+13035559123'
          forwarding_type: always
        cnam_listing:
          cnam_listing_enabled: true
          cnam_listing_details: example
        emergency:
          emergency_enabled: true
          emergency_address_id: '1315261609962112019'
          emergency_status: active
        usage_payment_method: pay-per-minute
        media_features:
          rtp_auto_adjust_enabled: true
          accept_any_rtp_packets_enabled: true
          t38_fax_gateway_enabled: true
        call_recording:
          inbound_call_recording_enabled: true
          inbound_call_recording_format: wav
          inbound_call_recording_channels: single
        inbound_call_screening: disabled
    CallForwarding:
      description: The call forwarding settings for a phone number.
      type: object
      properties:
        call_forwarding_enabled:
          type: boolean
          default: true
          description: >-
            Indicates if call forwarding will be enabled for this number if
            forwards_to and forwarding_type are filled in. Defaults to true for
            backwards compatibility with APIV1 use of numbers endpoints.
          example: true
        forwards_to:
          type: string
          description: >-
            The phone number to which inbound calls to this number are
            forwarded. Inbound calls will not be forwarded if this field is left
            blank. If set, must be a +E.164-formatted phone number.
        forwarding_type:
          type: string
          description: >-
            Call forwarding type. 'forwards_to' must be set for this to have an
            effect.
          enum:
            - always
            - on-failure
          example: always
      example:
        call_forwarding_enabled: true
        forwards_to: '+13035559123'
        forwarding_type: always
    CnamListing:
      description: The CNAM listing settings for a phone number.
      type: object
      properties:
        cnam_listing_enabled:
          type: boolean
          default: false
          description: >-
            Enables CNAM listings for this number. Requires cnam_listing_details
            to also be set.
        cnam_listing_details:
          type: string
          description: >-
            The CNAM listing details for this number. Must be alphanumeric
            characters or spaces with a maximum length of 15. Requires
            cnam_listing_enabled to also be set to true.
      example:
        cnam_listing_enabled: true
        cnam_listing_details: example
    EmergencySettings:
      description: The emergency services settings for a phone number.
      type: object
      properties:
        emergency_enabled:
          type: boolean
          default: false
          description: >-
            Allows you to enable or disable emergency services on the phone
            number. In order to enable emergency services, you must also set an
            emergency_address_id.
        emergency_address_id:
          type: string
          description: Identifies the address to be used with emergency services.
        emergency_status:
          type: string
          description: Represents the state of the number regarding emergency activation.
          default: disabled
          enum:
            - disabled
            - active
            - provisioning
            - deprovisioning
            - provisioning-failed
      example:
        emergency_enabled: true
        emergency_address_id: '1315261609962112019'
        emergency_status: active
    MediaFeatures:
      description: The media features settings for a phone number.
      type: object
      properties:
        rtp_auto_adjust_enabled:
          type: boolean
          default: true
          description: >-
            When RTP Auto-Adjust is enabled, the destination RTP address port
            will be automatically changed to match the source of the incoming
            RTP packets.
        accept_any_rtp_packets_enabled:
          type: boolean
          default: false
          description: >-
            When enabled, Telnyx will accept RTP packets from any customer-side
            IP address and port, not just those to which Telnyx is sending RTP.
        t38_fax_gateway_enabled:
          type: boolean
          default: false
          description: >-
            Controls whether Telnyx will accept a T.38 re-INVITE for this phone
            number. Note that Telnyx will not send a T.38 re-INVITE; this option
            only controls whether one will be accepted.
      example:
        rtp_auto_adjust_enabled: true
        accept_any_rtp_packets_enabled: true
        t38_fax_gateway_enabled: true
    CallRecording:
      description: The call recording settings for a phone number.
      type: object
      properties:
        inbound_call_recording_enabled:
          type: boolean
          default: false
          description: When enabled, any inbound call to this number will be recorded.
        inbound_call_recording_format:
          type: string
          enum:
            - wav
            - mp3
          default: wav
          description: The audio file format for calls being recorded.
        inbound_call_recording_channels:
          type: string
          enum:
            - single
            - dual
          default: single
          description: >-
            When using 'dual' channels, final audio file will be stereo recorded
            with the first leg on channel A, and the rest on channel B.
      example:
        inbound_call_recording_enabled: true
        inbound_call_recording_format: wav
        inbound_call_recording_channels: single
    numbers_Errors:
      properties:
        errors:
          type: array
          items:
            $ref: '#/components/schemas/numbers_Error'
      type: object
    numbers_Error:
      properties:
        code:
          type: string
          example: '10007'
        title:
          type: string
          example: Unexpected error
        detail:
          type: string
          example: An unexpected error occured.
        source:
          type: object
          properties:
            pointer:
              description: JSON pointer (RFC6901) to the offending entity.
              type: string
              example: /base
            parameter:
              description: Indicates which query parameter caused the error.
              type: string
        meta:
          type: object
          properties:
            url:
              type: string
              description: URL with additional information on the error.
              example: https://developers.telnyx.com/docs/overview/errors/10015
      type: object
  responses:
    numbers_BadRequestResponse:
      description: >-
        Bad request, the request was unacceptable, often due to missing a
        required parameter.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/numbers_Errors'
    numbers_UnauthorizedResponse:
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/numbers_Errors'
          examples:
            Authentication Failed:
              value:
                errors:
                  - code: '10009'
                    title: Authentication failed
                    detail: Could not understand the provided credentials.
                    meta:
                      url: https://developers.telnyx.com/docs/overview/errors/10009
    numbers_NotFoundResponse:
      description: The requested resource doesn't exist.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/numbers_Errors'
    numbers_UnprocessableEntity:
      description: Unprocessable entity. Check the 'detail' field in response for details.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/numbers_Errors'
    numbers_GenericErrorResponse:
      description: Unexpected error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/numbers_Errors'
  securitySchemes:
    bearerAuth:
      scheme: bearer
      type: http

````