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
Unique identifier for the Powerpack.
The name of the Powerpack. Must be unique across all Powerpacks in your account.
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.
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.
The type of application connected to this Powerpack. Allowed values: xml, phlo.
The ID of the PHLO or XML application associated with this Powerpack.
The URL path to the number pool associated with this Powerpack.
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.
The timestamp when the Powerpack was created, in UTC format.
Example Powerpack Object
{
"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
The number of results per page. The maximum number of results that can be fetched is 20. Defaults to 20.
The number of value items by which the results should be offset. Defaults to 0. Read more about offset-based pagination.
curl -X GET 'https://api.plivo.com/v1/Account/<auth_id>/Powerpack/?limit=20&offset=0' \
-u '<auth_id>:<auth_token>'
import plivo
client = plivo.RestClient('<auth_id>', '<auth_token>')
response = client.powerpacks.list(offset=0, limit=20)
print(response)
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));
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
{
"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
The unique identifier of the Powerpack to retrieve. Specified in the request URL.
curl -X GET 'https://api.plivo.com/v1/Account/<auth_id>/Powerpack/<powerpack_uuid>/' \
-u '<auth_id>:<auth_token>'
import plivo
client = plivo.RestClient('<auth_id>', '<auth_token>')
powerpack = client.powerpacks.get(uuid="<powerpack_uuid>")
print(powerpack)
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));
require 'plivo'
api = Plivo::RestClient.new("<auth_id>", "<auth_token>")
response = api.powerpacks.get(uuid: '<powerpack_uuid>')
puts response
Response
{
"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
Must be unique across all Powerpacks in your account.
Whether 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.
Whether 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.
Conditional - Must be specified if application_id is specified. Allowed values: xml, phlo.
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.
An array of number priority configurations. Each object contains country_iso, service_type, and priority with priority1, priority2, and priority3 values.
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"
}]
}'
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)
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));
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
{
"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
The unique identifier of the Powerpack to update. Specified in the request URL.
Must be unique across all Powerpacks in your account.
Whether Sticky Sender should be enabled. Defaults to true.
Whether Local Connect should be enabled. Defaults to true.
Conditional - Must be specified if application_id is specified and is not "none". Allowed values: xml, phlo.
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.
An array of number priority configurations to update.
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"
}]
}'
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)
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));
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
{
"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
The unique identifier of the Powerpack to delete. Specified in the request URL.
If set to true, all numbers connected to the Powerpack will be unrented. Defaults to false.
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}'
import plivo
client = plivo.RestClient('<auth_id>', '<auth_token>')
powerpack = client.powerpacks.get(uuid="<powerpack_uuid>")
response = powerpack.delete(unrent_numbers=False)
print(response)
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));
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.