> ## 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.

# Powerpack

> Manage Powerpacks for intelligent number pooling and traffic distribution

Powerpack APIs let you manage all of the Powerpacks and number pools in your account via an API request. Powerpacks enable intelligent number pooling with features like Sticky Sender and Local Connect for optimized message delivery.

## API Endpoint

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

***

## The Powerpack Object

### Attributes

**uuid** `string`

Unique identifier for the Powerpack.

**name** `string`

The name of the Powerpack. Must be unique across all Powerpacks in your account.

**sticky\_sender** `boolean`

Whether Sticky Sender is enabled. Sticky Sender ensures messages to a particular destination number are always sent from the same source number. Defaults to `true`.

**local\_connect** `boolean`

Whether Local Connect is enabled. Local Connect prioritizes local numbers matched on area code and state over other numbers in the pool. Defaults to `true`.

**application\_type** `string`

The type of application connected to this Powerpack. Allowed values: `xml`, `phlo`.

**application\_id** `string`

The ID of the PHLO or XML application associated with this Powerpack.

**number\_pool** `string`

The URL path to the number pool associated with this Powerpack.

**number\_priority** `array`

An array of number priority configurations specifying the order in which number types should be used for sending messages, organized by country and service type.

**created\_on** `string`

The timestamp when the Powerpack was created, in UTC format.

### Example Powerpack Object

```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": "my_powerpack",
  "number_pool": "/v1/Account/MAXXXXXXXXXX/NumberPool/abc123-def456/",
  "number_priority": [
    {
      "country_iso": "US",
      "priority": {
        "priority1": "shortcode",
        "priority2": "tollfree",
        "priority3": "longcode"
      },
      "service_type": "SMS"
    }
  ],
  "sticky_sender": true,
  "uuid": "abc123-def456-ghi789"
}
```

***

## List All Powerpacks

Fetches a list of all Powerpacks in your account.

```
GET https://api.plivo.com/v1/Account/{auth_id}/Powerpack/
```

### Arguments

**limit** `integer`

The number of results per page. The maximum number of results that can be fetched is 20. Defaults to 20.

**offset** `integer`

