Number Pools

Number Pools API

Baixar a especificação OpenAPI

Pools

Pool management

List all pools

Return all of the pools available on an account

gethttps://api.nexmo.com/v2/numberpools/accounts/:account_id/pools

Autenticação

ChaveDescriçãoOndeExemplo
Authorization

Chave e segredo da API codificados em Base64, separados por dois pontos.
Leia mais

Headers

Basic <base64>

Caminho Parâmetros

account_id
string
Obrigatório
exemploabcd1234

Account ID to filter to. Use your Vonage API key as the value. You can see your API Key on your Vonage API Dashboard.

Consulta Parâmetros

page_size
integer
exemplo10

Number of objects to return on page

page
integer
Mín.1
exemplo2

Page to offset the result to

Respostas
Tipo de conteúdo
application/json

List of pools that are available

page_size
integer
exemplo10

Items per page

page
integer
Mín.1
exemplo2

Page Offset

total_pages
integer
Mín.1
exemplo100

Number of pages in the entire result set

total_items
integer
exemplo100

Number of items in the entire result set

_embedded
object
pools
array
fallback
string
exemploPool

Specifies the behaviour when no number with matching prefix

Deve ser uma das seguintes opções:PoolCustomFromReject
localized_sender_preferred
boolean
exemplotrue

If set to true and such a number is available, select a number at random from within this pool with the same country prefix as the destination.

predictable_sender_preferred
boolean
exemplotrue

When true, select the same Sender ID on any subsequent messages to a given destination.

pool_id
string
exemplopool_name

ID assigned to a pool of numbers

account_id
string
exemploabcd1234

Account ID to work against

_links
object
self
object
href
string
exemplo/v2/numberpools/abcd123/custom_user_pool_id

Link to the current pool

numbers
object
href
string
exemplo/v2/numberpools/abcd123/custom_user_pool_id/numbers

Link to the numbers in the pool

_links
object
self
object
href
string
exemplo/v2/numberpools?page=3

Link to the current page

next
object
href
string
exemplo/v2/numberpools?page=4

Link to the next available page

previous
object
href
string
exemplo/v2/numberpools?page=2

Link to the previous available page

first
object
href
string
exemplo/v2/numberpools?page=1

Link to the first available page

last
object
href
string
exemplo/v2/numberpools?page=10

Link to the last available page

Exemplo Resposta

{
   "page_size": 10,
   "page": 2,
   "total_pages": 100,
   "total_items": 100,
   "_embedded": {
      "pools": [
         {
            "fallback": "Pool",
            "localized_sender_preferred": true,
            "predictable_sender_preferred": true,
            "pool_id": "pool_name",
            "account_id": "abcd1234",
            "_links": {
               "self": {
                  "href": "/v2/numberpools/abcd123/custom_user_pool_id"
               },
               "numbers": {
                  "href": "/v2/numberpools/abcd123/custom_user_pool_id/numbers"
               }
            }
         }
      ]
   },
   "_links": {
      "self": {
         "href": "/v2/numberpools?page=3"
      },
      "next": {
         "href": "/v2/numberpools?page=4"
      },
      "previous": {
         "href": "/v2/numberpools?page=2"
      },
      "first": {
         "href": "/v2/numberpools?page=1"
      },
      "last": {
         "href": "/v2/numberpools?page=10"
      }
   }
}

Create a new pool of numbers

Create a pool that will contain a list of numbers to send or call from

posthttps://api.nexmo.com/v2/numberpools/accounts/:account_id/pools

Autenticação

ChaveDescriçãoOndeExemplo
Authorization

Chave e segredo da API codificados em Base64, separados por dois pontos.
Leia mais

Headers

Basic <base64>

Caminho Parâmetros

account_id
string
Obrigatório
exemploabcd1234

Account ID to filter to. Use your Vonage API key as the value. You can see your API Key on your Vonage API Dashboard.

Corpo da solicitação
Tipo de conteúdo
application/json

fallback
string
Obrigatório
exemploPool

Specifies the behaviour when no number with matching prefix

Deve ser uma das seguintes opções:PoolCustomFromReject
localized_sender_preferred
boolean
Obrigatório
exemplotrue

If set to true and such a number is available, select a number at random from within this pool with the same country prefix as the destination.

predictable_sender_preferred
boolean
Obrigatório
exemplotrue

When true, select the same Sender ID on any subsequent messages to a given destination.

pool_id
string
Obrigatório
exemplopool_name

ID assigned to a pool of numbers

Exemplo Solicitação

{
   "fallback": "Pool",
   "localized_sender_preferred": true,
   "predictable_sender_preferred": true,
   "pool_id": "pool_name"
}
{
   "fallback": "Pool",
   "localized_sender_preferred": true,
   "predictable_sender_preferred": true,
   "pool_id": "pool_name"
}

