Skip to content

Vonage Numbers

github-actions edited this page Apr 22, 2025 · 2 revisions

Documentation


Documentation / Vonage Numbers

Vonage Number SDK for Node.js

GitHub Workflow Status Codecov Latest Release Contributor Covenant License

Vonage

This is the Vonage Number SDK for Node.js for use with Vonage APIs. To use it you will need a Vonage account. Sign up for free at vonage.com.

For full API documentation refer to developer.nexmo.com.

If you are updating from V2 to V3, please check the migration guide found here

Installation

We recommend using this SDK as part of the overall @vonage/server-sdk package. Please see the main package for installation.

You can also use this SDK standalone if you only need access to just the Numbers API.

With NPM

npm install @vonage/numbers

With Yarn

yarn add @vonage/numbers

Usage

As part of the Vonage Server SDK

If you are using this SDK as part of the Vonage Server SDK, you can access it as the numbers property off of the client that you instantiate.

const { Vonage, Auth } = require('@vonage/server-sdk');

const credentials = new Auth({
  apiKey: API_KEY,
  apiSecret: API_SECRET
});
const options = {};
const vonage = new Vonage(credentials, options);

vonage.numbers.getAvailableNumbers()
  .then(resp => console.log(resp))
  .catch(err => console.error(err));

Standalone

The SDK can be used standalone from the main Vonage Server SDK for Node.js if you only need to use the Numbers API. All you need to do is require('@vonage/numbers'), and use the returned object to create your own client.

const { Auth } = require('@vonage/auth');
const { Numbers } = require('@vonage/numbers');

const credentials = new Auth({
  apiKey: API_KEY,
  apiSecret: API_SECRET
});
const options = {};

const numbersClient = new Numbers(credentials, options);

Where credentials is any option from @vonage/auth, and options is any option from @vonage/server-client

Promises

Most methods that interact with the Vonage API uses Promises. You can either resolve these yourself, or use await to wait for a response.

const resp = await vonage.numbers.basicLookup(PHONE_NUMBER)

vonage.numbers.getAvailableNumbers()
  .then(resp => console.log(resp))
  .catch(err => console.error(err));

Testing

Run:

npm run test

Enumerations

Feature

Defined in: numbers/lib/enums/Feature.ts:4

Enumeration of features for a virtual number.

Enumeration Members

Enumeration Member Value Description Defined in
MMS "MMS" Supports Multimedia Messaging Service (MMS). numbers/lib/enums/Feature.ts:8
SMS "SMS" Supports Short Message Service (SMS). numbers/lib/enums/Feature.ts:13
VOICE "VOICE" Supports Voice calling. numbers/lib/enums/Feature.ts:18

LineType

Defined in: numbers/lib/enums/LineType.ts:4

Enumeration of line types for virtual numbers.

Enumeration Members

Enumeration Member Value Description Defined in
LANDLINE "landline" Landline type. numbers/lib/enums/LineType.ts:8
LANDLINE_TOLL_FREE "landline-toll-free" Landline toll-free type. numbers/lib/enums/LineType.ts:18
MOBILE_LVN "mobile-lvn" Mobile LVN (Local Virtual Number) type. numbers/lib/enums/LineType.ts:13

MessagesCallbackTypeEnum

Defined in: numbers/lib/enums/MessagesCallbackTypeEnum.ts:4

Enumeration of messages callback types.

Enumeration Members

Enumeration Member Value Description Defined in
App "app" Callback type for an application. numbers/lib/enums/MessagesCallbackTypeEnum.ts:8

SearchPattern

Defined in: numbers/lib/enums/SearchPattern.ts:4

Enumeration of search patterns.

Enumeration Members

Enumeration Member Value Description Defined in
CONTAINS 1 Indicates a search for values that contain the given pattern. numbers/lib/enums/SearchPattern.ts:13
ENDS_WITH 2 Indicates a search for values that end with the given pattern. numbers/lib/enums/SearchPattern.ts:18
START_WITH 0 Indicates a search for values that start with the given pattern. numbers/lib/enums/SearchPattern.ts:8

VoiceCallbackTypeEnum

Defined in: numbers/lib/enums/VoiceCallbackTypeEnum.ts:4

Enumeration of voice callback types.

Enumeration Members

Enumeration Member Value Description Defined in
App "app" Callback type for an application. numbers/lib/enums/VoiceCallbackTypeEnum.ts:18
Sip "sip" Callback type for SIP. numbers/lib/enums/VoiceCallbackTypeEnum.ts:8
Tel "tel" Callback type for telephone (tel). numbers/lib/enums/VoiceCallbackTypeEnum.ts:13

Classes

Numbers

Defined in: numbers/lib/numbers.ts:123

Client for buying, canceling, and searching for phone numbers.

Examples

Create a standalone Numbers client

import { Numbers } from '@vonage/numbers';

