Update a Mobile Phone Number
Update the settings of a specific mobile phone number.
PATCH
/
v2
/
mobile_phone_numbers
/
{id}
JavaScript
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);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)
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"),
)
mobilePhoneNumber, err := client.MobilePhoneNumbers.Update(
context.TODO(),
"id",
telnyx.MobilePhoneNumberUpdateParams{},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", mobilePhoneNumber.Data)
}
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");
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
mobile_phone_number = telnyx.mobile_phone_numbers.update("id")
puts(mobile_phone_number)<?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();
}telnyx mobile-phone-numbers update \
--api-key 'My API Key' \
--id idcurl --request PATCH \
--url https://api.telnyx.com/v2/v2/mobile_phone_numbers/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"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"
}
}
'{
"data": {
"id": "<string>",
"record_type": "mobile_phone_number",
"phone_number": "<string>",
"sim_card_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "<string>",
"connection_id": "<string>",
"connection_name": "<string>",
"connection_type": "<string>",
"mobile_voice_enabled": true,
"tags": [
"<string>"
],
"customer_reference": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"call_forwarding": {
"call_forwarding_enabled": true,
"forwards_to": "<string>"
},
"country_iso_alpha2": "<string>",
"caller_id_name_enabled": true,
"call_recording": {
"inbound_call_recording_enabled": true
},
"cnam_listing": {
"cnam_listing_enabled": true,
"cnam_listing_details": "<string>"
},
"outbound": {
"interception_app_id": "<string>",
"interception_app_name": "<string>"
},
"inbound": {
"interception_app_id": "<string>",
"interception_app_name": "<string>"
}
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
The ID of the mobile phone number
Body
application/json
Available options:
disabled, reject_calls, flag_calls Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Response
Successful response
Show child attributes
Show child attributes
Was this page helpful?
⌘I
JavaScript
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);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)
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"),
)
mobilePhoneNumber, err := client.MobilePhoneNumbers.Update(
context.TODO(),
"id",
telnyx.MobilePhoneNumberUpdateParams{},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", mobilePhoneNumber.Data)
}
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");
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
mobile_phone_number = telnyx.mobile_phone_numbers.update("id")
puts(mobile_phone_number)<?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();
}telnyx mobile-phone-numbers update \
--api-key 'My API Key' \
--id idcurl --request PATCH \
--url https://api.telnyx.com/v2/v2/mobile_phone_numbers/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"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"
}
}
'{
"data": {
"id": "<string>",
"record_type": "mobile_phone_number",
"phone_number": "<string>",
"sim_card_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "<string>",
"connection_id": "<string>",
"connection_name": "<string>",
"connection_type": "<string>",
"mobile_voice_enabled": true,
"tags": [
"<string>"
],
"customer_reference": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"call_forwarding": {
"call_forwarding_enabled": true,
"forwards_to": "<string>"
},
"country_iso_alpha2": "<string>",
"caller_id_name_enabled": true,
"call_recording": {
"inbound_call_recording_enabled": true
},
"cnam_listing": {
"cnam_listing_enabled": true,
"cnam_listing_details": "<string>"
},
"outbound": {
"interception_app_id": "<string>",
"interception_app_name": "<string>"
},
"inbound": {
"interception_app_id": "<string>",
"interception_app_name": "<string>"
}
}
}