Skip to contentSkip to navigationSkip to topbar
Page toolsOn this page
Looking for more inspiration?Visit the

VoiceNumber Resource


On this reference page, you'll learn the methods and pricing details available through the VoiceNumber Resource. See Related how-to documentation to learn the steps to use the info on this page.


Number Properties

number-properties page anchor
Property nameTypeRequiredPIIDescriptionChild properties
destinationNumberstring<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.


originationNumberstring<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.


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

Optional

The list of OutboundCallPriceWithOrigin records.


inboundCallPriceobject<inbound-call-price>

Optional

The InboundCallPrice record.


priceUnitstring<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 pricing information for a specific destination and, optionally, origination phone numberLink to code sample: Fetch pricing information for a specific destination and, optionally, origination phone 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();

Response

Note about this response
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
}