const numbersClient = new Numbers({
 apiKey: VONAGE_API_KEY,
 apiSecret: VONAGE_API_SECRET
});

Create an Numbers client from the Vonage client

import { Vonage } from '@vonage/server-client';

const vonage = new Vonage({
  apiKey: VONAGE_API_KEY,
  apiSecret: VONAGE_API_SECRET
});

const numbersClient = vonage.numbers;

Extends

Constructors

Constructor
new Numbers(credentials, options?): Numbers;

Defined in: server-client/dist/lib/client.d.ts:35

Creates a new instance of the Client.

Parameters
credentials

The authentication credentials or an authentication instance.

AuthParams | AuthInterface

options?

ConfigParams

Optional configuration settings for the client.

Returns

Numbers

Inherited from

Client.constructor

Properties

auth
protected auth: AuthInterface;

Defined in: server-client/dist/lib/client.d.ts:24

The authentication instance responsible for generating authentication headers and query parameters.

Inherited from

Client.auth

authType
protected authType: AuthenticationType = AuthenticationType.BASIC;

Defined in: numbers/lib/numbers.ts:127

See

Client.authType

Overrides

Client.authType

config
protected config: ConfigParams;

Defined in: server-client/dist/lib/client.d.ts:28

Configuration settings for the client, including default hosts for various services and other request settings.

Inherited from

Client.config

transformers
static transformers: object;

Defined in: server-client/dist/lib/client.d.ts:11

Static property containing utility transformers.

camelCaseObjectKeys
camelCaseObjectKeys: PartialTransformFunction;
kebabCaseObjectKeys
kebabCaseObjectKeys: PartialTransformFunction;
omit()
omit: (keys, obj) => TransformedObject;
Parameters
keys

string[]

obj

ObjectToTransform

Returns

TransformedObject

snakeCaseObjectKeys
snakeCaseObjectKeys: PartialTransformFunction;
Inherited from

Client.transformers

Methods

addAuthenticationToRequest()
addAuthenticationToRequest(request): Promise<VetchOptions>;

Defined in: server-client/dist/lib/client.d.ts:43

Adds the appropriate authentication headers or parameters to the request based on the authentication type.

Parameters
request

VetchOptions

The request options to which authentication needs to be added.

Returns

Promise<VetchOptions>

  • The request options with the added authentication.
Inherited from

Client.addAuthenticationToRequest

addBasicAuthToRequest()
protected addBasicAuthToRequest(request): Promise<VetchOptions>;

Defined in: server-client/dist/lib/client.d.ts:71

Adds basic authentication headers to the request.

Parameters
request

VetchOptions

The request options to which authentication needs to be added.

Returns

Promise<VetchOptions>

  • The request options with the added authentication.
Inherited from

Client.addBasicAuthToRequest

addJWTToRequest()
protected addJWTToRequest(request): Promise<VetchOptions>;

Defined in: server-client/dist/lib/client.d.ts:64

Adds a JWT to the request.

Parameters
request

VetchOptions

The request options to which authentication needs to be added.

Returns

Promise<VetchOptions>

  • The request options with the added authentication.
Inherited from

Client.addJWTToRequest

addQueryKeySecretToRequest()
protected addQueryKeySecretToRequest(request): Promise<VetchOptions>;

Defined in: server-client/dist/lib/client.d.ts:57

Adds API key and secret to the request.

Parameters
request

VetchOptions

The request options to which authentication needs to be added.

Returns

Promise<VetchOptions>

  • The request options with the added authentication.
Inherited from

Client.addQueryKeySecretToRequest

addQueryKeySecretToRequestBody()
protected addQueryKeySecretToRequestBody(request): Promise<VetchOptions>;

Defined in: server-client/dist/lib/client.d.ts:50

Adds API key and secret to the request body.

Parameters
request

VetchOptions

The request options to which authentication needs to be added.

Returns

Promise<VetchOptions>

  • The request options with the added authentication.
Inherited from

Client.addQueryKeySecretToRequestBody

buyNumber()
buyNumber(params): Promise<NumbersEmptyResponse>;

Defined in: numbers/lib/numbers.ts:152

Buy a phone number.

Parameters
params

NumbersParams

The parameters for buying a number.

Returns

Promise<NumbersEmptyResponse>

A promise that resolves to an empty response or an error response.

Example

Buy a phone number

import { Country } from '@vonage/numbers';
const resp = await numbersClient.buyNumber({
  country: Country.US,
  msisdn: '15555555555'
});

if (resp.errorCode) {
  console.log(`Error: ${resp.errorCodeLabel}`);
} else {
  console.log('Number bought successfully');
}
cancelNumber()
cancelNumber(params): Promise<NumbersEmptyResponse>;

Defined in: numbers/lib/numbers.ts:188

Cancel a phone number.

Parameters
params

NumbersParams

The parameters for canceling a number.

Returns

Promise<NumbersEmptyResponse>

A promise that resolves to an empty response or an error response.

Example

