Download OpenAPI specification:Download
You can use the Active Number API to manage numbers you own. You can assign numbers to projects, release numbers from projects, or list all numbers assigned to a project.
Lists all virtual numbers for a project.
A successful response, or an error
Array of objects (Active Number Response) List of numbers associated to the client project specified in | |||||||||||||||||||||||||||||||||||||||
Array
| |||||||||||||||||||||||||||||||||||||||
nextPageToken | string (The token to be used for listing the next page.) | ||||||||||||||||||||||||||||||||||||||
totalSize | integer <int32> (The maximum number of results returned.) |
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}/activeNumbers?${query}`, { method: 'GET', headers: { Authorization: 'Basic ' + Buffer.from('<username>:<password>').toString('base64') } } ); const data = await resp.text(); console.log(data); } run();
{- "activeNumbers": [
- {
- "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"
}
}
], - "nextPageToken": "string",
- "totalSize": 0
}
Update a virtual phone number. For example: you can move a number between different SMS services and give it a new, friendly name.
To update the name that displays for a customer, modify the displayName
parameter.
You'll use smsConfiguration
to update your SMS number and voiceConfiguration
to update Voice. To update for both, add both objects. Within these objects, you can update the service plan ID, campaign ID, and scheduled provisioning status. You can also update the type of number, currency type and amount.
Note: You cannot add both objects if you only need to update one object. For example, if you only need to reconfigure 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 number body to be updated.
displayName | string User supplied name for the phone number. | ||||||||||||
type | string (NumberType) The number type.
| ||||||||||||
object (money) | |||||||||||||
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. | |||||||||||||||||||
|
{- "displayName": "MyPhoneNumber",
- "type": "MOBILE",
- "money": {
- "currencyCode": "USD",
- "amount": "2.00"
}, - "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"
}
}
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 | ||||||||||||||||||
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. | |||||||||||||||||||
|
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}/activeNumbers/${phoneNumber}`, { method: 'GET', headers: { Authorization: 'Basic ' + Buffer.from('<username>:<password>').toString('base64') } } ); const data = await resp.text(); console.log(data); } run();
{- "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"
}
}
With this endpoint, you can cancel your subscription for a specific virtual phone number.
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 | ||||||||||||||||||
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. | |||||||||||||||||||
|
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}/activeNumbers/${phoneNumber}:release`, { method: 'POST', headers: { Authorization: 'Basic ' + Buffer.from('<username>:<password>').toString('base64') } } ); const data = await resp.text(); console.log(data); } run();
{- "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"
}
}