import plivo

client = plivo.RestClient('<auth_id>','<auth_token>')
response = client.numbers.update(
    number='12025551111',
    alias='Updated Alias', )
print(response)

# Or you could use the Number object directly to update the details
client = plivo.RestClient('<auth_id>','<auth_token>')
number = client.numbers.get(
    number='12025551111', )
response = number.update(
    alias='Updated Alias', )
print(response)
HTTP Status Code: 202
{
  "message": "changed",
  "api_id": "5a9fcb68-582d-11e1-86da-6ff39efcb949"
}

Change the application and subaccount associated with the specified phone number from your account.

API Endpoint

POST
https://api.plivo.com/v1/Account/{auth_id}/Number/{number}/

Arguments

app_id
string

The application to be assigned to the phone number. If not specified, the application selected as the default_number_app of the account is assigned. For more information, refer to the default_number_app argument in application and the app_id attribute in application object.

Zentrunk customers can pass the inbound trunk_id as the app_id to map the number to the inbound trunk.

subaccount
string

The auth_id of the subaccount to which this number should be added. This can be performed only by the main account.

alias
string

An alias assigned to the phone number.

cnam_lookup
string

Updates CNAM lookup configuration for a number. Applicable only for US local and toll-free numbers. Valid values are enabled and disabled. For other numbers, this value is null.

cnam
(optional
string

The caller ID name you want call receivers to see when they receive calls from this number

cnam_callback_url
(optional
string

Plivo invokes this URL when there is an update to the cnam registration request

cnam_callback_method
(optional
string

The HTTP verb that should be used to invoke the URL configured as cnam_callback_url

Allowed values: GET, POST
Defaults to POST.

List of events and parameters sent to the cnam_callback_url

apiId
string

Unique ID of the callback response

cnamUpdateStatus
string

Status of the request to update CNAM Possible values:
“success”, “failed”

requestedCnam
string

The caller ID (CNAM) that was requested

Number
string

The phone number for which CNAM was requested

import plivo

client = plivo.RestClient('<auth_id>','<auth_token>')
response = client.numbers.update(
    number='12025551111',
    alias='Updated Alias', )
print(response)

# Or you could use the Number object directly to update the details
client = plivo.RestClient('<auth_id>','<auth_token>')
number = client.numbers.get(
    number='12025551111', )
response = number.update(
    alias='Updated Alias', )
print(response)
HTTP Status Code: 202
{
  "message": "changed",
  "api_id": "5a9fcb68-582d-11e1-86da-6ff39efcb949"
}