AvailablePhoneNumber (search the carrier catalog) and IncomingPhoneNumber (provision and configure a number you own). Vobiz folds both into a single phone_numbers resource backed by an inventory model — you browse pre-provisioned stock, buy by E.164, then point inbound calls at a trunk or app. This page maps every Twilio number operation to its Vobiz equivalent, with copy-paste code.
Set your credentials once.
AUTH_ID is your Vobiz Auth ID (MA_…) and AUTH_TOKEN is your Auth Token. In the Vobiz SDK, api_key is the Auth ID (sent as the X-Auth-ID header), and every account-scoped method takes that auth_id explicitly — the counterpart to Twilio’s AccountSid in the URL path.Twilio → Vobiz mapping
| Operation | Twilio (REST · twilio-python) | Vobiz (REST · Vobiz Python) |
|---|---|---|
| Client init | Client(account_sid, auth_token) | Vobiz(api_key=AUTH_ID, auth_token=AUTH_TOKEN) |
| Search available local numbers | GET /2010-04-01/Accounts/{Sid}/AvailablePhoneNumbers/US/Local.json · client.available_phone_numbers('US').local.list(area_code=, contains=, limit=) | GET /api/v1/Account/{auth_id}/inventory/numbers · client.phone_numbers.list_inventory_numbers(auth_id, country=, search=) |
| Buy / provision a number | POST /IncomingPhoneNumbers.json · client.incoming_phone_numbers.create(phone_number=) | POST /api/v1/Account/{auth_id}/numbers/purchase-from-inventory · client.phone_numbers.purchase_from_inventory(auth_id, e164=) |
| List owned numbers | GET /IncomingPhoneNumbers.json · client.incoming_phone_numbers.list(phone_number=, friendly_name=, limit=) | GET /api/v1/Account/{auth_id}/numbers · client.phone_numbers.list_numbers(auth_id) |
| Route inbound to a voice app / trunk | client.incoming_phone_numbers(sid).update(voice_url=) or update(trunk_sid=) / update(voice_application_sid=) | POST /api/v1/Account/{auth_id}/numbers/{number}/assign · client.phone_numbers.assign_number_to_trunk(auth_id, phone_number=, trunk_group_id=) |
| Change the answering URL for a number | update(voice_url=, voice_method=) on the number | Set the answer_url on the trunk/app the number is assigned to (Vobiz fetches your VobizXML from there) |
| Assign a number to a sub-account | update(sid, ...) on a subaccount-scoped client | POST /api/v1/account/{auth_id}/numbers/{e164}/assign-subaccount · client.phone_numbers.assign_did_to_subaccount(auth_id, e164=, sub_account_id=) |
| Release / delete a number | DELETE /IncomingPhoneNumbers/{Sid}.json · client.incoming_phone_numbers(sid).delete() | DELETE /api/v1/Account/{auth_id}/numbers/{e164} · client.phone_numbers.unrent_number(auth_id, e164=) |
| Number identity | Opaque PNxxxx… SID | The E.164 number itself (+14155551234) is the key |
| Webhook signing on inbound | X-Twilio-Signature (HMAC-SHA1, Auth Token) | X-Vobiz-Signature on the request to your answer_url |
Before / after: search inventory and buy
Twilio searches the live carrier catalog withavailable_phone_numbers('US').local.list(...), reads .phone_number off each result, then provisions it with incoming_phone_numbers.create(phone_number=...). Vobiz browses inventory with list_inventory_numbers(...) and buys by E.164 with purchase_from_inventory(...) — a single, predictable two-step flow.
Before / after: route inbound calls
On Twilio you attach the answering logic to the number — setvoice_url (a TwiML endpoint), or point the number at a Trunk (trunk_sid) or a TwiML App (voice_application_sid). On Vobiz, inbound routing is a first-class assignment to a trunk: assign_number_to_trunk(...) binds the DID to a trunk_group_id, and the trunk’s answer_url returns your VobizXML when a call arrives. This keeps routing config in one place and lets many numbers share one flow.
answer_url and expects VobizXML back — the same request/response webhook pattern you used with Twilio’s voice_url, just returning <Response>…</Response> built with the vobizxml helper:
Vobiz · answer_url (Flask)
Before / after: list, then release
Twilio lists provisioned numbers withincoming_phone_numbers.list(...) and releases one with .delete() on its SID. Vobiz lists owned numbers with list_numbers(...) and releases by E.164 with unrent_number(...).
Key differences
- The E.164 number is the key. Twilio identifies a provisioned number by an opaque
PNxxxx…SID; Vobiz uses the phone number itself (+14155551234). Store the E.164 and you can search, buy, route, and release without a lookup round-trip. - Inventory instead of a live catalog search.
list_inventory_numbersreturns Vobiz’s ready-to-buy stock, so search results are exactly what you canpurchase_from_inventoryin the next call — a deterministic two-step buy. - Routing lives on the trunk/app. Where Twilio sets
voice_urlper number, Vobiz assigns the DID to atrunk_group_idand the trunk carries theanswer_url. Many numbers can share one flow, and re-pointing a whole product is a single trunk edit rather than an update per number. Twilio’strunk_sid/voice_application_sidpatterns map cleanly onto this model. - Same webhook contract. Vobiz fetches your
answer_urland expects XML back — identical to Twilio’svoice_urlrequest/response cycle. Swap the TwiML builder forvobizxmland the handler is a near tab-swap. Inbound requests carry anX-Vobiz-Signatureyou validate the same way you validatedX-Twilio-Signature. - E.164 formatting is endpoint-specific.
purchase_from_inventorytakes the number with the leading+in the body;unrent_numbertakes it without the+in the path; assignment endpoints take it URL-encoded (%2B14155551234). The SDK handles this for you. - Sub-account DID assignment is first-class.
assign_did_to_subaccount(auth_id, e164=, sub_account_id=)moves a DID to a child account in one call — handy for reseller and multi-tenant setups, alongside Vobiz’s India KYC tooling.