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

# List all numbers

> List all numbers in a Powerpack number pool by UUID

This API fetches a list of numbers from a number pool based on the `number_pool_UUID` specified in the resource URI.

#### API Endpoint

```text GET theme={null}
https://api.plivo.com/v1/Account/{auth_id}/NumberPool/{number_pool_uuid}/Number/
```

### Arguments

<table>
  <tbody>
    <tr>
      <td><strong>starts\_with</strong></td>
      <td>A comma-separated list of prefixes. Assume the values provided exclude the country code prefix. A max of 10 prefixes may be specified. Throws 400 Bad Request if more than 10 prefixes are specified.</td>
    </tr>

    <tr>
      <td><strong>type</strong></td>
      <td>fixed, toll-free, or mobile. Note that local and national numbers should be considered as ‘fixed’.</td>
    </tr>

    <tr>
      <td><strong>service</strong></td>
      <td>sms or mms. Use this argument to filter the numbers by capability.</td>
    </tr>

    <tr>
      <td><strong>country\_iso2<br />Conditional</strong></td>
      <td>ISO2 code of the phone number country. This attribute must be specified if the starts\_with filter is specified.</td>
    </tr>

    <tr>
      <td><strong>limit</strong></td>
      <td>Used to display the number of results per page. The maximum number of results that can be fetched is 20. Defaults to 20.</td>
    </tr>

    <tr>
      <td><strong>offset</strong></td>

      <td>
        <p>Denotes the number of value items by which the results should be offset. Defaults to 0. Read more about <a href="https://docs.plivo.com/docs/messaging/api/request/pagination">offset-based pagination</a>.</p>
      </td>
    </tr>
  </tbody>
</table>

### Returns

This API returns the list of numbers from the number pool that match the filters specified in the request.

The API response also contains a `meta` field with the following fields:

* `limit`: The size of the page returned in the response.
* `next`: The URL that points to the next page of results.
* `offset`: The offset for the page returned in the response.
* `previous`: The URL that points to the previous page of results.
* `total_count`: The total number of records that match the specified filters.

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

  client = plivo.RestClient('<auth_id>','<auth_token>')
  powerpack = client.powerpacks.get(uuid="<powerpack_uuid>")
  print str(powerpack.list_numbers(starts_with=512, country_iso2='US'))
  ```

  ```ruby Ruby theme={null}
  require 'rubygems'
  require 'plivo'
  include Plivo
  include Plivo::Exceptions

  api = RestClient.new("<auth_id>","<auth_token>")
  begin
    powerpack = api.powerpacks.get(uuid='<powerpack_uuid>')
    puts powerpack
    response = powerpack.list_numbers(limit: 2,offset: 0)
    puts response
  rescue PlivoRESTError => e
    puts 'Exception: ' + e.message
  end
  ```

  ```js Node theme={null}
  var plivo = require('plivo');
  var client = new plivo.Client("<auth_id>","<auth_token>");

  client.powerpacks
   .get("<powerpack_uuid>")
   .then(function (powerpack) {
     return powerpack.list_numbers({
       limit:'2',
       offset:'1'
     });
   })
   .then(function (result) {
     console.log(result);
   })
   .catch(function (response) {
     console.log(response);
   });
  ```

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

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

  try {
      $powerpack = $client->powerpacks->get("<powerpack_uuid>");
      $response = $powerpack->list_numbers(['starts_with'=>'441']);

      print_r($response);
  }
  catch (PlivoRestException $ex) {
      print_r($ex);
  }
  ```

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

  import com.plivo.api.models.base.ListResponse;
  import com.plivo.api.models.powerpack.Numbers;
  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();
        ListResponse<Numbers> response = powerpack.list_numbers().list();
        System.out.println(response);
      }
      catch (  PlivoRestException | IOException e ) {
        e.printStackTrace();
      }
    }
  }
  ```

  ```csharp .NET theme={null}
  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.List(offset:0,limit:2);
                  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 {
  		fmt.Print("Error", err.Error())
  		return
  	}
  	powerpack, err := client.Powerpack.Get("<powerpack_uuid>")
  	if err != nil {
  		fmt.Print("Error", err.Error())
  		return
  	}
  	// List all Numbers - Use params to filter out mms or sms numbers
  	response, err := powerpack.List_numbers(plivo.PowerpackSearchParam{
  		Service: "mms",
  	})
  	if err != nil {
  		fmt.Print("Error", err.Error())
  		return
  	}
  	fmt.Printf("Response: %#v\n", response)
  }
  ```

  ```sh cURL theme={null}
  curl -X GET -i --user auth_id:auth_token \
  -H "Content-Type: application/json" \
  https://api.plivo.com/v1/Account/{auth_id}/NumberPool/{number_pool_uuid}/Number?starts_with=484&country_iso2=us’
  ```
</RequestExample>

### Response

```json theme={null}
{
  "api_id": "06c15d7c-7ed5-11ea-855f-0242ac110003",
  "meta": {
    "limit": 20,
    "next": "",
    "offset": 0,
    "previous": "",
    "total_count": 1
  },
  "objects": [
    {
      "account_phone_number_resource": "/v1/Account/{auth_id}/Number/{your_number}/",
      "added_on": "2023-03-18T16:07:39.379739Z",
      "country_iso2": "US",
      "number": "{your_number}",
      "number_pool_uuid": "{number_pool_uuid}",
      "service": "mms",
      "type": "fixed"
    },
   {
      "account_phone_number_resource": "/v1/Account/{auth_id}/Number/{your_number}/",
      "added_on": "2023-03-18T16:07:39.379739Z",
      "country_iso2": "US",
      "number": "{your_number}",
      "number_pool_uuid": "{number_pool_uuid}",
      "service": "sms",
      "type": "fixed"
    }
    {
      "account_phone_number_resource": "/v1/Account/{auth_id}/Number/{your_number}/",
      "added_on": "2022-10-09T11:24:35.085797Z",
      "country_iso2": "CA",
      "number": "{your_number}",
      "number_pool_uuid": "{number_pool_uuid}",
      "service": "sms",
      "type": "fixed"
    }
  ]
}
```
