Toll-Free

View as Markdown

Use this endpoint for the AvailablePhoneNumbers method to find available toll-free numbers in the United States.

Path parameters

AccountSidstringRequiredformat: "uuid"
The Project ID that uniquely identifies the Account to retrieve.
IsoCountrystringRequired
The ISO country code of the number.

Query parameters

AreaCodestringOptional
Find numbers in the provided area code. Only available for numbers in US and Canada.
BetabooleanOptional
New numbers on SignalWire are marked as `beta`.
ContainsstringOptional
Find numbers based off of a pattern. Valid characters are `[0-9a-zA-Z]`.
ExcludeAllAddressRequiredbooleanOptional
Accepted for Twilio compatibility but has no effect on the response.
ExcludeForeignAddressRequiredbooleanOptional
Accepted for Twilio compatibility but has no effect on the response.
ExcludeLocalAddressRequiredbooleanOptional
Accepted for Twilio compatibility but has no effect on the response.
FaxEnabledbooleanOptional
Not supported. Accepted for Twilio API compatibility.
InLocalitystringOptional
Limits search to a city/locality. Requires InRegion to also be set.
InRegionstringOptional
Limits search to same region as number. Must be a two-letter state/province code.
MmsEnabledbooleanOptional
Not supported. Accepted for Twilio API compatibility.
SmsEnabledbooleanOptional
Not supported. Accepted for Twilio API compatibility.
VoiceEnabledbooleanOptional
Not supported. Accepted for Twilio API compatibility.

Response

uristringRequired
The URI for the API call.
available_phone_numberslist of objectsRequired
List of available phone numbers.
Response
1{
2 "uri": "/api/laml/2010-04-01/Accounts/b3877c40-da60-4998-90ad-b792e98472af/AvailablePhoneNumbers/US/Local",
3 "available_phone_numbers": [
4 {
5 "friendly_name": "(253) 218-6751",
6 "phone_number": "+12532186751",
7 "lata": "string",
8 "locality": "string",
9 "rate_center": "AUBURN",
10 "latitude": "string",
11 "longitude": "string",
12 "region": "WA",
13 "postal_code": "string",
14 "iso_country": "US",
15 "capabilities": {
16 "voice": true,
17 "SMS": true,
18 "MMS": true
19 },
20 "beta": false
21 }
22 ]
23}

Request examples

List toll-free numbers

1const { RestClient } = require('@signalwire/compatibility-api')
2const client = RestClient('YourProjectID', 'YourAuthToken', { signalwireSpaceUrl: 'example.signalwire.com' })
3
4client
5 .availablePhoneNumbers('US')
6 .tollFree.list()
7 .then(availablePhoneNumbers => {
8 console.log(availablePhoneNumbers);
9 });

Find a toll-free number by string

Find all toll-free numbers that contain WIN, or 946. Some examples of this include: 800-338-3946 or 888-946-3456.

1const { RestClient } = require('@signalwire/compatibility-api')
2const client = RestClient('YourProjectID', 'YourAuthToken', { signalwireSpaceUrl: 'example.signalwire.com' })
3
4client
5 .availablePhoneNumbers('US')
6 .tollFree.list({
7 contains: 'WIN',
8 })
9 .then(availablePhoneNumbers => {
10 console.log(availablePhoneNumbers);
11 });