Skip to main content

Worked sequences

The endpoint list below documents each operation with its parameters, but the two flows that integrate against this surface — renting a number and porting one in — span several calls, and their response bodies are what you branch on. These two sequences show every call in order with the body each one returns.

Sequence 1 — rent a number

Go from inventory search to an active, capability-checked number in three calls. Step 1 — search inventory. Filter by country, line type, capability, and area code. Each result carries the per-number capability list and monthly price, so you can filter before you buy.
200
For a regulated country (most of the EU/EEA, GB, and several others), run GET /api/v1/numbers/regulatory-preview?country… before this step — it returns the documents and data fields the carrier requires, and whether a compliance profile you already hold satisfies them.
Step 2 — purchase the number. Submit the E.164 you picked. The 201 body returns the owned-number record — save the id, because every follow-up operation (configure, suspend, release) addresses the number by it. Billing starts immediately.
201
Step 3 — verify the provisioned number. Read the number back by its id to confirm it is active and that the capabilities you ordered are the ones the carrier actually provisioned — a regulated country can hold the number at pending_compliance until the required documents clear.
200

Sequence 2 — port a number in

Move an existing number from a losing carrier onto the platform. A full port runs eligibility check → LOA upload → submit → poll status; the check step is optional but cheap, and it turns a multi-day carrier rejection into an instant answer. Step 1 — check eligibility (recommended). Run a live pre-flight against the losing carrier’s database. The response tells you in seconds whether the number can port; US and Canadian numbers are checked live, other countries return check-not-supported and proceed straight to submission.
200
Step 2 — submit the port-in request. Send the numbers, the losing carrier, and the account details the carrier will verify. The 201 body returns the request id and the starting status — porting requests move submitted → reviewing → approved → completed, with rejected as the carrier-declined terminal state. Branch on these values; there is no pending state.
201
Step 3 — poll status until complete. Read the request’s status timeline; each stage transition appends an entry with the stage name and a recommendedAction when the port is waiting on you (for example, a supplement on a rejection). Porting typically takes 7–14 business days depending on the country and carrier — subscribe to the number.ported webhook instead of polling once you are past submission.
200
When the timeline reaches completed, the numbers appear in your GET /api/v1/numbers/ inventory as active.

Error samples

Two purchase-time rejections account for most failed buys; both return the standard error envelope with a stable code you can branch on. Regulated country without a compliance profile — buying a number in a country that requires verified end-user documents before the carrier will activate it:
422
Fix it by creating and approving a compliance profile that covers the country (under Settings → Compliance in the dashboard), then passing its id as compliance_profile_id on the retry. No billing happens on this rejection — your balance is untouched. Number already owned — the number sold between your search and your purchase, or is already on an account:
409
Fix it by re-running the search and submitting another candidate. Search results are live inventory, not holds — treat a purchase attempt as a claim race and retry with the next match.