Skip to main content
PATCH
/
phone_numbers
/
{id}
/
actions
/
bundle_status_change
JavaScript
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);
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)
package main

import (
"context"
"fmt"

"github.com/team-telnyx/telnyx-go"
"github.com/team-telnyx/telnyx-go/option"
)

func main() {
client := telnyx.NewClient(
option.WithAPIKey("My API Key"),
)
response, err := client.PhoneNumbers.Actions.ChangeBundleStatus(
context.TODO(),
"1293384261075731499",
telnyx.PhoneNumberActionChangeBundleStatusParams{
BundleID: "5194d8fc-87e6-4188-baa9-1c434bbe861b",
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.Data)
}
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);
}
}
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)
<?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();
}
telnyx phone-numbers:actions change-bundle-status \
--api-key 'My API Key' \
--id 1293384261075731499 \
--bundle-id 5194d8fc-87e6-4188-baa9-1c434bbe861b
curl --request PATCH \
--url https://api.telnyx.com/v2/phone_numbers/{id}/actions/bundle_status_change \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"bundle_id": "5194d8fc-87e6-4188-baa9-1c434bbe861b"
}
'
{
  "data": {
    "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"
  }
}
{
"errors": [
{
"code": "10007",
"title": "Unexpected error",
"detail": "An unexpected error occured.",
"source": {
"pointer": "/base",
"parameter": "<string>"
},
"meta": {
"url": "https://developers.telnyx.com/docs/overview/errors/10015"
}
}
]
}
{
"errors": [
{
"code": "10009",
"title": "Authentication failed",
"detail": "Could not understand the provided credentials.",
"meta": {
"url": "https://developers.telnyx.com/docs/overview/errors/10009"
}
}
]
}
{
"errors": [
{
"code": "10007",
"title": "Unexpected error",
"detail": "An unexpected error occured.",
"source": {
"pointer": "/base",
"parameter": "<string>"
},
"meta": {
"url": "https://developers.telnyx.com/docs/overview/errors/10015"
}
}
]
}
{
"errors": [
{
"code": "10007",
"title": "Unexpected error",
"detail": "An unexpected error occured.",
"source": {
"pointer": "/base",
"parameter": "<string>"
},
"meta": {
"url": "https://developers.telnyx.com/docs/overview/errors/10015"
}
}
]
}
{
"errors": [
{
"code": "10007",
"title": "Unexpected error",
"detail": "An unexpected error occured.",
"source": {
"pointer": "/base",
"parameter": "<string>"
},
"meta": {
"url": "https://developers.telnyx.com/docs/overview/errors/10015"
}
}
]
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

id
string
required

Identifies the resource.

Example:

"1293384261075731499"

Body

application/json
bundle_id
string
required

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.

Response

Phone number bundle status change success

data
object
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"
}