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
friendlyNamestringYes—Human-readable name for the number
phoneNumberstringYes—Phone number in E.164 format
latastring | nullNo—Local Access and Transport Area code
rateCenterstringNo—Rate center for billing/routing
regionstringNo—State or province code
postalCodestringNo—Associated postal code
countryCodestringYes—ISO country code
capabilitiesobjectYes—Voice, SMS, MMS capabilities
betabooleanYes—Whether this is a beta number
numberTypeenumYes—Type of phone number. One of LOCAL, TOLL_FREE, or MOBILE.

PhoneNumberPurchase​

Phone number purchase transaction record.

Schema: PhoneNumberPurchaseSchema

Attributes​

AttributeTypeRequiredDefaultDescription
idstring——Unique identifier for the purchase
friendlyNamestringYes—Display name for the number
phoneNumberstringYes—Phone number in E.164 format
countryCodestringYes—ISO 3166-1 alpha-2 country code
chargedCreditsnumberYes—Amount 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 | nullNo—Additional status information
completedAtnumber | nullNo—Completion timestamp
metadataobject | nullNo—Additional purchase metadata
createdAtnumber——Unix timestamp when created
updatedAtnumber——Unix 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