Respostas
Tipo de conteúdo
application/json

Information about a specific pool

fallback
string
exemploPool

Specifies the behaviour when no number with matching prefix

Deve ser uma das seguintes opções:PoolCustomFromReject
localized_sender_preferred
boolean
exemplotrue

If set to true and such a number is available, select a number at random from within this pool with the same country prefix as the destination.

predictable_sender_preferred
boolean
exemplotrue

When true, select the same Sender ID on any subsequent messages to a given destination.

pool_id
string
exemplopool_name

ID assigned to a pool of numbers

account_id
string
exemploabcd1234

Account ID to work against

_links
object
self
object
href
string
exemplo/v2/numberpools/abcd123/custom_user_pool_id

Link to the current pool

numbers
object
href
string
exemplo/v2/numberpools/abcd123/custom_user_pool_id/numbers

Link to the numbers in the pool

Exemplo Resposta

{
   "fallback": "Pool",
   "localized_sender_preferred": true,
   "predictable_sender_preferred": true,
   "pool_id": "pool_name",
   "account_id": "abcd1234",
   "_links": {
      "self": {
         "href": "/v2/numberpools/abcd123/custom_user_pool_id"
      },
      "numbers": {
         "href": "/v2/numberpools/abcd123/custom_user_pool_id/numbers"
      }
   }
}

Get information about a specific pool

Get information about a specific pool

gethttps://api.nexmo.com/v2/numberpools/accounts/:account_id/pools/:pool_id

Autenticação

ChaveDescriçãoOndeExemplo
Authorization

Chave e segredo da API codificados em Base64, separados por dois pontos.
Leia mais

Headers

Basic <base64>

Caminho Parâmetros

account_id
string
Obrigatório
exemploabcd1234

Account ID to filter to. Use your Vonage API key as the value. You can see your API Key on your Vonage API Dashboard.

pool_id
string
Obrigatório
exemplopool_name

Pool ID to work with

Respostas
Tipo de conteúdo
application/json

Information about a specific pool

fallback
string
exemploPool

Specifies the behaviour when no number with matching prefix

Deve ser uma das seguintes opções:PoolCustomFromReject
localized_sender_preferred
boolean
exemplotrue

If set to true and such a number is available, select a number at random from within this pool with the same country prefix as the destination.

predictable_sender_preferred
boolean
exemplotrue

When true, select the same Sender ID on any subsequent messages to a given destination.

pool_id
string
exemplopool_name

ID assigned to a pool of numbers

account_id
string
exemploabcd1234

Account ID to work against

_links
object
self
object
href
string
exemplo/v2/numberpools/abcd123/custom_user_pool_id

Link to the current pool

numbers
object
href
string
exemplo/v2/numberpools/abcd123/custom_user_pool_id/numbers

Link to the numbers in the pool

Exemplo Resposta

{
   "fallback": "Pool",
   "localized_sender_preferred": true,
   "predictable_sender_preferred": true,
   "pool_id": "pool_name",
   "account_id": "abcd1234",
   "_links": {
      "self": {
         "href": "/v2/numberpools/abcd123/custom_user_pool_id"
      },
      "numbers": {
         "href": "/v2/numberpools/abcd123/custom_user_pool_id/numbers"
      }
   }
}

Update part of a number pool

Update an existing pool with new information without requiring all information

patchhttps://api.nexmo.com/v2/numberpools/accounts/:account_id/pools/:pool_id

Autenticação

ChaveDescriçãoOndeExemplo
Authorization

Chave e segredo da API codificados em Base64, separados por dois pontos.
Leia mais

Headers

Basic <base64>

Caminho Parâmetros

account_id
string
Obrigatório
exemploabcd1234

Account ID to filter to. Use your Vonage API key as the value. You can see your API Key on your Vonage API Dashboard.

pool_id
string
Obrigatório
exemplopool_name

Pool ID to work with

Corpo da solicitação
Tipo de conteúdo
application/json

fallback
string
exemploPool

Specifies the behaviour when no number with matching prefix

Deve ser uma das seguintes opções:PoolCustomFromReject
localized_sender_preferred
boolean
exemplotrue

If set to true and such a number is available, select a number at random from within this pool with the same country prefix as the destination.

predictable_sender_preferred
boolean
exemplotrue

When true, select the same Sender ID on any subsequent messages to a given destination.

pool_id
string
exemplopool_name

ID assigned to a pool of numbers

Exemplo Solicitação

{
   "fallback": "Pool",
   "localized_sender_preferred": true,
   "predictable_sender_preferred": true,
   "pool_id": "pool_name"
}
{}

