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.
| Endpoint | What it does | Key parameters |
|---|---|---|
| POST /api/login | Log in, receive account_token for all subsequent calls | username, password |
| POST /api/balance | Check current account balance before purchasing numbers | token |
| POST /api/did/type-list | List available DID types (landline, mobile voice, mobile SMS, voice+SMS) | token |
| POST /api/did/available | Search available DIDs — returns number, monthly cost, setup fee, country, type | token, country |
| POST /api/did/assign | Purchase and assign a DID to your account | token, did_id |
| POST /api/did/list | List all DIDs purchased on your account with full details | token |
| POST /api/did/forward | Set call forwarding — to extension, PSTN, SIP, access number, or direct IP | token, did_id, destination, type |
| POST /api/did/release | Release a DID and remove it from your account | token, 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())
FAQ — DID Provisioning API
