Number settings
#Release a number
Permanent. The number goes back to the carrier and you can’t get it back. Releasing stops the monthly fee; the current month isn’t refunded. Needs the manage_phones permission.
Parameters
idinteger · pathRequired- The number id.
Returns { "success": true }.
Errors
| HTTP | Code | When |
|---|---|---|
| 202 | RELEASE_PENDING | The carrier hasn’t let the number go yet. We stopped its monthly charge and will finish the release for you. The number stays on your account until the carrier confirms. |
| 404 | NUMBER_NOT_FOUND | Not on your account, or a self-paying client’s number. A number you released that kept its record (it had messages or a payment) is released again on a second call; one without answers 404. |
| 409 | NUMBER_RESERVED | A protected number. Contact support. |
| 409 | NUMBER_SETTING_UP | The number is still being set up. Try again once it is active. |
| 409 | NUMBER_KEY_UNKNOWN | Ready couldn’t confirm the number with the carrier. Nothing released; contact support. |
| 409 | REPLACEMENT_IN_FLIGHT | A replacement for this number is on its way; it is released for you once the new one is live. |
| 409 | LAST_NUMBER_CONFIRM | Your only number that can text, or the last on its campaign. Nothing released; release it in the dashboard, which asks you to confirm. |
| 500 | RELEASE_INCOMPLETE | Didn’t finish. Check GET /v1/numbers/:id. |
| 503 | permission_check_unavailable | Ready couldn’t check the number. Nothing released; retry. |
| 502 | BILLING_CANCEL_FAILED | Fee not stopped, so nothing released. |
#Forward calls
Rings another phone, like your cell, when someone calls this number. Send an empty forward_to_number to turn it off. The older path /numbers/:id/forwarding still works, but it is not under /v1, so X-Sub-Account-Id isn’t accepted there. Needs the manage_phones permission.
Parameters
forward_to_numberstring | nullRequired unlesscalls_tois sent- A US or Canadian number. Not another Ready number, which could loop.
""ornullturns forwarding off. calls_tostringOptional"sip"rings your SIP trunk instead of a phone."phone"takes the number off the trunk and forwards toforward_to_number."off"takes it off the trunk and turns forwarding off.
Returns
data.id, data.forward_to_numberinteger, string | null- The number’s id and where its calls now go.
data.routedbooleantruewhen forwarding was turned on with the carrier. Absent when you turn it off.
Errors
| HTTP | Code | When |
|---|---|---|
| 400 | FORWARD_TO_REQUIRED | No forward_to_number in the body. |
| 400 | no code | The number isn’t valid, isn’t US or Canadian, is a Ready number, or this number can’t take calls. |
| 403 | SIP_TRUNKING_UNAVAILABLE | calls_to is "sip" and SIP trunking isn’t on for your account. |
| 409 | SIP_TRUNK_NOT_SET_UP | calls_to is "sip" and you have no SIP trunk yet. |
| 403 | CALL_FORWARDING_UNAVAILABLE | Call forwarding isn’t switched on for Ready yet. Turning it off always works. |
| 404 | NUMBER_NOT_FOUND | No number with this id on your account. |
| 500 | FORWARD_ON_NOT_SAVED | Calls forward now, but the number’s record didn’t update. Send the same request again in a minute; it sets the same target. |
| 500 | FORWARD_OFF_NOT_SAVED | Forwarding is off with the carrier, but the number’s record may still show it on. Send the same request again in a minute; it sets the same target. |
| 502 | FORWARD_SET_UNCONFIRMED | We couldn’t confirm it with the carrier, so it may not be on. Try again. |
| 502 | FORWARD_CLEAR_UNCONFIRMED | We couldn’t turn it off with the carrier. Try again. |
| 503 | FORWARD_CHECK_UNAVAILABLE | Couldn’t check the forwarding number. Nothing changed; retry. |
#Read your SIP trunk
Your SIP trunk settings and the numbers that ring it. SIP trunking is switched on per account; ask support. Without it you get available: false and nothing else.
Returns
data.availableboolean- Whether SIP trunking is on for your account.
data.host, data.allow_ipsstring, string[]- Our SIP host and the addresses your SBC should allow.
data.codec_choicesstring[]- The codecs you can pick.
data.trunkobject | nullsbc_ip,sbc_port,codecs,channel_limit,created_atandnumbers(eachidandphone_number).nulluntil you turn it on. The channel limit starts at 10 and goes up on its own when calls get close to it.
#Turn on or change your SIP trunk
Sets up one SIP trunk for your account, or changes its settings. Then point numbers at it with calls_to: "sip". Calls your SBC places out are billed per minute at your calling rate. Needs the manage_phones permission. Safe to repeat.
Parameters
sbc_ipstringRequired- Your SBC’s public IPv4 address. Private and local addresses are refused.
sbc_portintegerRequired- Your SBC’s SIP port, 1025 to 65535. Most use 5060.
codecsstring[]Required- One or more of
PCMU,PCMA,G729.
Returns
The same body as Read your SIP trunk.
Errors
| HTTP | Code | When |
|---|---|---|
| 400 | invalid_field | The IP, port or codecs aren’t valid. The message says which. |
| 403 | SIP_TRUNKING_UNAVAILABLE | SIP trunking isn’t on for your account. |
| 409 | SIP_TRUNK_SBC_IN_USE | That SBC address is set up on another account. |
| 502 | SIP_TRUNK_CARRIER_FAILED | The carrier didn’t finish it. Send the same request again in a minute. |
| 503 | SIP_TRUNK_BUSY | Another change is saving. Nothing changed; try again. |
#Turn off your SIP trunk
Every number on the trunk goes back to no forwarding, then the trunk is removed. Needs the manage_phones permission. Safe to repeat: a second call answers deleted: false.
Returns
data.deletedbooleantruewhen a trunk was turned off.
#Rename a number
Gives the number a label, shown as name on the number and on the Numbers page. Needs the manage_phones permission.
Path parameters
idintegerRequired- The number id.
Body parameters
namestring | nullRequired- Up to 100 characters.
""ornullclears the label.
Errors
| HTTP | Code | When |
|---|---|---|
| 400 | NAME_REQUIRED | No name in the body. |
| 400 | invalid_field | name isn’t a string, or is longer than 100 characters. |
| 404 | NUMBER_NOT_FOUND | No number with this id on your account. |
| 500 | SETTING_SAVE_UNCONFIRMED | Ready couldn’t confirm the change. Read the number with GET /v1/numbers/:id to see whether it saved. |
#Use a number for texting or calling
Chooses what Ready picks this number for. A number with texting off isn’t picked as a sender when you leave out from, and one with calling off isn’t offered as a caller ID. One of the two must stay on; to stop using the number, release it. Needs the manage_phones permission.
Path parameters
idintegerRequired- The number id.
Body parameters
use_for_textingbooleantrueorfalse. Leave it out to keep it as it is.use_for_callingbooleantrueorfalse. Leave it out to keep it as it is.
Returns
dataobject{ id, use_for_calling, use_for_texting }, each switch as1or0.
Errors
| HTTP | Code | When |
|---|---|---|
| 400 | toggle_invalid | A switch you sent isn’t true or false. |
| 400 | calling_or_texting_required | Both switches are off. |
| 404 | NUMBER_NOT_FOUND | No number with this id on your account. |
| 500 | SETTING_SAVE_UNCONFIRMED | Ready couldn’t confirm the change. Read the number with GET /v1/numbers/:id to see whether it saved. |
#Set a number’s daily cap
The most texts this number sends in a day. When it reaches the cap, Ready sends from another of your numbers that has room. Needs the manage_phones permission.
Path parameters
idintegerRequired- The number id.
Body parameters
capinteger | nullRequired- A whole number of texts.
0,nullor leaving it out removes the cap.
Returns
data.daily_cap_smsinteger | null- The cap now.
nullmeans no cap. data.sent_todayinteger | null- Texts this number sent today.
nullwhen Ready couldn’t count them; the cap is saved either way.
Errors
| HTTP | Code | When |
|---|---|---|
| 400 | DAILY_CAP_INVALID | Not a whole number. |
| 404 | NUMBER_NOT_FOUND | No number with this id on your account. |
| 500 | SETTING_SAVE_UNCONFIRMED | Ready couldn’t confirm the change. Read the number with GET /v1/numbers/:id to see whether it saved. |
#Set a number’s webhook
Sends this number’s texting events to its own URL instead of your account webhook, like a per-number SMS URL on Twilio. Send null to go back to the account webhook.
Path parameters
idintegerRequired- The number id.
Body parameters
webhook_urlstring | nullRequired- Your endpoint for this number.
nullor""clears it.Details
The same URL rules as the account webhook: a public address, never a private or internal host. Usehttps://: a newhttp://URL is refused withinvalid_url, since it would send your customers' messages unencrypted (thehttp://URL a number already has keeps working). It getsinbound_replyfor texts to this number andmessage_delivered/message_failedfor texts sent from it, when those events are on in your account webhook. Everything else (calls, opt-outs, new contacts, registration, and the delivery status of an iMessage, which names no sending number) still goes to the account webhook. Events are signed with the account’s secret, so oneX-Signaturecheck works for every URL. Only a number your account holds itself: for a sub-account’s number, call withX-Sub-Account-Id. Moving the number to another account or releasing it clears its URL. Up to 1,000 numbers per account can have one.
Returns
dataobject- The number, the same shape as Get a number.
Errors
| HTTP | Code | When |
|---|---|---|
| 400 | nothing_to_update | No webhook_url in the body. |
| 400 | invalid_url | Not a URL, not http or https, or a private or internal host. |
| 400 | invalid_field | webhook_url isn’t a string or null, or is longer than 2,000 characters. |
| 403 | permission_denied | The key’s user lacks manage_integrations. |
| 403 | OWNER_ONLY | The key isn’t the account owner’s or an admin seat’s. |
| 404 | number_not_found | Not a number your account holds, or released. |
| 409 | account_webhook_required | No account webhook saved yet. Save one with PUT /v1/webhooks. |
| 409 | number_webhook_limit | 1,000 numbers already have their own URL. |
#Rest a number
Stops Ready from picking this number as a sender, so texts without a from go out from your other numbers. You can still send from it by naming it in from. It costs nothing and keeps the number. Needs the manage_phones permission.
Path parameters
idintegerRequired- The number id.
Body parameters
hoursinteger- How long to rest it, in whole hours. Leave it out to rest it until you resume it. To keep Ready from ever picking it for texts, turn texting off instead.
Returns
dataobject{ id, phone_number, friendly_name, rested_until }.hoursinteger | null- The hours you sent, or
nullfor until resumed.
Errors
| HTTP | Code | When |
|---|---|---|
| 400 | LAST_SENDING_NUMBER | It’s your only number still sending. Buy or resume another number first. |
| 400 | REST_HOURS_INVALID | hours isn’t a whole number in range. |
| 404 | NUMBER_NOT_FOUND | No number with this id on your account. |
| 500 | SETTING_SAVE_UNCONFIRMED | Ready couldn’t confirm the change. Read the number with GET /v1/numbers/:id to see whether it saved. |
#Resume a number
Ends a rest, so Ready picks the number as a sender again. Safe to call on a number that isn’t resting. Needs the manage_phones permission.
Path parameters
idintegerRequired- The number id.
Errors
| HTTP | Code | When |
|---|---|---|
| 404 | NUMBER_NOT_FOUND | No number with this id on your account. |
| 500 | SETTING_SAVE_UNCONFIRMED | Ready couldn’t confirm the change. Read the number with GET /v1/numbers/:id to see whether it saved. |
#Make a number your primary
Ready sends from your primary number when you leave out from and no other rule picks one. Your other numbers stop being primary. Needs the manage_phones permission.
Path parameters
idintegerRequired- The number id.
Errors
| HTTP | Code | When |
|---|---|---|
| 404 | NUMBER_NOT_FOUND | No number with this id on your account. |
| 500 | SETTING_SAVE_UNCONFIRMED | Ready couldn’t confirm the change. Read the number with GET /v1/numbers/:id to see whether it saved. |
Older paths
POST /phone-numbers/checkout: use POST /v1/numbers/checkout. The alias is limited to 20 a minute and doesn’t accept X-Sub-Account-Id.
See also: the guide to doing this in the app.