> ## Documentation Index
> Fetch the complete documentation index at: https://plivo.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Update a Powerpack

> Modify Powerpack settings like name, sticky sender, or local connect

Change a Powerpack’s name, sticky\_sender, local\_connect, or the application connected to it.

#### API Endpoint

```text POST theme={null}
https://api.plivo.com/v1/Account/{auth_id}/Powerpack/{powerpack_uuid}/
```

### Arguments

<table><tbody><tr><td><strong>name<span>string</span></strong></td><td>Must be unique across all Powerpacks in customer’s account.</td></tr><tr><td><strong>sticky\_sender<span>Boolean</span></strong></td><td><p>Whether Sticky Sender should be enabled by default. Sticky Sender ensures messages to a particular destination number are always sent from the same source number.</p><p>Defaults to `true`.</p></td></tr><tr><td><strong>local\_connect<span>Boolean</span></strong></td><td><p>Whether Local Connect should be enabled by default. Local Connect prioritizes local numbers matched on area code and state over other numbers in the pool.</p><p>Defaults to `true`.</p></td></tr><tr><td><strong>application\_type<span>Boolean</span></strong></td><td><p><strong>Conditional</strong> Must be specified if application\_id is specified and is not "`none`".</p><p>Allowed values: `xml`, `phlo`</p></td></tr><tr><td><strong>application\_id<span id="or">String</span></strong></td><td><p>Must be set to a valid PHLO or XML App ID or "`none`" (String). If not specified (or set to "`none`") no application to be associated with phone numbers added to this Powerpack.</p></td></tr></tbody></table>

