Skip to contentSkip to navigationSkip to topbar
On this page

VoiceNumber Resource



Number Properties

number-properties page anchor
Property nameTypeRequiredDescriptionChild properties
destination_numberstring<phone-number>

Optional

Not PII

The destination phone number in E.164 format, which consists of a + followed by the country code and subscriber number.


origination_numberstring<phone-number>

Optional

The origination phone number in [E.164 format, which consists of a + followed by the country code and subscriber number.


countrystring

Optional

The name of the country.


outbound_call_pricesarray[object<outbound-call-price-with-origin>]

Optional

The list of OutboundCallPriceWithOrigin records.


inbound_call_priceobject<inbound-call-price>

Optional

The InboundCallPrice record.


price_unitstring<currency>

Optional

The currency in which prices are measured, specified in ISO 4127(link takes you to an external page) format (e.g. usd, eur, jpy).


urlstring<uri>

Optional

The absolute URL of the resource.


Fetch a VoiceNumber resource

fetch-a-voicenumber-resource page anchor
GET https://pricing.twilio.com/v2/Voice/Numbers/{DestinationNumber}

Path parameters

path-parameters page anchor
Property nameTypeRequiredPIIDescription
DestinationNumberstring<phone-number>required

The destination phone number, in E.164 format, for which to fetch the origin-based voice pricing information. E.164 format consists of a + followed by the country code and subscriber number.

Property nameTypeRequiredPIIDescription
OriginationNumberstring<phone-number>

Optional

The origination phone number, in E.164 format, for which to fetch the origin-based voice pricing information. E.164 format consists of a + followed by the country code and subscriber number.

Fetch a NumberLink to code sample: Fetch a Number
1
// Download the helper library from https://www.twilio.com/docs/node/install
2
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
3
4
// Find your Account SID and Auth Token at twilio.com/console
5
// and set the environment variables. See http://twil.io/secure
6
const accountSid = process.env.TWILIO_ACCOUNT_SID;
7
const authToken = process.env.TWILIO_AUTH_TOKEN;
8
const client = twilio(accountSid, authToken);
9
10
async function fetchVoiceNumber() {
11
const number = await client.pricing.v2.voice.numbers("+11111111111").fetch();
12
13
console.log(number.destinationNumber);
14
}
15
16
fetchVoiceNumber();

Output

1
{
2
"country": "United States",
3
"destination_number": "+11111111111",
4
"inbound_call_price": {
5
"base_price": null,
6
"current_price": null,
7
"number_type": null
8
},
9
"iso_country": "US",
10
"origination_number": "+987654321",
11
"outbound_call_prices": [
12
{
13
"base_price": "0.013",
14
"current_price": "0.013",
15
"origination_prefixes": [
16
"ALL"
17
]
18
}
19
],
20
"price_unit": "USD",
21
"url": "https://pricing.twilio.com/v2/Voice/Numbers/+18001234567"
22
}