Respostas
Tipo de conteúdo
application/json

Information about a specific pool

fallback
string
exemploPool

Specifies the behaviour when no number with matching prefix

Deve ser uma das seguintes opções:PoolCustomFromReject
localized_sender_preferred
boolean
exemplotrue

If set to true and such a number is available, select a number at random from within this pool with the same country prefix as the destination.

predictable_sender_preferred
boolean
exemplotrue

When true, select the same Sender ID on any subsequent messages to a given destination.

pool_id
string
exemplopool_name

ID assigned to a pool of numbers

account_id
string
exemploabcd1234

Account ID to work against

_links
object
self
object
href
string
exemplo/v2/numberpools/abcd123/custom_user_pool_id

Link to the current pool

numbers
object
href
string
exemplo/v2/numberpools/abcd123/custom_user_pool_id/numbers

Link to the numbers in the pool

Exemplo Resposta

{
   "fallback": "Pool",
   "localized_sender_preferred": true,
   "predictable_sender_preferred": true,
   "pool_id": "pool_name",
   "account_id": "abcd1234",
   "_links": {
      "self": {
         "href": "/v2/numberpools/abcd123/custom_user_pool_id"
      },
      "numbers": {
         "href": "/v2/numberpools/abcd123/custom_user_pool_id/numbers"
      }
   }
}

Delete a specific pool

Delete a specific pool

deletehttps://api.nexmo.com/v2/numberpools/accounts/:account_id/pools/:pool_id

Autenticação

ChaveDescriçãoOndeExemplo
Authorization

Chave e segredo da API codificados em Base64, separados por dois pontos.
Leia mais

Headers

Basic <base64>

Caminho Parâmetros

account_id
string
Obrigatório
exemploabcd1234

Account ID to filter to. Use your Vonage API key as the value. You can see your API Key on your Vonage API Dashboard.

pool_id
string
Obrigatório
exemplopool_name

Pool ID to work with

Respostas
Tipo de conteúdo
application/json

Information about a specific pool

fallback
string
exemploPool

Specifies the behaviour when no number with matching prefix

Deve ser uma das seguintes opções:PoolCustomFromReject
localized_sender_preferred
boolean
exemplotrue

If set to true and such a number is available, select a number at random from within this pool with the same country prefix as the destination.

predictable_sender_preferred
boolean
exemplotrue

When true, select the same Sender ID on any subsequent messages to a given destination.

pool_id
string
exemplopool_name

ID assigned to a pool of numbers

account_id
string
exemploabcd1234

Account ID to work against

_links
object
self
object
href
string
exemplo/v2/numberpools/abcd123/custom_user_pool_id

Link to the current pool

numbers
object
href
string
exemplo/v2/numberpools/abcd123/custom_user_pool_id/numbers

Link to the numbers in the pool

Exemplo Resposta

{
   "fallback": "Pool",
   "localized_sender_preferred": true,
   "predictable_sender_preferred": true,
   "pool_id": "pool_name",
   "account_id": "abcd1234",
   "_links": {
      "self": {
         "href": "/v2/numberpools/abcd123/custom_user_pool_id"
      },
      "numbers": {
         "href": "/v2/numberpools/abcd123/custom_user_pool_id/numbers"
      }
   }
}

Numbers

Manage numbers within a pool

Get a list of numbers inside of a specific pool

Get numbers in a pool

gethttps://api.nexmo.com/v2/numberpools/accounts/:account_id/pools/:pool_id/numbers

Autenticação

ChaveDescriçãoOndeExemplo
Authorization

Chave e segredo da API codificados em Base64, separados por dois pontos.
Leia mais

Headers

Basic <base64>

Caminho Parâmetros

account_id
string
Obrigatório
exemploabcd1234

Account ID to filter to. Use your Vonage API key as the value. You can see your API Key on your Vonage API Dashboard.

pool_id
string
Obrigatório
exemplopool_name

Pool ID to work with

Consulta Parâmetros

page_size
integer
exemplo10

Number of objects to return on page

page
integer
Mín.1
exemplo2

Page to offset the result to

Respostas
Tipo de conteúdo
application/json

List of numbers that exist in a pool

page_size
integer
exemplo10

Items per page

page
integer
Mín.1
exemplo2

Page Offset

total_pages
integer
Mín.1
exemplo100

Number of pages in the entire result set

total_items
integer
exemplo100

Number of items in the entire result set

_embedded
object
numbers
array
_links
object
self
object
href
string
exemplo/v2/numberpools/abcd123/pool_id/numbers?page=3

Link to the current page