Cancel a phone number

const resp = await numbersClient.cancelNumber({
 msisdn: '15555555555'
});

if (resp.errorCode) {
  console.log(`Error: ${resp.errorCodeLabel}`);
} else {
  console.log('Number cancled successfully');
}
getAvailableNumbers()
getAvailableNumbers(filter): Promise<NumbersAvailableList>;

Defined in: numbers/lib/numbers.ts:226

Retrieves a list of available phone numbers based on the provided filter criteria.

Parameters
filter

NumbersSearchFilter

The filter criteria for searching available numbers.

Returns

Promise<NumbersAvailableList>

A promise that resolves to a list of available phone numbers or an error response.

Example

Search for available numbers that can send SMS and make voice calls

import { Country, Feature } from '@vonage/numbers';

const resp = await numbersClient.getAvailableNumbers({
  country: Country.US,
  features: [Feature.SMS, Feature.VOICE],
});

console.log(`There are ${resp.count} numbers available`);

for (const number of resp.numbers) {
  console.log(number.msisdn);
  console.log(number.cost);
  console.log(number.type);
}
getConfig()
getConfig(): ConfigParams;

Defined in: server-client/dist/lib/client.d.ts:36

Returns

ConfigParams

Inherited from

Client.getConfig

getOwnedNumbers()
getOwnedNumbers(filter?): Promise<NumbersOwnedList>;

Defined in: numbers/lib/numbers.ts:268

Retrieves a list of owned phone numbers based on the provided filter criteria.

Parameters
filter?

NumbersOwnedFilter

The filter criteria for searching owned numbers.

Returns

Promise<NumbersOwnedList>

A promise that resolves to a list of owned phone numbers or an error response.

Example

Search for owned numbers

const resp = await numbersClient.getOwnedNumbers();
console.log(`There are ${resp.count} numbers owned`);
for (const number of resp.numbers) {
  console.log(number.msisdn);
  console.log(number.type);
}
parseResponse()
protected parseResponse<T>(request, response): Promise<VetchResponse<T>>;

Defined in: server-client/dist/lib/client.d.ts:168

Parses the response based on its content type.

Type Parameters
T

T

The expected type of the parsed response data.

Parameters
request

VetchOptions

The request options.

response

Response

The raw response from the request.

Returns

Promise<VetchResponse<T>>

  • The parsed response.
Inherited from

Client.parseResponse

prepareBody()
protected prepareBody(request): undefined | string;

Defined in: server-client/dist/lib/client.d.ts:158

Prepares the body for the request based on the content type.

Parameters
request

VetchOptions

The request options.

Returns

undefined | string

  • The prepared request body as a string or undefined.
Inherited from

Client.prepareBody

prepareRequest()
protected prepareRequest(request): Promise<VetchOptions>;

Defined in: server-client/dist/lib/client.d.ts:151

Prepares the request with necessary headers, authentication, and query parameters.

Parameters
request

VetchOptions

The initial request options.

Returns

Promise<VetchOptions>

  • The modified request options.
Inherited from

Client.prepareRequest

sendDeleteRequest()
sendDeleteRequest<T>(url): Promise<VetchResponse<T>>;

Defined in: server-client/dist/lib/client.d.ts:78

Sends a DELETE request to the specified URL.

Type Parameters
T

T

Parameters
url

string

The URL endpoint for the DELETE request.

Returns

Promise<VetchResponse<T>>

  • The response from the DELETE request.
Inherited from

Client.sendDeleteRequest

sendFormSubmitRequest()
sendFormSubmitRequest<T>(url, payload?): Promise<VetchResponse<T>>;

Defined in: server-client/dist/lib/client.d.ts:86

Sends a POST request with form data to the specified URL.

Type Parameters
T

T

Parameters
url

string

The URL endpoint for the POST request.

payload?

Record<string, undefined | string>

Optional payload containing form data to send with the POST request.

Returns

Promise<VetchResponse<T>>

  • The response from the POST request.
Inherited from

Client.sendFormSubmitRequest

sendGetRequest()
sendGetRequest<T>(url, queryParams?): Promise<VetchResponse<T>>;

Defined in: server-client/dist/lib/client.d.ts:94

Sends a GET request to the specified URL with optional query parameters.

Type Parameters
T

T

Parameters
url

string

The URL endpoint for the GET request.

queryParams?

Optional query parameters to append to the URL. These should be compatible with Node's URLSearchParams.

Returns

Promise<VetchResponse<T>>

  • The response from the GET request.
Inherited from

Client.sendGetRequest

sendPatchRequest()
sendPatchRequest<T>(url, payload?): Promise<VetchResponse<T>>;

Defined in: server-client/dist/lib/client.d.ts:104

Sends a PATCH request to the specified URL with an optional payload.

Type Parameters
T

T

Parameters
url

string

The URL endpoint for the PATCH request.

payload?

Optional payload to be sent as the body of the PATCH request.

