Skip to main content

Phone Number

Phone number schemas manage the complete lifecycle of phone number acquisition from telephony providers: discovery of available inventory, purchase transactions, and provisioning into Phone Configurations.

Source: src/core/service-configuration/phone-number.schema.ts


BasePhoneNumberInfo

Common properties for available phone numbers from provider inventory.

Schema: BasePhoneNumberInfoSchema

Attributes

AttributeTypeRequiredDefaultDescription
friendlyNamestringYesHuman-readable name for the number
phoneNumberstringYesPhone number in E.164 format
latastring | nullNoLocal Access and Transport Area code
rateCenterstringNoRate center for billing/routing
regionstringNoState or province code
postalCodestringNoAssociated postal code
countryCodestringYesISO country code
capabilitiesobjectYesVoice, SMS, MMS capabilities
betabooleanYesWhether this is a beta number
numberTypeenumYesType of phone number. One of LOCAL, TOLL_FREE, or MOBILE.

PhoneNumberPurchase

Phone number purchase transaction record.

Schema: PhoneNumberPurchaseSchema

Attributes

AttributeTypeRequiredDefaultDescription
idstringUnique identifier for the purchase
friendlyNamestringYesDisplay name for the number
phoneNumberstringYesPhone number in E.164 format
countryCodestringYesISO 3166-1 alpha-2 country code
chargedCreditsnumberYesAmount charged for purchase
statusenumNoPENDINGCurrent purchase status. One of PENDING, PROCESSING, COMPLETED, FAILED, or CANCELLED.
numberTypeenumNoLOCALType of phone number. One of LOCAL, TOLL_FREE, or MOBILE.
statusDetailsstring | nullNoAdditional status information
completedAtnumber | nullNoCompletion timestamp
metadataobject | nullNoAdditional purchase metadata
createdAtnumberUnix timestamp when created
updatedAtnumberUnix timestamp when last updated

PhoneNumberPricing

Pricing information for phone numbers.

Schema: PhoneNumberPricingSchema

Attributes

AttributeTypeDescription
number_typeenumType of phone number. One of LOCAL, TOLL_FREE, or MOBILE.
countrystringFull country name
countryCodestringISO country code
phoneNumberPricesarrayArray of pricing tiers
pricenumberFinal price
priceUnitstringUnit of pricing (e.g., "per month")
currencystringCurrency code (default: "USD")

Example

Phone Number Purchase

{
"id": "purchase_abc123",
"friendlyName": "Main Support Line",
"phoneNumber": "+12125551234",
"countryCode": "US",
"chargedCredits": 1500,
"status": "COMPLETED",
"numberType": "LOCAL",
"completedAt": 1709856000000,
"createdAt": 1709856000000,
"updatedAt": 1709856000000
}

Available Phone Number

{
"friendlyName": "New York Local",
"phoneNumber": "+12125551234",
"countryCode": "US",
"capabilities": {
"voice": true,
"SMS": true,
"MMS": false
},
"beta": false,
"numberType": "LOCAL"
}

Create Schema

SchemaDescriptionOmits
CreatePhoneNumberPurchaseSchemaFor initiating purchasesid, chargedCredits, status, createdAt, updatedAt, statusDetails, completedAt, metadata