#Phone numbers
List, buy and release your numbers. Each is $5 a month: first month up front, no setup fee.
Details
Buying needs a card on file (Settings → Billing).
Buy a number in 3 calls
Optionally check the area code, pay at checkout, then buy with the payment id.
Details
- Optional:
GET /v1/numbers/available?area_code=415to see whether Ready can offer the area code. POST /v1/numbers/checkoutwith{ "area_code": "415" }pays the first month and returnsdata.payment_intent_id.POST /v1/numberswith{ "area_code": "415", "payment_intent_id": "…" }. Often the number is ready at once; otherwise pollGET /v1/numbers/:iduntil it'sactive, usually about 2 minutes.
Store phone_number_id from step 3, and send from the number with from. Rarely, the carrier rejects a number; the status table says what to do.
Number status
Only active can send. provider_rejected and payment_declined never will.
Details
| status | Meaning |
|---|---|
active | Can send. |
pending_provisioning, requested, submitted | Being set up. phone_number is a placeholder like "Pending (415)", not a phone number. |
provider_rejected, payment_declined | Failed and won't become active. Stop polling, sort out the payment with support if needed, and buy again. |
billing_suspended, suspended | Paused for billing or review. |
released, inactive, retired | No longer in use. |
deleted | Released. Hidden from the list; GET /v1/numbers/:id can still return it. |
#List numbers
/v1/numbersEvery number on the account, newest first. Not paginated.
Returns
data[]object[]id,phone_number,status,created_at. Includes pending and failed numbers, so checkstatus.
Errors
| HTTP | Code | When |
|---|---|---|
| 500 | internal_error | Read failed. Safe to retry. |
#Get a number
/v1/numbers/:idOne number. Poll this after a purchase until it's ready.
Path parameters
idintegerRequired- The
phone_number_idfrom the purchase.
Returns
dataobject- Same shape as one item of List numbers.
Poll every 10 to 30 seconds until status is active (usually about 2 minutes).
Details
Stop if it becomes provider_rejected or payment_declined. After you release a number this returns status: "deleted" or a 404.
Errors
| HTTP | Code | When |
|---|---|---|
| 404 | no code | Not on this account. Body: {"success": false, "error": "Number not found"}. |
#Check an area code
/v1/numbers/availableWhether you can buy a number in an area code.
Query parameters
area_codestringRequired- A 3-digit US or Canada area code. Only the format is checked.
Returns
Fields are at the top level, not under data, and there's no success.
availablebooleanavailable: truemeans Ready will try to get a number there.Details
It doesn't check that the area code exists:000,911and999answer true, so validate the area code yourself.numbers[]object[]- Format examples only. You can't pick one; the carrier assigns your number when you buy.
alternatives[]object[]- When out of stock: up to 5 nearby area codes, each
{ area_code, state, ready }.Details
ready: truemeans a number there can be ready right away.
Errors
| HTTP | Code | When |
|---|---|---|
| 400 | area_code_invalid | Missing or not 3 digits (in code). |
#Start a number purchase
/v1/numbers/checkoutPays the first month ($5) on your saved card and returns the payment to buy with.
POST /phone-numbers/checkout is an older alias; use this path.Details
The alias is limited to 20 a minute and doesn't acceptX-Sub-Account-Id, so use this path for client accounts.Headers
Idempotency-KeystringRecommended- Retry safely without paying twice. A key is tied to its first body.
Body parameters
area_codestringRequired- The 3-digit area code to buy in. Also accepted, for the dashboard:
replaces_phone_id,checkout_id.
Returns
data.payment_intent_idstring- Pass it to Buy a number.
data.charged, data.authorizedboolean- Checkout either charges or holds the first month.
Details
If the number can't be provisioned, the hold is released or the charge refunded. data.card_brand, data.card_last4string- The card used.
data.client_secret, data.has_cardstring, boolean- Instead of the above when there's no card on file.
Details
The API can't finish that payment: add a card in Settings → Billing and call again.
Errors
| HTTP | Code | When |
|---|---|---|
| 400 | area_code_invalid | Missing or not 3 digits. |
| 402 | card_declined | Card refused. Also card_authentication_required. |
| 402 | PURCHASE_BLOCKED | Unpaid bill or account review (in code). |
| 403 | permission_denied | Key lacks manage_phones. |
| 409 | area_code_unavailable | No stock; see alternatives. |
| 409 | purchase_in_progress | Another purchase is running. Also campaign_number_limit. |
| 502 | checkout_unconfirmed | Don't retry: check GET /v1/numbers first. |
| 503 | checkout_unavailable | Nothing charged.DetailsAlsoavailability_check_unavailable, cap_check_unavailable, billing_check_unavailable, billing_account_unavailable, payments_unavailable. |
#Buy a number
/v1/numbersProvisions the number you paid for at checkout.
Headers
Idempotency-KeystringRecommended- A new key for each new purchase.
Body parameters
area_codestringRequired- The area code you checked out with. The number comes from this one.
payment_intent_idstringRequireddata.payment_intent_idfrom checkout. Each one provisions exactly one number.
Returns
Fields are at the top level, not under data. Always read phone_number_id: id is only on the instant outcome.
phone_number_idinteger- The number's id. Poll it with
GET /v1/numbers/:id. instantbooleantrue: the number is ready now andphone_numberis real.pending_provisioningbooleantrue: being set up; poll untilactive.pending_campaign_approvalbooleantrue: can't send until your 10DLC campaign is approved (usually within 48 hours).replaced_phone_id, noteinteger | null, string- The number replaced, if any, and a sentence on what happens next.
Errors
| HTTP | Code | When |
|---|---|---|
| 400 | area_code_invalid | Missing or not 3 digits (in code). |
| 400 | payment_intent_required | Also payment_not_confirmed, payment_not_for_number, payment_not_taken. |
| 400 | invalid_field | A field has the wrong type. |
| 400 | no_campaign | No approved registration. Charge returned. |
| 402 | PURCHASE_BLOCKED | Unpaid bill or account review (in code). |
| 403 | payment_not_owned | Another account's payment. |
| 403 | permission_denied | Key lacks manage_phones. |
| 409 | payment_intent_already_used | This payment already bought one. |
| 409 | campaign_number_limit | Your campaign is full. Charge returned. |
| 500 | buy_incomplete | Not finished. Don't buy again: check GET /v1/numbers. |
| 502 | infobip_submit_failed | The carrier gave no number. Charge returned. |
| 503 | billing_check_unavailable | Retry. Also payments_unavailable. |
#Release a number
/v1/numbers/:idPermanent. The number goes back to the carrier and you can't get it back.
Path parameters
idintegerRequired- The number id.
Errors
| HTTP | Code | When |
|---|---|---|
| 403 | permission_denied | Key lacks manage_phones. |
| 403 | test_key_not_allowed | Called with a test key. |
| 404 | NUMBER_NOT_FOUND | Not yours, or already released (in code). |
| 409 | NUMBER_RESERVED | A protected number. Contact support. |
| 500 | RELEASE_INCOMPLETE | Didn't finish. Check GET /v1/numbers/:id. |
| 502 | BILLING_CANCEL_FAILED | Fee not stopped, so nothing released. |