Download OpenAPI specification:Download
You can use the Available Number API to search for available numbers or activate an available number.
Activate a virtual number to use with SMS products, Voice products, or both.
You'll use smsConfiguration
to setup your number for SMS and voiceConfiguration
for Voice. To setup for both, add both objects. See the dropdown menu (just under language selection) for code samples.
Note: You cannot add both objects if you only need to configure one object. For example, if you only need to configure smsConfiguration
for SMS messaging, do not add the voiceConfiguration
object or it will result in an error.
projectId required | |
phoneNumber required | string Default: "YOUR_selected_phoneNumber_from_search" Output only. The phone number in E.164 format with leading Example: +12025550134 |
The request to rent a number.
object (SmsConfiguration) The current SMS configuration for this number. | |||||||||||||
| |||||||||||||
object (VoiceConfiguration) The current voice configuration for this number. | |||||||||||||
|
A successful response, or an error
phoneNumber | string The phone number in E.164 format with leading | ||||||||||||||||||
projectId | string Project ID. Your project ID can be found on your Sinch Customer Dashboard. | ||||||||||||||||||
displayName | string User supplied name for the phone number. | ||||||||||||||||||
regionCode | string ISO 3166-1 alpha-2 country code of the phone number. Example US, UK or SE. | ||||||||||||||||||
type | string (NumberType) The number type.
| ||||||||||||||||||
capability | Array of strings (Capability) The capability of the number.
| ||||||||||||||||||
object (money) | |||||||||||||||||||
paymentIntervalMonths | integer <int32> How often the recurring price is charged in months. | ||||||||||||||||||
nextChargeDate | string <date-time> The date of the next charge. | ||||||||||||||||||
expireAt | string <date-time> The timestamp when the subscription will expire if an expiration date has been set. | ||||||||||||||||||
object (SmsConfiguration) The current SMS configuration for this number. | |||||||||||||||||||
| |||||||||||||||||||
object (VoiceConfiguration) The current voice configuration for this number. | |||||||||||||||||||
|
{- "smsConfiguration": {
- "servicePlanId": "YOUR_SMS_servicePlanId",
- "scheduledProvisioning": {
- "status": "WAITING",
- "errorCodes": [
- "INTERNAL_ERROR"
]
}, - "campaignId": "YOUR_campaignId_from_TCR"
}, - "voiceConfiguration": {
- "appId": "YOUR_Voice_appId",
- "scheduledProvisioning": {
- "status": "WAITING"
}
}
}
{- "phoneNumber": "+12025550134",
- "projectId": "51bc3f40-f266-4ca8-8938-a1ed0ff32b9a",
- "displayName": "string",
- "regionCode": "US",
- "type": "MOBILE",
- "capability": [
- "SMS"
], - "money": {
- "currencyCode": "USD",
- "amount": "2.00"
}, - "paymentIntervalMonths": 0,
- "nextChargeDate": "2019-08-24T14:15:22Z",
- "expireAt": "2019-08-24T14:15:22Z",
- "smsConfiguration": {
- "servicePlanId": "82b42acf74924bd687ef9fb212f2060c",
- "scheduledProvisioning": {
- "servicePlanId": "82b42acf74924bd687ef9fb212f20611",
- "status": "WAITING",
- "lastUpdatedTime": "2019-08-24T14:15:22Z",
- "campaignId": "string",
- "errorCodes": [
- "INTERNAL_ERROR"
]
}, - "campaignId": "string"
}, - "voiceConfiguration": {
- "appId": "string",
- "scheduledVoiceProvisioning": {
- "appId": "string",
- "status": "WAITING",
- "lastUpdatedTime": "2019-08-24T14:15:22Z"
}, - "lastUpdatedTime": "2019-08-24T14:15:22Z"
}
}
Search for virtual numbers that are available for you to activate. You can filter by any property on the available number resource.
When searching, indicate the capability
of the number in the array as SMS
and/or VOICE
. To search for a number capable of both, list both SMS
and VOICE
.
A successful response, or an error
Array of objects (Available Number) List of available phone numbers. | |||||||||||||||||||||||||||||||
Array
|
import fetch from 'node-fetch'; async function run() { const query = new URLSearchParams({ regionCode: 'US', type: 'LOCAL' }).toString(); const projectId = 'YOUR_projectId_PARAMETER'; const resp = await fetch( `https://numbers.api.sinch.com/v1/projects/${projectId}/availableNumbers?${query}`, { method: 'GET', headers: { Authorization: 'Basic ' + Buffer.from('<username>:<password>').toString('base64') } } ); const data = await resp.text(); console.log(data); } run();
{- "availableNumbers": [
- {
- "phoneNumber": "+12025550134",
- "regionCode": "US",
- "type": "MOBILE",
- "capability": [
- "SMS",
- "VOICE"
], - "setupPrice": {
- "currencyCode": "USD",
- "amount": "2.00"
}, - "monthlyPrice": {
- "currencyCode": "USD",
- "amount": "2.00"
}, - "paymentIntervalMonths": 0,
- "supportingDocumentationRequired": true
}
]
}
This endpoint allows you to enter a specific phone number to check if it's available for use. A 200 response will return the number's capability, setup costs, monthly costs and if supporting documentation is required.
projectId required | |
phoneNumber required | string Default: "YOUR_selected_phoneNumber_from_search" Output only. The phone number in E.164 format with leading Example: +12025550134 |
A successful response, or an error
phoneNumber | string The phone number in E.164 format with leading | ||||||||
regionCode | string ISO 3166-1 alpha-2 country code of the phone number. Example: US, UK or SE. | ||||||||
type | string (NumberType) The number type.
| ||||||||
capability | Array of strings (Capability) The capability of the number.
| ||||||||
object (money) | |||||||||
object (money) | |||||||||
paymentIntervalMonths | integer <int32> How often the recurring price is charged in months. | ||||||||
supportingDocumentationRequired | boolean Whether or not supplementary documentation will be required to complete number rental. |
import fetch from 'node-fetch'; async function run() { const projectId = 'YOUR_projectId_PARAMETER'; const phoneNumber = 'YOUR_phoneNumber_PARAMETER'; const resp = await fetch( `https://numbers.api.sinch.com/v1/projects/${projectId}/availableNumbers/${phoneNumber}`, { method: 'GET', headers: { Authorization: 'Basic ' + Buffer.from('<username>:<password>').toString('base64') } } ); const data = await resp.text(); console.log(data); } run();
{- "phoneNumber": "+12025550134",
- "regionCode": "US",
- "type": "MOBILE",
- "capability": [
- "SMS",
- "VOICE"
], - "setupPrice": {
- "currencyCode": "USD",
- "amount": "2.00"
}, - "monthlyPrice": {
- "currencyCode": "USD",
- "amount": "2.00"
}, - "paymentIntervalMonths": 0,
- "supportingDocumentationRequired": true
}