Returns

Promise<VetchResponse<T>>

  • The response from the PATCH request.
Inherited from

Client.sendPatchRequest

sendPostRequest()
sendPostRequest<T>(url, payload?): Promise<VetchResponse<T>>;

Defined in: server-client/dist/lib/client.d.ts:114

Sends a POST request to the specified URL with an optional payload.

Type Parameters
T

T

Parameters
url

string

The URL endpoint for the POST request.

payload?

Optional payload to be sent as the body of the POST request.

Returns

Promise<VetchResponse<T>>

  • The response from the POST request.
Inherited from

Client.sendPostRequest

sendPutRequest()
sendPutRequest<T>(url, payload?): Promise<VetchResponse<T>>;

Defined in: server-client/dist/lib/client.d.ts:124

Sends a PUT request to the specified URL with an optional payload.

Type Parameters
T

T

Parameters
url

string

The URL endpoint for the PUT request.

payload?

Optional payload to be sent as the body of the PUT request.

Returns

Promise<VetchResponse<T>>

  • The response from the PUT request.
Inherited from

Client.sendPutRequest

sendRequest()
sendRequest<T>(request): Promise<VetchResponse<T>>;

Defined in: server-client/dist/lib/client.d.ts:144

Sends a request adding necessary headers, handling authentication, and parsing the response.

Type Parameters
T

T

Parameters
request

VetchOptions

The options defining the request, including URL, method, headers, and data.

Returns

Promise<VetchResponse<T>>

  • The parsed response from the request.
Inherited from

Client.sendRequest

sendRequestWithData()
sendRequestWithData<T>(
   method, 
   url, 
payload?): Promise<VetchResponse<T>>;

Defined in: server-client/dist/lib/client.d.ts:135

Sends a request with JSON-encoded data to the specified URL using the provided HTTP method.

Type Parameters
T

T

Parameters
method

The HTTP method to be used for the request (only POST, PATCH, or PUT are acceptable).

POST | PUT | PATCH

url

string

The URL endpoint for the request.

payload?

Optional payload to be sent as the body of the request, JSON-encoded.

Returns

Promise<VetchResponse<T>>

  • The response from the request.
Inherited from

Client.sendRequestWithData

updateNumber()
updateNumber(params?): Promise<NumbersEmptyResponse>;

Defined in: numbers/lib/numbers.ts:304

Updates the settings of a phone number.

Parameters
params?

NumbersUpdateParams

The parameters for updating a phone number.

Returns

Promise<NumbersEmptyResponse>

A promise that resolves to an empty response or an error response.

Example
const resp = await numbersClient.updateNumber({
  msisdn: '15555555555',
  voiceCallbackType: 'app',
  voiceCallbackValue: 'APPLICATION_ID',
  voiceStatusCallback: 'https://example.com/webhooks/voice',
});

if (resp.errorCode) {
  console.log(`Error: ${resp.errorCodeLabel}`);
} else {
  console.log('Number bought successfully');
}

Type Aliases

Country