<RequestExample>
  ```py Python theme={null}
  import plivo
  import json

  client = plivo.RestClient('<auth_id>','<auth_token>')
  params = {}
  number_priorities = [
      {'country_iso': 'US',
      'priority': {'priority1': 'longcode', 'priority2': 'tollfree', 'priority3': 'shortcode'},
      'service_type': 'SMS'
      }]
  params["name"] = "<update_powerpack_name>"
  params["number_priority"] = number_priorities

  response = powerpack.update(params)
  print(response)
  ```

  ```ruby Ruby theme={null}
  require 'rubygems'
  require 'plivo'
  require 'json'

  include Plivo
  include Plivo::Exceptions

  api = RestClient.new("<auth_id>","<auth_token>")

  begin
  	powerpack = api.powerpacks.get("<Powerpack_Name>")

  	# Define Priority
  	number_priority_json = Array[{"country_iso"=>"US",
      "priority"=>{"priority1"=>"tollfree","priority2"=>"longcode","priority3"=>"shortcode"}, 
      "service_type"=>"SMS"}]

  	# Update Powerpack
  	response = powerpack.update(name: '<update_powerpack_name>', 
  		sticky_sender: true, 
  		local_connect: false,
  	number_priority: number_priority_json)

  	puts response
  rescue PlivoRESTError => e
  	puts 'Exception: ' + e.message
  end
  ```

  ```js Node theme={null}
  let plivo = require('plivo');

  let client = new plivo.Client('<auth_id>', '<auth_token>');

  // Update Powerpack
  var params = {
      number_priority: [{
          service_type: "MMS",
          country_iso: "CA",
          priority: {
              priority1: "tollfree",
              priority2: "shortcode",
              priority3: "longcode"
          }
      }]
  };
  client.powerpacks.update("<powerpack_uuid>", params).then(function (result) {
      console.log(result)
  });
  ```

  ```php PHP theme={null}
  <?php
  require 'vendor/autoload.php';
  use Plivo\RestClient;

  $client = new RestClient("<auth_id>", "<auth_token>");

  $client->client->setTimeout(120);
  $optionalArgs = array(
      "limit" => 2,
      "offset" => 0
  );

  //  Create Priority Json
  $priority = array(
      "priority1" => "tollfree",
      "priority2" => "longcode",
      "priority3" => "shortcode"
  );

  //  Create Number Priority Json
  $number_priority = array(
      "country_iso" => "US",
      "priority" => $priority,
      "service_type" => "SMS"
  );

  // Update a Powerpack - Flexible Priority
  try
  {
      $powerpack = $client->powerpacks->get("<powerpack_uuid>");
      $response = $powerpack->update(["name" => "<powerpack_name>", "number_priority" => array($number_priority)]);
      print_r($response);
  }
  catch(PlivoRestException $ex)
  {
      print_r($ex);
  }
  ```

  ```java Java theme={null}
  package com.plivo.api;

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

  public class PowerpackTest {
      public static void main(String[] args) {
          Plivo.init("<auth_id>", "<auth_token>");
          // Update Powerpack
          try {
              Powerpack powerpack = Powerpack.getter("powerpack_uuid").get();
              NumberPriority[] numberPriorities = new NumberPriority[1];
              // Priority(""priority1"",""priority2"", ""priority3"")
              Priority priority = new Priority("shortcode", "tollfree", "longcode");
              // NumberPriority(""country_iso"", ""priority"", ""service_type"")
              NumberPriority numberPriority = new NumberPriority("CA", priority, "MMS");
              numberPriorities[0] = numberPriority;
              PowerpackUpdateResponse response = powerpack.updater().number_priority(numberPriorities).update();
              System.out.println(response);
          } catch (PlivoRestException | IOException e) {
              e.printStackTrace();
          }
      }
  }
  ```

  ```csharp .NET theme={null}
  using System;
  using System.Collections.Generic;
  using Plivo;
  using Plivo.Exception;
  using Plivo.Resource.Powerpack;
  // using Plivo.Resource.Powerpack.NumberPriority;

  namespace dotnet_project
  {
      class Sms
      {
          public static void Main(string[] args)
          {

              var api = new PlivoApi("<auth_id>","<auth_token>");

              // Define Priority
              Priority p1 = new Priority();
              p1.priority1 = "longcode";
              p1.priority2 = "shortcode";
              p1.priority3 = "tollfree";

              // Set Number Priority based on service_type & country
              NumberPriority numberPriority = new NumberPriority();
              numberPriority.service_type = "SMS";
              numberPriority.country_iso = "US";
              numberPriority.priority = p1;

              List<NumberPriority> list = new List<NumberPriority>(){numberPriority};  

              // Update a Powerpack
              Console.WriteLine("Update a Powerpack");
              try
              {
                  var response = api.Powerpacks.Update(uuid: "<powerpack_uuid>",
                                                          name: "<powerpack_name>", 
                                                          sticky_sender: true,
                                                          local_connect: true,
                                                          number_priority: list);
                  Console.WriteLine(response);
              }
              catch (PlivoRestException e)
              {
                  Console.WriteLine("Exception:" + e.Message);
              }

          }
      }
  }"
  ```

  ```go Go theme={null}
  package main

  import (
      "fmt"

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

  func main() {

      client, err: = plivo.NewClient("<auth_id>", "<auth_token>", & plivo.ClientOptions {})
      if err != nil {
          panic(err)
      }

      // Define Priority
      priority: = plivo.Priority {
          Priority1: strPtr("shortcode"),
          Priority2: strPtr("tollfree"),
          Priority3: strPtr("longcode")
      }

      np_json: = plivo.NumberPriority {
          "SMS", "CA", priority
      }
      priority_array: = [] plivo.NumberPriority {
          np_json
      }

      // Create a Powerpack
      response, err: = client.Powerpack.Create(plivo.PowerackCreateParams {
          Name: "<new_powerpack_name>",
          StickySender: false,
          LocalConnect: true,
          NumberPriorities: priority_array,
      }, )
      if err != nil {
          panic(err)
      }
      fmt.Printf("Response: %#v\n", response)

  }

  func strPtr(s string) * string {
      return &s
  }
  ```

  ```sh cURL theme={null}
  curl --location --request POST 'https://api.plivo.com/v1/Account/<auth_id>/Powerpack/' \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Basic xxxxxxxxxxxxx' \
  --data-raw '{
          "name": "<new powerpack name>",
          "sticky_sender": false,
      "number_priority": [
          {
              "country_iso": "US",
              "priority": {
                  "priority1": "longcode",
                  "priority2": "shortcode",
                  "priority3": "tollfree"
              },
              "service_type": "MMS"
          },
          {
              "country_iso": "CA",
              "priority": {
                  "priority1": "longcode",
                  "priority2": "shortcode",
                  "priority3": "tollfree"
              },
              "service_type": "SMS"
          },
          {
              "country_iso": "US",
              "priority": {
                  "priority1": "longcode",
                  "priority2": "shortcode",
                  "priority3": "tollfree"
              },
              "service_type": "SMS"
          },
          {
              "country_iso": "CA",
              "priority": {
                  "priority1": "longcode",
                  "priority2": "shortcode",
                  "priority3": "tollfree"
              },
              "service_type": "MMS"
          }
      ],
      "local_connect": true
  }
  ```
</RequestExample>

### Response

```json theme={null}
{
   "api_id":"8b583f08-ae57-11eb-8840-0242ac110003",
   "application_id":"",
   "application_type":"",
   "created_on":"2020-09-23T09:31:25.924044Z",
   "local_connect":true,
   "name":"<powerpack_name>",
   "number_pool":"/v1/Account/<power_uuid>/NumberPool/<numberpool_id>/",
   "number_priority":[
      {
         "country_iso":"US",
         "priority":{
            "priority1":"shortcode",
            "priority2":"tollfree",
            "priority3":"longcode"
         },
         "service_type":"MMS"
      },
      {
         "country_iso":"CA",
         "priority":{
            "priority1":"shortcode",
            "priority2":"tollfree",
            "priority3":"longcode"
         },
         "service_type":"SMS"
      },
      {
         "country_iso":"US",
         "priority":{
            "priority1":"shortcode",
            "priority2":"longcode",
            "priority3":"tollfree"
         },
         "service_type":"SMS"
      },
      {
         "country_iso":"CA",
         "priority":{
            "priority1":"longcode",
            "priority2":"tollfree",
            "priority3":"shortcode"
         },
         "service_type":"MMS"
      }
   ],
   "sticky_sender":true,
   "uuid":"<powerpack_uuid>"
}
```
