Update a Mobile Phone Number
Update the settings of a specific mobile phone number.
PATCH
/
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 response = await client.mobilePhoneNumbers.update('id', {
customer_reference: 'customer_reference',
});
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.mobile_phone_numbers.update(
id="id",
customer_reference="customer_reference",
)
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"),
)
mobilePhoneNumber, err := client.MobilePhoneNumbers.Update(
context.TODO(),
"id",
telnyx.MobilePhoneNumberUpdateParams{
CustomerReference: telnyx.String("customer_reference"),
},
)
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;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
MobilePhoneNumberUpdateParams params = MobilePhoneNumberUpdateParams.builder()
.customerReference("customer_reference")
.build();
var response = client.mobilePhoneNumbers().update("id", params);
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
response = telnyx.mobile_phone_numbers.update("id", customer_reference: "customer_reference")
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->mobilePhoneNumbers->update(
'id',
customer_reference: 'customer_reference',
);
var_dump($response);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx mobile-phone-numbers update \
--api-key 'My API Key' \
--id id \
--customer-reference customer_referencecurl --request PATCH \
--url https://api.telnyx.com/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>",
"forwarding_type": "always"
},
"country_iso_alpha2": "<string>",
"noise_suppression": "inbound",
"inbound_call_screening": "disabled",
"caller_id_name_enabled": true,
"call_recording": {
"inbound_call_recording_enabled": true,
"inbound_call_recording_channels": "single",
"inbound_call_recording_format": "wav"
},
"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
Body
application/json
Was this page helpful?
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.mobilePhoneNumbers.update('id', {
customer_reference: 'customer_reference',
});
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.mobile_phone_numbers.update(
id="id",
customer_reference="customer_reference",
)
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"),
)
mobilePhoneNumber, err := client.MobilePhoneNumbers.Update(
context.TODO(),
"id",
telnyx.MobilePhoneNumberUpdateParams{
CustomerReference: telnyx.String("customer_reference"),
},
)
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;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
MobilePhoneNumberUpdateParams params = MobilePhoneNumberUpdateParams.builder()
.customerReference("customer_reference")
.build();
var response = client.mobilePhoneNumbers().update("id", params);
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
response = telnyx.mobile_phone_numbers.update("id", customer_reference: "customer_reference")
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->mobilePhoneNumbers->update(
'id',
customer_reference: 'customer_reference',
);
var_dump($response);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx mobile-phone-numbers update \
--api-key 'My API Key' \
--id id \
--customer-reference customer_referencecurl --request PATCH \
--url https://api.telnyx.com/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>",
"forwarding_type": "always"
},
"country_iso_alpha2": "<string>",
"noise_suppression": "inbound",
"inbound_call_screening": "disabled",
"caller_id_name_enabled": true,
"call_recording": {
"inbound_call_recording_enabled": true,
"inbound_call_recording_channels": "single",
"inbound_call_recording_format": "wav"
},
"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>"
}
}
}