Update an active phone number. You can perform the following updates:
- Update the name that displays for a customer by modifying the
displayNameparameter. - Unlink the number from an SMS service or campaign by updating the
smsConfigurationconfiguration object. To unlink a number, submit the request with an empty string (””) in the service plan ID or campaign ID fields. - Before linking a number to a new service or campaign, it must be unlinked from any existing service or campaign. Then, link the number to a new SMS service or campaign by updating the service plan ID or campaign ID with the new desired value.
- Update the Voice app to which the number is assigned by using the voiceConfiguration object.
You can update both SMS and Voice in the same object by including both configuration objects. If you only need to update either Voice or SMS, simply omit the other object. If you pass an empty configuration object, the request will fail.
Found on your Sinch Customer Dashboard. Settings > Projects.
Output only. The phone number in E.164 format with leading +.
The number body to be updated.
The current SMS configuration for this number.
Once the servicePlanId is sent, it enters scheduled provisioning.
The status of scheduled provisioning will show under a scheduledProvisioning object if it's still running. Once processed successfully, the servicePlanId sent will appear directly under the smsConfiguration object.
- Global APIhttps://numbers.api.sinch.com/v1/projects/{projectId}/activeNumbers/{phoneNumber}
curl -i -X PATCH \
-u '<username>:<password>' \
'https://numbers.api.sinch.com/v1/projects/YOUR_projectId/activeNumbers/+12025550134' \
-H 'Content-Type: application/json' \
-d '{
"displayName": "MyPhoneNumber",
"smsConfiguration": {
"servicePlanId": "string",
"campaignId": "YOUR_campaignId_from_TCR"
},
"voiceConfiguration": {
"type": "RTC",
"appId": "YOUR_Voice_appId"
},
"callbackUrl": "https://www.your-callback-server.com/callback"
}'A successful response, or an Error.
The phone number in E.164 format with leading +. Example +12025550134.
Project ID. Your project ID can be found on your Sinch Customer Dashboard.
ISO 3166-1 alpha-2 country code of the phone number. Example: US, GB or SE.
The number type.
| Enum Value | Description |
|---|---|
| LOCAL | Numbers that are assigned to a specific geographic region. |
| MOBILE | Numbers that belong to a specific range. |
| TOLL_FREE | Numbers that are free of charge for the calling party but billed for all arriving calls. |
The timestamp when the subscription will expire if an expiration date has been set.
The current SMS configuration for this number.
Once the servicePlanId is sent, it enters scheduled provisioning.
The status of scheduled provisioning will show under a scheduledProvisioning object if it's still running. Once processed successfully, the servicePlanId sent will appear directly under the smsConfiguration object.
{ "phoneNumber": "+12025550134", "projectId": "51bc3f40-f266-4ca8-8938-a1ed0ff32b9a", "displayName": "MyPhoneNumber", "regionCode": "US", "type": "LOCAL", "capability": [ "SMS", "VOICE" ], "money": { "currencyCode": "USD", "amount": "2.00" }, "paymentIntervalMonths": 0, "nextChargeDate": "2024-08-24T14:15:22Z", "expireAt": "2024-09-24T14:15:22Z", "smsConfiguration": { "servicePlanId": "YOUR_service_plan_id", "scheduledProvisioning": { … }, "campaignId": "YOUR_campaign_id" }, "voiceConfiguration": { "type": "RTC", "lastUpdatedTime": "2024-09-24T14:15:22Z", "scheduledVoiceProvisioning": { … }, "appId": "YOUR_app_id" } }