The number of value items by which the results should be offset. Defaults to 0. Read more about [offset-based pagination](https://plivo.com/docs/messaging/api/request/pagination).

```bash cURL theme={null}
curl -X GET 'https://api.plivo.com/v1/Account/<auth_id>/Powerpack/?limit=20&offset=0' \
    -u '<auth_id>:<auth_token>'
```

```python Python theme={null}
import plivo

client = plivo.RestClient('<auth_id>', '<auth_token>')
response = client.powerpacks.list(offset=0, limit=20)
print(response)
```

```javascript Node.js theme={null}
const plivo = require('plivo');

const client = new plivo.Client("<auth_id>", "<auth_token>");

client.powerpacks.list({ limit: 20, offset: 0 })
    .then(result => console.log(result))
    .catch(error => console.log(error));
```

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

api = Plivo::RestClient.new("<auth_id>", "<auth_token>")
response = api.powerpacks.list(offset: 0, limit: 20)
puts response
```

### Response

The response includes a `meta` field with pagination information:

* `limit`: The size of the page returned
* `offset`: The offset for the page returned
* `total_count`: The total number of records matching the filters
* `next`: URL pointing to the next page of results
* `previous`: URL pointing to the previous page of results

```json theme={null}
{
  "api_id": "e44c159e-0a02-11ea-b072-0242ac110007",
  "meta": {
    "limit": 20,
    "next": "/api/v1/account/MAXXXXXXXXXX/Powerpack?offset=20&limit=20",
    "offset": 0,
    "total_count": 53
  },
  "objects": [
    {
      "application_id": "",
      "application_type": "",
      "created_on": "2020-10-09T11:10:59.666461Z",
      "local_connect": true,
      "name": "powerpack_one",
      "number_pool": "/v1/Account/MAXXXXXXXXXX/NumberPool/abc123/",
      "sticky_sender": true,
      "uuid": "abc123-def456"
    },
    {
      "application_id": "",
      "application_type": "",
      "created_on": "2020-10-09T17:03:31.837944Z",
      "local_connect": false,
      "name": "powerpack_two",
      "number_pool": "/v1/Account/MAXXXXXXXXXX/NumberPool/def456/",
      "sticky_sender": false,
      "uuid": "def456-ghi789"
    }
  ]
}
```

***

## Retrieve a Powerpack

Retrieves the details of a specific Powerpack.

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

### Arguments

**powerpack\_uuid** `string` *required*

The unique identifier of the Powerpack to retrieve. Specified in the request URL.

```bash cURL theme={null}
curl -X GET 'https://api.plivo.com/v1/Account/<auth_id>/Powerpack/<powerpack_uuid>/' \
    -u '<auth_id>:<auth_token>'
```

```python Python theme={null}
import plivo

client = plivo.RestClient('<auth_id>', '<auth_token>')
powerpack = client.powerpacks.get(uuid="<powerpack_uuid>")
print(powerpack)
```

```javascript Node.js theme={null}
const plivo = require('plivo');

const client = new plivo.Client("<auth_id>", "<auth_token>");

client.powerpacks.get("<powerpack_uuid>")
    .then(result => console.log(result))
    .catch(error => console.log(error));
```

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

api = Plivo::RestClient.new("<auth_id>", "<auth_token>")
response = api.powerpacks.get(uuid: '<powerpack_uuid>')
puts response
```

### 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": "my_powerpack",
  "number_pool": "/v1/Account/MAXXXXXXXXXX/NumberPool/abc123-def456/",
  "number_priority": [
    {
      "country_iso": "US",
      "priority": {
        "priority1": "shortcode",
        "priority2": "tollfree",
        "priority3": "longcode"
      },
      "service_type": "SMS"
    }
  ],
  "sticky_sender": true,
  "uuid": "abc123-def456-ghi789"
}
```

***

## Create a Powerpack

Create a new Powerpack for intelligent number pooling and traffic distribution.

```
POST https://api.plivo.com/v1/Account/{auth_id}/Powerpack/
```

### Arguments

**name** `string` *required*

Must be unique across all Powerpacks in your account.

**sticky\_sender** `boolean`

Whether [Sticky Sender](https://plivo.com/docs/messaging/concepts/powerpack.md#sticky-sender) should be enabled. Sticky Sender ensures messages to a particular destination number are always sent from the same source number. Defaults to `true`.

**local\_connect** `boolean`

Whether [Local Connect](https://plivo.com/docs/messaging/concepts/powerpack.md#local-connect) should be enabled. Local Connect prioritizes local numbers matched on area code and state over other numbers in the pool. Defaults to `true`.

**application\_type** `string`

**Conditional** - Must be specified if `application_id` is specified. Allowed values: `xml`, `phlo`.

**application\_id** `string`

Must be set to a valid PHLO or XML App ID or `"none"`. If not specified (or set to `"none"`), no application will be associated with phone numbers added to this Powerpack.

**number\_priority** `array`

An array of number priority configurations. Each object contains `country_iso`, `service_type`, and `priority` with `priority1`, `priority2`, and `priority3` values.

```bash cURL theme={null}
curl -X POST 'https://api.plivo.com/v1/Account/<auth_id>/Powerpack/' \
    -H 'Content-Type: application/json' \
    -u '<auth_id>:<auth_token>' \
    -d '{
        "name": "my_powerpack",
        "sticky_sender": true,
        "local_connect": true,
        "number_priority": [{
            "country_iso": "US",
            "priority": {
                "priority1": "longcode",
                "priority2": "shortcode",
                "priority3": "tollfree"
            },
            "service_type": "SMS"
        }]
    }'
```

```python Python theme={null}
import plivo

client = plivo.RestClient('<auth_id>', '<auth_token>')
number_priorities = [{
    'country_iso': 'US',
    'priority': {
        'priority1': 'shortcode',
        'priority2': 'longcode',
        'priority3': 'tollfree'
    },
    'service_type': 'SMS'
}]
powerpack = client.powerpacks.create(
    name="my_powerpack",
    sticky_sender=True,
    number_priority=number_priorities
)
print(powerpack)
```

```javascript Node.js theme={null}
const plivo = require('plivo');

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

const params = {
    sticky_sender: true,
    local_connect: true,
    number_priority: [{
        service_type: "SMS",
        country_iso: "US",
        priority: {
            priority1: "longcode",
            priority2: "shortcode",
            priority3: "tollfree"
        }
    }]
};

client.powerpacks.create("my_powerpack", params)
    .then(result => console.log(result));
```

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

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

number_priority = [{
    "country_iso" => "US",
    "priority" => {
        "priority1" => "tollfree",
        "priority2" => "longcode",
        "priority3" => "shortcode"
    },
    "service_type" => "SMS"
}]

response = api.powerpacks.create(
    'my_powerpack',
    sticky_sender: true,
    local_connect: false,
    number_priority: number_priority
)
puts response
```

