readyDocs Open the appOpen the app

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
HTTPCodeWhen
202RELEASE_PENDINGThe 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.
404NUMBER_NOT_FOUNDNot 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.
409NUMBER_RESERVEDA protected number. Contact support.
409NUMBER_SETTING_UPThe number is still being set up. Try again once it is active.
409NUMBER_KEY_UNKNOWNReady couldn’t confirm the number with the carrier. Nothing released; contact support.
409REPLACEMENT_IN_FLIGHTA replacement for this number is on its way; it is released for you once the new one is live.
409LAST_NUMBER_CONFIRMYour only number that can text, or the last on its campaign. Nothing released; release it in the dashboard, which asks you to confirm.
500RELEASE_INCOMPLETEDidn’t finish. Check GET /v1/numbers/:id.
503permission_check_unavailableReady couldn’t check the number. Nothing released; retry.
502BILLING_CANCEL_FAILEDFee 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 unless calls_to is sent
A US or Canadian number. Not another Ready number, which could loop. "" or null turns forwarding off.
calls_tostringOptional
"sip" rings your SIP trunk instead of a phone. "phone" takes the number off the trunk and forwards to forward_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.routedboolean
true when forwarding was turned on with the carrier. Absent when you turn it off.
Errors
HTTPCodeWhen
400FORWARD_TO_REQUIREDNo forward_to_number in the body.
400no codeThe number isn’t valid, isn’t US or Canadian, is a Ready number, or this number can’t take calls.
403SIP_TRUNKING_UNAVAILABLEcalls_to is "sip" and SIP trunking isn’t on for your account.
409SIP_TRUNK_NOT_SET_UPcalls_to is "sip" and you have no SIP trunk yet.
403CALL_FORWARDING_UNAVAILABLECall forwarding isn’t switched on for Ready yet. Turning it off always works.
404NUMBER_NOT_FOUNDNo number with this id on your account.
500FORWARD_ON_NOT_SAVEDCalls forward now, but the number’s record didn’t update. Send the same request again in a minute; it sets the same target.
500FORWARD_OFF_NOT_SAVEDForwarding 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.
502FORWARD_SET_UNCONFIRMEDWe couldn’t confirm it with the carrier, so it may not be on. Try again.
502FORWARD_CLEAR_UNCONFIRMEDWe couldn’t turn it off with the carrier. Try again.
503FORWARD_CHECK_UNAVAILABLECouldn’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 | null
sbc_ip, sbc_port, codecs, channel_limit, created_at and numbers (each id and phone_number). null until 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
HTTPCodeWhen
400invalid_fieldThe IP, port or codecs aren’t valid. The message says which.
403SIP_TRUNKING_UNAVAILABLESIP trunking isn’t on for your account.
409SIP_TRUNK_SBC_IN_USEThat SBC address is set up on another account.
502SIP_TRUNK_CARRIER_FAILEDThe carrier didn’t finish it. Send the same request again in a minute.
503SIP_TRUNK_BUSYAnother 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.deletedboolean
true when 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. "" or null clears the label.
Errors
HTTPCodeWhen
400NAME_REQUIREDNo name in the body.
400invalid_fieldname isn’t a string, or is longer than 100 characters.
404NUMBER_NOT_FOUNDNo number with this id on your account.
500SETTING_SAVE_UNCONFIRMEDReady 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_textingboolean
true or false. Leave it out to keep it as it is.
use_for_callingboolean
true or false. Leave it out to keep it as it is.
Returns
dataobject
{ id, use_for_calling, use_for_texting }, each switch as 1 or 0.
Errors
HTTPCodeWhen
400toggle_invalidA switch you sent isn’t true or false.
400calling_or_texting_requiredBoth switches are off.
404NUMBER_NOT_FOUNDNo number with this id on your account.
500SETTING_SAVE_UNCONFIRMEDReady 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, null or leaving it out removes the cap.
Returns
data.daily_cap_smsinteger | null
The cap now. null means no cap.
data.sent_todayinteger | null
Texts this number sent today. null when Ready couldn’t count them; the cap is saved either way.
Errors
HTTPCodeWhen
400DAILY_CAP_INVALIDNot a whole number.
404NUMBER_NOT_FOUNDNo number with this id on your account.
500SETTING_SAVE_UNCONFIRMEDReady 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.

Save your account webhook first. A number’s URL uses its events, its on/off switch and its signing secret, so pausing or changing them there applies to every number.

Path parameters

idintegerRequired
The number id.

Body parameters

webhook_urlstring | nullRequired
Your endpoint for this number. null or "" clears it.
DetailsThe same URL rules as the account webhook: a public address, never a private or internal host. Use https://: a new http:// URL is refused with invalid_url, since it would send your customers' messages unencrypted (the http:// URL a number already has keeps working). It gets inbound_reply for texts to this number and message_delivered / message_failed for 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 one X-Signature check works for every URL. Only a number your account holds itself: for a sub-account’s number, call with X-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
HTTPCodeWhen
400nothing_to_updateNo webhook_url in the body.
400invalid_urlNot a URL, not http or https, or a private or internal host.
400invalid_fieldwebhook_url isn’t a string or null, or is longer than 2,000 characters.
403permission_deniedThe key’s user lacks manage_integrations.
403OWNER_ONLYThe key isn’t the account owner’s or an admin seat’s.
404number_not_foundNot a number your account holds, or released.
409account_webhook_requiredNo account webhook saved yet. Save one with PUT /v1/webhooks.
409number_webhook_limit1,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 null for until resumed.
Errors
HTTPCodeWhen
400LAST_SENDING_NUMBERIt’s your only number still sending. Buy or resume another number first.
400REST_HOURS_INVALIDhours isn’t a whole number in range.
404NUMBER_NOT_FOUNDNo number with this id on your account.
500SETTING_SAVE_UNCONFIRMEDReady 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
HTTPCodeWhen
404NUMBER_NOT_FOUNDNo number with this id on your account.
500SETTING_SAVE_UNCONFIRMEDReady 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
HTTPCodeWhen
404NUMBER_NOT_FOUNDNo number with this id on your account.
500SETTING_SAVE_UNCONFIRMEDReady 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.