type Country = 
  | "AD"
  | "AE"
  | "AF"
  | "AG"
  | "AI"
  | "AL"
  | "AM"
  | "AO"
  | "AQ"
  | "AR"
  | "AS"
  | "AT"
  | "AU"
  | "AW"
  | "AX"
  | "AZ"
  | "BA"
  | "BB"
  | "BD"
  | "BE"
  | "BF"
  | "BG"
  | "BH"
  | "BI"
  | "BJ"
  | "BL"
  | "BM"
  | "BN"
  | "BO"
  | "BQ"
  | "BR"
  | "BS"
  | "BT"
  | "BV"
  | "BW"
  | "BY"
  | "BZ"
  | "CA"
  | "CC"
  | "CD"
  | "CF"
  | "CG"
  | "CH"
  | "CI"
  | "CK"
  | "CL"
  | "CM"
  | "CN"
  | "CO"
  | "CR"
  | "CU"
  | "CV"
  | "CW"
  | "CX"
  | "CY"
  | "CZ"
  | "DE"
  | "DJ"
  | "DK"
  | "DM"
  | "DO"
  | "DZ"
  | "EC"
  | "EE"
  | "EG"
  | "EH"
  | "ER"
  | "ES"
  | "ET"
  | "FI"
  | "FJ"
  | "FK"
  | "FM"
  | "FO"
  | "FR"
  | "GA"
  | "GB"
  | "GD"
  | "GE"
  | "GF"
  | "GG"
  | "GH"
  | "GI"
  | "GL"
  | "GM"
  | "GN"
  | "GP"
  | "GQ"
  | "GR"
  | "GS"
  | "GT"
  | "GU"
  | "GW"
  | "GY"
  | "HK"
  | "HM"
  | "HN"
  | "HR"
  | "HT"
  | "HU"
  | "ID"
  | "IE"
  | "IL"
  | "IM"
  | "IN"
  | "IO"
  | "IQ"
  | "IR"
  | "IS"
  | "IT"
  | "JE"
  | "JM"
  | "JO"
  | "JP"
  | "KE"
  | "KG"
  | "KH"
  | "KI"
  | "KM"
  | "KN"
  | "KP"
  | "KR"
  | "KW"
  | "KY"
  | "KZ"
  | "LA"
  | "LB"
  | "LC"
  | "LI"
  | "LK"
  | "LR"
  | "LS"
  | "LT"
  | "LU"
  | "LV"
  | "LY"
  | "MA"
  | "MC"
  | "MD"
  | "ME"
  | "MF"
  | "MG"
  | "MH"
  | "MK"
  | "ML"
  | "MM"
  | "MN"
  | "MO"
  | "MP"
  | "MQ"
  | "MR"
  | "MS"
  | "MT"
  | "MU"
  | "MV"
  | "MW"
  | "MX"
  | "MY"
  | "MZ"
  | "NA"
  | "NC"
  | "NE"
  | "NF"
  | "NG"
  | "NI"
  | "NL"
  | "NO"
  | "NP"
  | "NR"
  | "NU"
  | "NZ"
  | "OM"
  | "PA"
  | "PE"
  | "PF"
  | "PG"
  | "PH"
  | "PK"
  | "PL"
  | "PM"
  | "PN"
  | "PR"
  | "PS"
  | "PT"
  | "PW"
  | "PY"
  | "QA"
  | "RE"
  | "RO"
  | "RS"
  | "RU"
  | "RW"
  | "SA"
  | "SB"
  | "SC"
  | "SD"
  | "SE"
  | "SG"
  | "SH"
  | "SI"
  | "SJ"
  | "SK"
  | "SL"
  | "SM"
  | "SN"
  | "SO"
  | "SR"
  | "SS"
  | "ST"
  | "SV"
  | "SX"
  | "SY"
  | "SZ"
  | "TC"
  | "TD"
  | "TF"
  | "TG"
  | "TH"
  | "TJ"
  | "TK"
  | "TL"
  | "TM"
  | "TN"
  | "TO"
  | "TR"
  | "TT"
  | "TV"
  | "TW"
  | "TZ"
  | "UA"
  | "UG"
  | "US"
  | "UY"
  | "UZ"
  | "VA"
  | "VC"
  | "VE"
  | "VG"
  | "VI"
  | "VN"
  | "VU"
  | "WF"
  | "WS"
  | "YE"
  | "YT"
  | "ZA"
  | "ZM"
  | "ZW"
  | string;

Defined in: numbers/lib/types/Country.ts:4

ISO 3166-1 alpha-2 country codes.


NumbersAvailableList

type NumbersAvailableList = object;

Defined in: numbers/lib/types/NumbersAvailableList.ts:6

Represents a list of available numbers.

Properties

count?
optional count: number;

Defined in: numbers/lib/types/NumbersAvailableList.ts:10

The total count of available numbers.

numbers?
optional numbers: NumbersAvailableNumber[];

Defined in: numbers/lib/types/NumbersAvailableList.ts:15

An array of available numbers and their details.


NumbersAvailableNumber

type NumbersAvailableNumber = object;

Defined in: numbers/lib/types/NumbersAvailableNumber.ts:7

Represents an available phone number with its details.

Properties

cost?
optional cost: string;

Defined in: numbers/lib/types/NumbersAvailableNumber.ts:30

The cost associated with the phone number. Example: "$10.00".

country?
optional country: Country;

Defined in: numbers/lib/types/NumbersAvailableNumber.ts:12

The two-character country code in ISO 3166-1 alpha-2 format. Example: "US" for the United States.

features?
optional features: Feature[];

Defined in: numbers/lib/types/NumbersAvailableNumber.ts:36

The capabilities/features of the phone number, such as SMS, VOICE, or MMS. Example: ["SMS", "VOICE"].

msisdn?
optional msisdn: string;

Defined in: numbers/lib/types/NumbersAvailableNumber.ts:18

An available inbound virtual phone number. Example: "447700900000".

type?
optional type: LineType;

Defined in: numbers/lib/types/NumbersAvailableNumber.ts:24

The type of phone number. Example: "mobile-lvn" or "landline".


NumbersClassParameters

type NumbersClassParameters = AuthParams & VetchOptions & object;

Defined in: numbers/lib/types/NumbersClassParameters.ts:9

Represents the parameters for configuring the NumbersClass.

Type declaration

auth?
optional auth: AuthInterface;

The authentication configuration.

Deprecated

This is no longer in use


NumbersEmptyResponse

type NumbersEmptyResponse = object;

Defined in: numbers/lib/types/NumbersEmptyResponse.ts:4

Represents a response with optional error code and label for empty number-related operations.

Properties

error-code?
optional error-code: 200 | 401 | number;

Defined in: numbers/lib/types/NumbersEmptyResponse.ts:21