### 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": "my_powerpack",
  "number_pool": "/v1/Account/MAXXXXXXXXXX/NumberPool/abc123-def456/",
  "number_priority": [
    {
      "country_iso": "US",
      "priority": {
        "priority1": "shortcode",
        "priority2": "tollfree",
        "priority3": "longcode"
      },
      "service_type": "SMS"
    }
  ],
  "sticky_sender": true,
  "uuid": "abc123-def456-ghi789"
}
```

***

## Update a Powerpack

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

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

### Arguments

**powerpack\_uuid** `string` *required*

The unique identifier of the Powerpack to update. Specified in the request URL.

**name** `string`

Must be unique across all Powerpacks in your account.

**sticky\_sender** `boolean`

Whether Sticky Sender should be enabled. Defaults to `true`.

**local\_connect** `boolean`

Whether Local Connect should be enabled. Defaults to `true`.

**application\_type** `string`

**Conditional** - Must be specified if `application_id` is specified and is not `"none"`. Allowed values: `xml`, `phlo`.

**application\_id** `string`

Must be set to a valid PHLO or XML App ID or `"none"`. If not specified (or set to `"none"`), no application will be associated with phone numbers added to this Powerpack.

**number\_priority** `array`

An array of number priority configurations to update.

```bash cURL theme={null}
curl -X POST 'https://api.plivo.com/v1/Account/<auth_id>/Powerpack/<powerpack_uuid>/' \
    -H 'Content-Type: application/json' \
    -u '<auth_id>:<auth_token>' \
    -d '{
        "name": "updated_powerpack_name",
        "sticky_sender": true,
        "local_connect": true,
        "number_priority": [{
            "country_iso": "US",
            "priority": {
                "priority1": "longcode",
                "priority2": "shortcode",
                "priority3": "tollfree"
            },
            "service_type": "SMS"
        }]
    }'
```

```python Python theme={null}
import plivo

client = plivo.RestClient('<auth_id>', '<auth_token>')
powerpack = client.powerpacks.get(uuid="<powerpack_uuid>")

number_priorities = [{
    'country_iso': 'US',
    'priority': {
        'priority1': 'longcode',
        'priority2': 'tollfree',
        'priority3': 'shortcode'
    },
    'service_type': 'SMS'
}]

response = powerpack.update({
    "name": "updated_powerpack_name",
    "number_priority": number_priorities
})
print(response)
```

```javascript Node.js theme={null}
const plivo = require('plivo');

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

const params = {
    name: "updated_powerpack_name",
    number_priority: [{
        service_type: "SMS",
        country_iso: "US",
        priority: {
            priority1: "tollfree",
            priority2: "shortcode",
            priority3: "longcode"
        }
    }]
};

client.powerpacks.update("<powerpack_uuid>", params)
    .then(result => console.log(result));
```

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

api = Plivo::RestClient.new("<auth_id>", "<auth_token>")
powerpack = api.powerpacks.get("<powerpack_uuid>")

number_priority = [{
    "country_iso" => "US",
    "priority" => {
        "priority1" => "tollfree",
        "priority2" => "longcode",
        "priority3" => "shortcode"
    },
    "service_type" => "SMS"
}]

response = powerpack.update(
    name: 'updated_powerpack_name',
    sticky_sender: true,
    local_connect: false,
    number_priority: number_priority
)
puts response
```

### 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": "updated_powerpack_name",
  "number_pool": "/v1/Account/MAXXXXXXXXXX/NumberPool/abc123-def456/",
  "number_priority": [
    {
      "country_iso": "US",
      "priority": {
        "priority1": "longcode",
        "priority2": "shortcode",
        "priority3": "tollfree"
      },
      "service_type": "SMS"
    }
  ],
  "sticky_sender": true,
  "uuid": "abc123-def456-ghi789"
}
```

***

## Delete a Powerpack

Deletes a single Powerpack. This operation cannot be undone.

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

### Arguments

**powerpack\_uuid** `string` *required*

The unique identifier of the Powerpack to delete. Specified in the request URL.

**unrent\_numbers** `boolean`

If set to `true`, all numbers connected to the Powerpack will be unrented. Defaults to `false`.

```bash cURL theme={null}
curl -X DELETE 'https://api.plivo.com/v1/Account/<auth_id>/Powerpack/<powerpack_uuid>/' \
    -H 'Content-Type: application/json' \
    -u '<auth_id>:<auth_token>' \
    -d '{"unrent_numbers": false}'
```

```python Python theme={null}
import plivo

client = plivo.RestClient('<auth_id>', '<auth_token>')
powerpack = client.powerpacks.get(uuid="<powerpack_uuid>")
response = powerpack.delete(unrent_numbers=False)
print(response)
```

```javascript Node.js theme={null}
const plivo = require('plivo');

const client = new plivo.Client("<auth_id>", "<auth_token>");

client.powerpacks.get("<powerpack_uuid>")
    .then(powerpack => powerpack.delete())
    .then(result => console.log(result))
    .catch(error => console.log(error));
```

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

api = Plivo::RestClient.new("<auth_id>", "<auth_token>")
powerpack = api.powerpacks.get(uuid: '<powerpack_uuid>')
response = powerpack.delete(true)
puts response
```

### Response

Returns an empty response with HTTP status code 204 on successful deletion.
