Skip to content

Update an active phone number

Request

Update an active phone number. You can perform the following updates:

  • Update the name that displays for a customer by modifying the displayName parameter.
  • Unlink the number from an SMS service or campaign by updating the smsConfiguration configuration 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.

Security
Basic or OAuth2.0
Path
projectIdstringrequired

Found on your Sinch Customer Dashboard. Settings > Projects.

Example:YOUR_projectId
phoneNumberstringrequired

Output only. The phone number in E.164 format with leading +.

Default:"YOUR_selected_phoneNumber_from_search"
Example:+12025550134
Bodyapplication/json

The number body to be updated.

displayNamestring

User supplied name for the phone number.

smsConfigurationobject(SMS Configuration)

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.

voiceConfigurationobject(VoiceConfiguration)
callbackUrlstring

The callback URL to be called for a rented number's provisioning / deprovisioning operations.

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"
  }'

Responses

A successful response, or an Error.

Bodyapplication/json
phoneNumberstring(Phone Number)

The phone number in E.164 format with leading +. Example +12025550134.

Example:"+12025550134"
projectIdstring

Project ID. Your project ID can be found on your Sinch Customer Dashboard.

Example:"51bc3f40-f266-4ca8-8938-a1ed0ff32b9a"
displayNamestring

User supplied name for the phone number.

regionCodestring(Region Code)

ISO 3166-1 alpha-2 country code of the phone number. Example: US, GB or SE.

Example:"US"
typestring(Type)

The number type.

Enum ValueDescription
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.

capabilityArray of strings

The capability of the number.

Example:
[ "SMS" ]
moneyobject(Money)

An object giving details on currency code and the amount charged.

paymentIntervalMonthsinteger, (int32)read-only

How often the recurring price is charged in months.

nextChargeDatestring, (date-time)read-only

The date of the next charge.

expireAtstring, (date-time)read-only

The timestamp when the subscription will expire if an expiration date has been set.

smsConfigurationobject(SMS Configuration)

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.

voiceConfigurationobject(VoiceConfiguration)
callbackUrlstring

The callback URL to be called for a rented number's provisioning / deprovisioning operations.

Example:"https://www.your-callback-server.com/callback"
Response
{ "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" } }