Permanently deletes a Subaccount. Optionally associates all Numbers, Endpoints, and Applications that were linked to the deleted Subaccount to the main Plivo Account.

API Endpoint

DELETE
https://api.plivo.com/v1/Account/{auth_id}/Subaccount/{subauth_id}/

Arguments

NameTypeDescription
cascadebooleanIf cascade is set to true, the Applications, Endpoints, and Numbers associated with the Subaccount are also deleted. When set to false, they are mapped to the main Account. Defaults to false.

Request

import plivo

client = plivo.RestClient('<auth_id>','<auth_token>')
response = client.subaccounts.delete(
    auth_id='SA2025RK4E639VJFZAMM',
    cascade=True )
print(response)

# Or, you could delete the subaccount directly using the subaccount object
subaccount = client.subaccounts.get(
    auth_id='SA2025RK4E639VJFZAMM', )
response = subaccount.delete(cascade=True)
print(response)

Response

HTTP Status Code: 204