Numbers API

List and query DID (Direct Inward Dial) numbers assigned to your account.

Numbers page in ZPBX

List numbers

GET /v1/numbers

Query parameters

ParameterTypeDefaultDescription
pageSizenumber50Records per page (max 1000)
cursorstringPagination cursor from nextPageUrl
statusenumAVAILABLE, ALLOCATED, RESERVED
countrystringISO country code (e.g. NG, GB)
routingTypestringFilter by routing type
billingGroupIdstringFilter by billing group (superadmin only)

Example request

curl "https://api.zpbx.es/v1/numbers?pageSize=20&country=NG" \
  -H "Authorization: Bearer zpbx_your_api_key_here"

Example response

{
  "numbers": [
    {
      "id": "clx...",
      "number": "2348139980957",
      "country": "NG",
      "status": "ALLOCATED",
      "routingType": "VOICE",
      "billingGroupId": "cmq...",
      "monthlyCost": 0.80,
      "monthlyPrice": 1.50
    }
  ],
  "nextPageUrl": null,
  "meta": { "pageSize": 20, "hasMore": false }
}

Number fields

FieldTypeDescription
numberstringThe DID in E.164 format
countrystringISO 3166-1 alpha-2 country code
statusstringAVAILABLE, ALLOCATED, or RESERVED
routingTypestringVOICE, SMS, or FAX
billingGroupIdstring | nullAssigned billing group
monthlyCostnumber | nullMonthly buy cost
monthlyPricenumber | nullMonthly sell price

Pagination

The API uses cursor-based pagination. When meta.hasMore is true, use nextPageUrl to fetch the next page.

Provisioning new numbers (POST /v1/numbers) is not yet available via the public API. Use the ZPBX console for number provisioning.