next
object
href
string
exemplo/v2/numberpools/abcd123/pool_id/numbers?page=4

Link to the next available page

previous
object
href
string
exemplo/v2/numberpools/abcd123/pool_id/numbers?page=2

Link to the previous available page

first
object
href
string
exemplo/v2/numberpools/abcd123/pool_id/numbers?page=1

Link to the first available page

last
object
href
string
exemplo/v2/numberpools/abcd123/pool_id/numbers?page=10

Link to the last available page

Exemplo Resposta

{
   "page_size": 10,
   "page": 2,
   "total_pages": 100,
   "total_items": 100,
   "_embedded": {
      "numbers": [
         "15556660001",
         "15556660002"
      ]
   },
   "_links": {
      "self": {
         "href": "/v2/numberpools/abcd123/pool_id/numbers?page=3"
      },
      "next": {
         "href": "/v2/numberpools/abcd123/pool_id/numbers?page=4"
      },
      "previous": {
         "href": "/v2/numberpools/abcd123/pool_id/numbers?page=2"
      },
      "first": {
         "href": "/v2/numberpools/abcd123/pool_id/numbers?page=1"
      },
      "last": {
         "href": "/v2/numberpools/abcd123/pool_id/numbers?page=10"
      }
   }
}

Add numbers to a pool

Add a series of numbers to a pool. This endpoint supports partial successes. If a request is partially successful, the response code will be 207 and information will be returned in the body.

If all items succeed, you will receive a 200. If all items fail, you will receive a 400.

posthttps://api.nexmo.com/v2/numberpools/accounts/:account_id/pools/:pool_id/numbers

Autenticação

ChaveDescriçãoOndeExemplo
Authorization

Chave e segredo da API codificados em Base64, separados por dois pontos.
Leia mais

Headers

Basic <base64>

Caminho Parâmetros

account_id
string
Obrigatório
exemploabcd1234

Account ID to filter to. Use your Vonage API key as the value. You can see your API Key on your Vonage API Dashboard.

pool_id
string
Obrigatório
exemplopool_name

Pool ID to work with

Corpo da solicitação
Tipo de conteúdo
application/json

numbers
array
Obrigatório

Exemplo Solicitação

{
   "numbers": [
      "15556660001",
      "15556660002"
   ]
}
{
   "numbers": [
      "15556660001",
      "15556660002"
   ]
}

Respostas
Tipo de conteúdo
application/json

Numbers successfully added to pool

numbers
array

Numbers added to pool

_links
object
self
object
href
string
exemplo/v2/numberpools/abcd123/custom_user_pool_id/numbers

Link back to the number pool

Exemplo Resposta

{
   "numbers": [
      "15556660001"
   ],
   "_links": {
      "self": {
         "href": "/v2/numberpools/abcd123/custom_user_pool_id/numbers"
      }
   }
}

Remove a series of number from a pool

Remove a series of numbers from a pool. This endpoint supports partial successes. If a request is partially successful, the response code will be 207 and details can be found in the response body.

If all items succeed, you will receive a 200. If all items fail, you will receive a 400.

posthttps://api.nexmo.com/v2/numberpools/accounts/:account_id/pools/:pool_id/numbers/delete

Autenticação

ChaveDescriçãoOndeExemplo
Authorization

Chave e segredo da API codificados em Base64, separados por dois pontos.
Leia mais

Headers

Basic <base64>

Caminho Parâmetros

account_id
string
Obrigatório
exemploabcd1234

Account ID to filter to. Use your Vonage API key as the value. You can see your API Key on your Vonage API Dashboard.

pool_id
string
Obrigatório
exemplopool_name

Pool ID to work with

Corpo da solicitação
Tipo de conteúdo
application/json

numbers
array
Obrigatório

Exemplo Solicitação

{
   "numbers": [
      "15556660001",
      "15556660002"
   ]
}
{
   "numbers": [
      "15556660001",
      "15556660002"
   ]
}

Respostas

No Content

Remove a specific of number from a pool

Remove a single number from a pool.

deletehttps://api.nexmo.com/v2/numberpools/accounts/:account_id/pools/:pool_id/numbers/:number

Autenticação

ChaveDescriçãoOndeExemplo
Authorization

Chave e segredo da API codificados em Base64, separados por dois pontos.
Leia mais

Headers

Basic <base64>

Caminho Parâmetros

account_id
string
Obrigatório
exemploabcd1234

Account ID to filter to. Use your Vonage API key as the value. You can see your API Key on your Vonage API Dashboard.

pool_id
string
Obrigatório
exemplopool_name

Pool ID to work with

number
string
Obrigatório
Mín.7
Max15
exemplo14155550110

Number to work with inside a pool

Respostas

No Content