The error code, if an error occurred during the operation. Example: "E001".

error-code-label?
optional error-code-label: string;

Defined in: numbers/lib/types/NumbersEmptyResponse.ts:27

A human-readable label or description of the error code. Example: "Invalid request."

errorCode?
optional errorCode: string;

Defined in: numbers/lib/types/NumbersEmptyResponse.ts:9

The error code, if an error occurred during the operation. Example: "E001".

errorCodeLabel?
optional errorCodeLabel: string;

Defined in: numbers/lib/types/NumbersEmptyResponse.ts:15

A human-readable label or description of the error code. Example: "Invalid request."


NumbersOwnedFilter

type NumbersOwnedFilter = object;

Defined in: numbers/lib/types/NumbersOwnedFilter.ts:7

Represents filters for searching owned numbers.

Properties

applicationId?
optional applicationId: string;

Defined in: numbers/lib/types/NumbersOwnedFilter.ts:18

An Application ID. Example: "aaaaaaaa-bbbb-cccc-dddd-0123456789ab".

country?
optional country: Country;

Defined in: numbers/lib/types/NumbersOwnedFilter.ts:12

The two-character country code in ISO 3166-1 alpha-2 format. Example: "US" for the United States.

hasApplication?
optional hasApplication: boolean;

Defined in: numbers/lib/types/NumbersOwnedFilter.ts:23

Indicates whether numbers have an associated application.

index?
optional index: number;

Defined in: numbers/lib/types/NumbersOwnedFilter.ts:44

The starting index for paginated results.

pattern?
optional pattern: string;

Defined in: numbers/lib/types/NumbersOwnedFilter.ts:28

A pattern to filter numbers.

searchPattern?
optional searchPattern: SearchPattern;

Defined in: numbers/lib/types/NumbersOwnedFilter.ts:34

The search pattern type. Example: SearchPattern.START_WITH.

size?
optional size: number;

Defined in: numbers/lib/types/NumbersOwnedFilter.ts:39

The maximum number of results to return.


NumbersOwnedList

type NumbersOwnedList = object;

Defined in: numbers/lib/types/NumbersOwnedList.ts:6

Represents a list of owned numbers.

Properties

count?
optional count: number;

Defined in: numbers/lib/types/NumbersOwnedList.ts:10

The total count of owned numbers.

numbers?
optional numbers: NumbersOwnedNumber[];

Defined in: numbers/lib/types/NumbersOwnedList.ts:15

An array of owned numbers and their details.


NumbersOwnedNumber

type NumbersOwnedNumber = object;

Defined in: numbers/lib/types/NumbersOwnedNumber.ts:7

Represents an owned phone number with its details.

Properties

country?
optional country: Country;

Defined in: numbers/lib/types/NumbersOwnedNumber.ts:12

The two-character country code in ISO 3166-1 alpha-2 format. Example: "US" for the United States.

features?
optional features: Feature[];

Defined in: numbers/lib/types/NumbersOwnedNumber.ts:36

The capabilities/features of the phone number, such as SMS, VOICE, or MMS. Example: ["SMS", "VOICE"].

messagesCallbackType?
optional messagesCallbackType: string;

Defined in: numbers/lib/types/NumbersOwnedNumber.ts:54

The type of messages callback for the number. Example: "app".

messagesCallbackValue?
optional messagesCallbackValue: string;

Defined in: numbers/lib/types/NumbersOwnedNumber.ts:60

The value associated with the messages callback. Example: "aaaaaaaa-bbbb-cccc-dddd-0123456789ab".

moHttpUrl?
optional moHttpUrl: string;

Defined in: numbers/lib/types/NumbersOwnedNumber.ts:24

The URL of the webhook endpoint that handles inbound messages for the number. Example: "https://example.com/webhooks/inbound-sms".

msisdn?
optional msisdn: string;

Defined in: numbers/lib/types/NumbersOwnedNumber.ts:18

The owned phone number. Example: "447700900000".

type?
optional type: LineType;

Defined in: numbers/lib/types/NumbersOwnedNumber.ts:30

The type of phone number. Example: "mobile-lvn" or "landline".

voiceCallbackType?
optional voiceCallbackType: string;

Defined in: numbers/lib/types/NumbersOwnedNumber.ts:42

The type of voice callback for the number. Example: "app" or "sip".

voiceCallbackValue?
optional voiceCallbackValue: string;

Defined in: numbers/lib/types/NumbersOwnedNumber.ts:48

The value associated with the voice callback. Example: "aaaaaaaa-bbbb-cccc-dddd-0123456789ab".


NumbersParams

type NumbersParams = object;

Defined in: numbers/lib/types/NumbersParams.ts:6

Represents parameters for configuring a phone number.

Properties

country
country: Country;

Defined in: numbers/lib/types/NumbersParams.ts:11

The two-character country code in ISO 3166-1 alpha-2 format. Example: "US" for the United States.

msisdn
msisdn: string;

