Skip to main content
PATCH
/
phone_numbers
/
{id}
/
voice
JavaScript
import Telnyx from 'telnyx';

const client = new Telnyx({
  apiKey: 'My API Key',
});

const voice = await client.phoneNumbers.voice.update('1293384261075731499');

console.log(voice.data);
{
  "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"
  }
}

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

Updated voice settings for the phone number.

tech_prefix_enabled
boolean
default:false

Controls whether a tech prefix is enabled for this phone number.

translated_number
string

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.

caller_id_name_enabled
boolean
default:false

Controls whether the caller ID name is enabled for this phone number.

call_forwarding
object

The call forwarding settings for a phone number.

Example:
{
"call_forwarding_enabled": true,
"forwards_to": "+13035559123",
"forwarding_type": "always"
}
cnam_listing
object

The CNAM listing settings for a phone number.

Example:
{
"cnam_listing_enabled": true,
"cnam_listing_details": "example"
}
usage_payment_method
enum<string>
default:pay-per-minute

Controls whether a number is billed per minute or uses your concurrent channels.

Available options:
pay-per-minute,
channel
media_features
object

The media features settings for a phone number.

Example:
{
"rtp_auto_adjust_enabled": true,
"accept_any_rtp_packets_enabled": true,
"t38_fax_gateway_enabled": true
}
call_recording
object

The call recording settings for a phone number.

Example:
{
"inbound_call_recording_enabled": true,
"inbound_call_recording_format": "wav",
"inbound_call_recording_channels": "single"
}
inbound_call_screening
enum<string>
default:disabled

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.

Available options:
disabled,
reject_calls,
flag_calls

Response

Successful response with details about a phone number including voice settings.

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