Latest Legacy

Delete a Powerpack

Unrent the phone numbers in the Powerpack’s NumberPool from your account. This operation cannot be undone.

API Endpoint

DELETE https://api.plivo.com/v1/Account/{auth_id}/Powerpack/{powerpack_uuid}/

Arguments

Param Description/Allowed Values
unrent_numbersOptionalBoolean If set to True, then all the phone numbers in the Powerpack's NumberPool will be unrented from the account. Default value is False.

Response

HTTP Status Code: 204

Example Request

1
2
3
4
5
6
import plivo
import json

client = plivo.RestClient("auth_id","auth_token")
powerpack = client.powerpacks.get(uuid="powerpack_uuid")
print str(powerpack.delete(False))
1
2
3
4
5
6
7
8
9
10
11
12
13
14
require 'rubygems'
require 'plivo'
include Plivo
include Plivo::Exceptions

api = RestClient.new("auth_id", "auth_token")
begin
  powerpack=api.powerpacks.get(uuid='your-powerpack-uuid')
  puts powerpack
  response = powerpack.delete(true)
  puts response
rescue PlivoRESTError => e
  puts 'Exception: ' + e.message
end
1
2
3
4
5
6
7
8
9
10
11
12
13
var plivo = require('plivo');
var client = new plivo.Client('auth_id', 'auth_token');

client.powerpacks.get("powerpack_uuid").then(
   function (powerpack) {
     return powerpack.delete()
   })
 .then(function (result) {
   console.log(result)
 })
 .catch(function (response) {
   console.log(response);
 });
1
2
3
4
5
6
7
8
9
10
11
12
13
14
<?php
require 'vendor/autoload.php';
use Plivo\RestClient;

$client = new RestClient("auth_id", "auth_token");
$client->client->setTimeout(40);
try {
    $powerpack = $client->powerpacks->get("your-powerpack-uuid");
    $response = $powerpack->delete(['unrent_numbers'=>true]);
    print_r($powerpack);
}
catch (PlivoRestException $ex) {
    print_r($ex);
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
package com.plivo.api;

import com.plivo.api.models.powerpack.Powerpack;
import com.plivo.api.exceptions.PlivoRestException;
import java.io.IOException;

public class PowerpackTest {
  public static void main(String[] args) {
    Plivo.init("auth_id", "auth_token");
    try {
      Powerpack powerpack = Powerpack.getter("powerpack_uuid").get();
      powerpack.deleter().unrent_numbers(true).delete();
    }
    catch (  PlivoRestException | IOException e ) {
      e.printStackTrace();
    }
  }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
using System;
using Plivo;
using Plivo.Exception;
using System.Collections.Generic;

namespace test_apps
{
    class Program
    {
        static void Main(string[] args)
        {
            var api = new PlivoApi("auth_id", "auth_token");
            try
            {
                var response = api.Powerpacks.Delete(uuid: "powerpack_uuid");
                Console.WriteLine(response);
            }
            catch (PlivoRestException e)
            {
                Console.WriteLine("Exception: " + e.Message);
            }
        }
    }
}
1
2
3
4
curl -X DELETE -i --user auth_id:auth_token \
-H "Content-Type: application/json" \
-d '{"unrent_numbers": "False"}' \
https://api.plivo.com/v1/Account/{auth_id}/Powerpack/{powerpack_uuid}/
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
package main

import (
	"fmt"

	plivo "github.com/plivo/plivo-go"
)

func main() {
	client, err := plivo.NewClient("auth_id", "auth_token", &plivo.ClientOptions{})
	if err != nil {
		panic(err)
	}
    powerpack, err := client.Powerpack.Get("powerpack_uuid")
	if err != nil {
		panic(err)
	}
	response, err := powerpack.Delete(plivo.PowerpackDeleteParams{
	})
	if err != nil {
		panic(err)
	}
	fmt.Printf("Response: %#v\n", response)
}