Defined in: numbers/lib/types/NumbersParams.ts:17

The phone number. Example: "447700900000".

targetApiKey?
optional targetApiKey: string;

Defined in: numbers/lib/types/NumbersParams.ts:22

An optional target API key.


NumbersQueryOwnedFilter

type NumbersQueryOwnedFilter = object;

Defined in: numbers/lib/types/NumbersQueryOwnedFilter.ts:6

Represents filters for querying owned numbers.

Properties

application_id?
optional application_id: string;

Defined in: numbers/lib/types/NumbersQueryOwnedFilter.ts:17

An Application ID. Example: "aaaaaaaa-bbbb-cccc-dddd-0123456789ab".

country?
optional country: Country;

Defined in: numbers/lib/types/NumbersQueryOwnedFilter.ts:11

The two-character country code in ISO 3166-1 alpha-2 format. Example: "US" for the United States.

has_application?
optional has_application: boolean;

Defined in: numbers/lib/types/NumbersQueryOwnedFilter.ts:22

Indicates whether numbers have an associated application.

index?
optional index: number;

Defined in: numbers/lib/types/NumbersQueryOwnedFilter.ts:43

The starting index for paginated results.

pattern?
optional pattern: string;

Defined in: numbers/lib/types/NumbersQueryOwnedFilter.ts:27

A pattern to filter numbers.

search_pattern?
optional search_pattern: number;

Defined in: numbers/lib/types/NumbersQueryOwnedFilter.ts:33

The search pattern type. Example: 0 for "START_WITH".

size?
optional size: number;

Defined in: numbers/lib/types/NumbersQueryOwnedFilter.ts:38

The maximum number of results to return.


NumbersQueryParams

type NumbersQueryParams = object;

Defined in: numbers/lib/types/NumbersQueryParams.ts:6

Represents parameters for querying phone numbers.

Properties

country
country: Country;

Defined in: numbers/lib/types/NumbersQueryParams.ts:11

The two-character country code in ISO 3166-1 alpha-2 format. Example: "US" for the United States.

msisdn
msisdn: string;

Defined in: numbers/lib/types/NumbersQueryParams.ts:17

The phone number. Example: "447700900000".

target_api_key?
optional target_api_key: string;

Defined in: numbers/lib/types/NumbersQueryParams.ts:22

An optional target API key.


NumbersQuerySearchFilter

type NumbersQuerySearchFilter = object;

Defined in: numbers/lib/types/NumbersQuerySearchFilter.ts:6

Represents filters for searching phone numbers.

Properties

country?
optional country: Country;

Defined in: numbers/lib/types/NumbersQuerySearchFilter.ts:11

The two-character country code in ISO 3166-1 alpha-2 format. Example: "US" for the United States.

index?
optional index: number;

Defined in: numbers/lib/types/NumbersQuerySearchFilter.ts:32

The starting index for paginated results.

pattern?
optional pattern: string;

Defined in: numbers/lib/types/NumbersQuerySearchFilter.ts:16

A pattern to filter numbers.

search_pattern?
optional search_pattern: number;

Defined in: numbers/lib/types/NumbersQuerySearchFilter.ts:22

The search pattern type. Example: 0 for "START_WITH".

size?
optional size: number;

Defined in: numbers/lib/types/NumbersQuerySearchFilter.ts:27

The maximum number of results to return.


NumbersQueryUpdateParams

type NumbersQueryUpdateParams = object;

Defined in: numbers/lib/types/NumbersQueryUpdateParams.ts:7

Represents parameters for updating phone number settings.

Properties

app_id?
optional app_id: string;

Defined in: numbers/lib/types/NumbersQueryUpdateParams.ts:24

An Application ID. Example: "aaaaaaaa-bbbb-cccc-dddd-0123456789ab".

country
country: Country;

Defined in: numbers/lib/types/NumbersQueryUpdateParams.ts:12

The two-character country code in ISO 3166-1 alpha-2 format. Example: "US" for the United States.

messagesCallbackType?
optional messagesCallbackType: MessagesCallbackTypeEnum;

Defined in: numbers/lib/types/NumbersQueryUpdateParams.ts:55

The messages callback type.

Deprecated
messagesCallbackValue?
optional messagesCallbackValue: string;

Defined in: numbers/lib/types/NumbersQueryUpdateParams.ts:61

The messages callback value.

Deprecated
moHttpUrl?
optional moHttpUrl: string;

Defined in: numbers/lib/types/NumbersQueryUpdateParams.ts:29

The HTTP URL for handling MO (Mobile Originated) messages.

moSmppSysType?
optional moSmppSysType: string;

Defined in: numbers/lib/types/NumbersQueryUpdateParams.ts:34

The SMPP system type for MO (Mobile Originated) messages.

msisdn
msisdn: string;

Defined in: numbers/lib/types/NumbersQueryUpdateParams.ts:18

The phone number. Example: "447700900000".

