Home Features API Hub API local numbers provisioning ·

DID Number Provisioning API

Search, order, configure, and release virtual phone numbers in 145 countries programmatically. Build number management directly into your application — no dashboard required.

What Is DID Provisioning?

DID (Direct Inward Dialing) provisioning is the process of programmatically acquiring a real local phone number and configuring where calls to that number are delivered. Instead of logging into a dashboard to buy a number, your application calls the PBXme API to search available numbers, assign one to your account, set its forwarding destination, and release it when no longer needed — all in seconds, at any scale.

API Endpoint Reference

All calls use HTTP POST. Obtain your account_token from the Login endpoint first and include it in every subsequent request.

EndpointWhat It DoesKey Parameters
POST /api/loginLog in, receive account_token for all subsequent callsusername, password
POST /api/balanceCheck current account balance before purchasing numberstoken
POST /api/did/type-listList available DID types (landline, mobile voice, mobile SMS, voice+SMS)token
POST /api/did/availableSearch available DIDs — returns number, monthly cost, setup fee, country, typetoken, country
POST /api/did/assignPurchase and assign a DID to your accounttoken, did_id
POST /api/did/listList all DIDs purchased on your account with full detailstoken
POST /api/did/forwardSet call forwarding — to extension, PSTN, SIP, access number, or direct IPtoken, did_id, destination, type
POST /api/did/releaseRelease a DID and remove it from your accounttoken, did_id

Complete Flow: Search → Order → Configure → Release

Full Python example walking through the entire DID lifecycle.

import requests

BASE = "https://newsip.pbxme.com/api"
# ── 1. Login ────────────────────────────────────────────────
res = requests.post(f"{BASE}/login",
      data={"username": "YOUR_USERNAME", "password": "YOUR_PASSWORD"})
token = res.json()["account_token"]

# ── 2. Check balance ────────────────────────────────────────
bal = requests.post(f"{BASE}/balance", data={"token": token})
print("Balance:", bal.json()["balance"])

# ── 3. List available numbers in France ─────────────────────
avail = requests.post(f"{BASE}/did/available",
        data={"token": token, "country": "FR"})
dids = avail.json()["dids"]
print(f"Found {len(dids)} French numbers")

# Print first 3 options
for d in dids[:3]:
    print(f"  {d['did_number']}  ${d['monthly_cost']}/mo  setup ${d['setup_fee']}")

# ── 4. Assign the first available number ────────────────────
chosen_id = dids[0]["did_id"]
assign = requests.post(f"{BASE}/did/assign",
         data={"token": token, "did_id": chosen_id})
print("Assigned:", assign.json())

# ── 5. Set forwarding to a PSTN number ──────────────────────
fwd = requests.post(f"{BASE}/did/forward", data={
    "token":       token,
    "did_id":      chosen_id,
    "destination": "+33612345678",   # French mobile number
    "type":        "pstn"
})
print("Forwarding configured:", fwd.json())

# ── 6. Later: list all your purchased numbers ────────────────
my_dids = requests.post(f"{BASE}/did/list", data={"token": token})
print("My numbers:", [d["did_number"] for d in my_dids.json()["dids"]])

# ── 7. Release the number when done ─────────────────────────
release = requests.post(f"{BASE}/did/release",
          data={"token": token, "did_id": chosen_id})
print("Released:", release.json())

More API Guides

FAQ — DID Provisioning API

Log in via the API to receive an account_token. Then call the Available DIDs endpoint with your target country code to see available numbers. Use the DID Assign endpoint with the did_id of your chosen number to purchase and add it to your account.

Yes. The DID Release endpoint removes a number from your account immediately when called with your token and the did_id. This stops billing for that number from the next billing cycle.

The DID Forward Setting API supports: extension (internal PBX extension), PSTN (any external phone number), SIP URI (SIP address such as user@domain.com), Access Number (DISA), and direct IP address. The destination type can be changed at any time via API.

PBXme offers virtual numbers in 145 countries. The Available DIDs endpoint accepts a country ISO code (e.g. US, GB, DE, IL, FR) and returns all numbers currently available for provisioning in that country.

Start Provisioning Numbers Today

Get your free API key and search available numbers in any of 145 countries.

    Sales, click to chat