voiceCallbackType?
optional voiceCallbackType: VoiceCallbackTypeEnum;

Defined in: numbers/lib/types/NumbersQueryUpdateParams.ts:39

The voice callback type.

voiceCallbackValue?
optional voiceCallbackValue: string;

Defined in: numbers/lib/types/NumbersQueryUpdateParams.ts:44

The voice callback value.

voiceStatusCallback?
optional voiceStatusCallback: string;

Defined in: numbers/lib/types/NumbersQueryUpdateParams.ts:49

The voice status callback URL.


NumbersResponse<T>

type NumbersResponse<T> = VetchResponse<T>;

Defined in: numbers/lib/types/NumbersResponse.ts:7

Represents a response for phone numbers.

Type Parameters

T

T

The type of the response data.


NumbersSearchFilter

type NumbersSearchFilter = object;

Defined in: numbers/lib/types/NumbersSearchFilter.ts:7

Represents filters for searching phone numbers.

Properties

country
country: Country;

Defined in: numbers/lib/types/NumbersSearchFilter.ts:12

The two-character country code in ISO 3166-1 alpha-2 format. Example: "US" for the United States.

features?
optional features: Feature[];

Defined in: numbers/lib/types/NumbersSearchFilter.ts:33

The capabilities or features of the number.

index?
optional index: number;

Defined in: numbers/lib/types/NumbersSearchFilter.ts:43

The starting index for paginated results.

pattern?
optional pattern: string;

Defined in: numbers/lib/types/NumbersSearchFilter.ts:22

A pattern to filter numbers.

searchPattern?
optional searchPattern: SearchPattern;

Defined in: numbers/lib/types/NumbersSearchFilter.ts:28

The search pattern type. Example: 0 for "START_WITH".

size?
optional size: number;

Defined in: numbers/lib/types/NumbersSearchFilter.ts:38

The maximum number of results to return.

type?
optional type: LineType;

Defined in: numbers/lib/types/NumbersSearchFilter.ts:17

The type of the phone number.


NumbersSearchSimple

type NumbersSearchSimple = object;

Defined in: numbers/lib/types/NumbersSearchSimple.ts:4

Represents simple search options for phone numbers.

Properties

contains?
optional contains: string;

Defined in: numbers/lib/types/NumbersSearchSimple.ts:18

Filter numbers that contain a specific string.

endsWith?
optional endsWith: string;

Defined in: numbers/lib/types/NumbersSearchSimple.ts:13

Filter numbers that end with a specific string.

startsWith?
optional startsWith: string;

Defined in: numbers/lib/types/NumbersSearchSimple.ts:8

Filter numbers that start with a specific string.


NumbersUpdateParams

type NumbersUpdateParams = object;

Defined in: numbers/lib/types/NumbersUpdateParams.ts:7

Represents parameters for updating phone numbers.

Properties

appId?
optional appId: string;

Defined in: numbers/lib/types/NumbersUpdateParams.ts:29

The application ID associated with the phone number.

applicationId?
optional applicationId: string;

Defined in: numbers/lib/types/NumbersUpdateParams.ts:24

The application ID associated with the phone number.

Deprecated

Please use app_id

country
country: Country;

Defined in: numbers/lib/types/NumbersUpdateParams.ts:12

The two-character country code in ISO 3166-1 alpha-2 format. Example: "US" for the United States.

messagesCallbackType?
optional messagesCallbackType: MessagesCallbackTypeEnum;

Defined in: numbers/lib/types/NumbersUpdateParams.ts:61

The type of messages callback: "app".

Deprecated

Use voiceCallbackType instead.

messagesCallbackValue?
optional messagesCallbackValue: string;

Defined in: numbers/lib/types/NumbersUpdateParams.ts:67

The value for messages callback.

Deprecated

Use voiceCallbackValue instead.

moHttpUrl?
optional moHttpUrl: string;

Defined in: numbers/lib/types/NumbersUpdateParams.ts:34

The URL of the webhook endpoint that handles inbound messages.

moSmppSysType?
optional moSmppSysType: string;

Defined in: numbers/lib/types/NumbersUpdateParams.ts:39

The system type for SMPP MO messages.

msisdn
msisdn: string;

Defined in: numbers/lib/types/NumbersUpdateParams.ts:18

The phone number in E.164 format. Example: "+1234567890".

voiceCallbackType?
optional voiceCallbackType: VoiceCallbackTypeEnum;

Defined in: numbers/lib/types/NumbersUpdateParams.ts:44

The type of voice callback: "sip", "tel", or "app".

voiceCallbackValue?
optional voiceCallbackValue: string;

Defined in: numbers/lib/types/NumbersUpdateParams.ts:49

The value for voice callback.

voiceStatusCallback?
optional voiceStatusCallback: string;

Defined in: numbers/lib/types/NumbersUpdateParams.ts:54

The URL of the voice status callback.

Clone this wiki locally