Messages
Send one text with POST /v1/messages or many with POST /v1/messages/bulk, then read them back or delete them. For what a text costs, see How a text is priced.
#The Message object
Get a message and List messages return this object. List messages also returns the same value as id, and adds direction and cost_usd; Get a message adds sent_at.
message_idstring- The id a send returned. Opaque: don’t parse it or assume a format. Webhooks and
GET /v1/messages/:iduse the same value, including when Ready resends a failed text for you: the public id stays the same. directionenuminboundoroutbound.statusstringqueued,delivered,failed,undeliveredorunknownfor outbound;receivedfor inbound.unknownmeans carrier acceptance could not be confirmed and does not prove the text was unsent.failedisn’t always final: Ready resends some failed texts itself.Failures Ready resends for you
Don’t resend a text while Ready still might, or the recipient gets it twice and you pay twice. Ready resends only the kinds below and only inside their windows. If a text is still
failedafter its window, resend it yourself with a new key.expiredandundeliverablewith no more specific carrier reason: Ready resends the same text about 15 minutes after the send and again 30 minutes after that; a drip campaign or automation text can get a third try 6 hours later. Each try is billed. By default, campaign and unclassified texts are not resent more than 6 hours after the original send, so time-sensitive copy isn’t sent late; drip campaign and automation texts have a 24-hour window. A campaign keeps the 6-hour window even if it also belongs to a drip campaign.rejectedorcarrier_rejected, only when the carrier refused your sending number: resent once, within 3 hours of sending, possibly from another of your numbers. Other rejected texts aren’t resent.- Each resend is billed like the original send.
- The resend keeps the same public
message_id; your original id still resolves. Itsstatusgoes fromfailedback toqueued, then todeliveredorfailed. - Webhooks:
message_failed, thenmessage_deliveredormessage_failedfor the resend, under the same publicmessage_id.
error_reasonstring | null- A stable cause to branch on and count by,
nullunlessstatusisfailedorundelivered. When no specific cause was recorded, you get a general reason instead.Possible values
error_reasonMeaning Retry? blocked_before_sendReady held it before sending (see blocked).No. It was never sent, and the text wasn’t charged (see blocked). Fix or remove the number.recipient_destination_rejectedDestination rejected. No. Check the number and its text service with the contact. recipient_cannot_receive_smsText service unavailable or inactive. No. Check the number with the contact. recipient_unreachablePhone off or out of coverage. No. Check the number with the contact. recipient_blockedThe recipient’s carrier blocks texts to this number. No. Check the number with the contact. recipient_out_of_creditPrepaid plan with no credit. Yes, a day later with a new key, once you’ve checked it’s still failed: by then the recipient may have topped up. Ready may resend some of these itself.recipient_network_unknownNew, ported or out-of-service number. not specified carrier_delivery_failedAccepted, then not delivered, no reason given. No. Check the number with the contact. carrier_filtered_contentSpam filter. Reword the text first. sender_network_not_provisionedYour sending account lacks network coverage. No. Contact support. expired,undeliverable,rejected,carrier_rejectedGeneral: the carrier gave no specific cause. Not yet: Ready resends some of these (see status). If it’s stillfailed6 hours after you sent it (24 for drip and automation texts), Ready won’t resend it, so resend it yourself with a new key.temporary_failureGeneral: the carrier gave no specific cause. Yes, later, with a new key. Ready doesn’t resend it. invalid_destinationGeneral: the carrier gave no specific cause. No. Check the number with the contact. unknownGeneral: the carrier gave no specific cause. not specified error_detailstring | null- A plain sentence to show a person,
nullwhenerror_reasonis. Its wording can change, so don’t match on it. blockedbooleantruewhen Ready held the text before sending it: a bad or landline number, a known litigator (with TCPA scrubbing on), an opt-out, or the content filter. No carrier saw it, and the text itself wasn’t charged. A text the content filter blocked carries the compliance fee, and with number validation on the number check is charged: see Billing. Itserror_reasonisblocked_before_sendandstatusstill readsfailed. Leave these out of your delivery rate: they’re a list problem, not a delivery problem.fromE.164 string- Sender.
toE.164 string- Recipient.
bodystring- The text you asked to send.
sent_bodystring- The exact text sent, which can be longer than
body: Ready may add your opt-out line and business name to meet carrier rules. Include your own opt-out inbodyto stop us adding ours. media_urlstring | null- The attached image’s URL, or
null. segmentsinteger- Billed segments, counted on
sent_body. cost_usdnumber- What the text cost, in USD.
created_atISO 8601 string- When it was created.
sent_atISO 8601 string | null- When Ready handed it to the carrier.
delivered_atISO 8601 string | null- When it was delivered.
reply_categorystring | null- The label AI reply sorting gave an inbound reply, such as
interested.nullfor outbound texts and for replies that weren’t sorted.
#Send a message
Sends one text. A 200 means accepted, not delivered. Billed at segments × your rate, plus fees (pricing).
Parameters
Idempotency-Keystring, headerRecommended- Unique per message; reuse only to retry (Idempotency).
toE.164 stringRequired- Recipient, E.164 recommended (
+12125550199). A 10-digit US number is treated as +1. Ready texts recipients in the United States, Canada, Australia and the United Kingdom (Terms of Service, section 8). bodystringRequired- The text, up to 25 segments.
messageis an alias. Leave it out only when you send amedia_url: a picture can go alone.Details
25 segments is about 3,825 plain characters, or about 1,675 with emoji or other Unicode. consent_attestedbooleanRequired- Your promise this recipient agreed to texts from you. Not enforced yet.
Details
Once enforced, a send without it is refused with403 api_consent_attested_required. Today it still goes through, and the response carries awarningslist that says so."true"and1are also accepted.
More parameters
fromE.164 string- One of your numbers; omit it and Ready picks.
from_phone_number_idisn’t supported here. media_urlstring- A public
httporhttpsURL of an image to attach. No public link for your file? Upload it with Upload a file and pass theurlit returns. Anything else is refused with400 invalid_media_url. With an image, the text is limited to 1,600 characters and the message is billed as one image message. from_strategyenum- How Ready picks the number when you don’t set
from. Leave it out and Ready keeps the number this contact already texts with, and otherwise matches the recipient’s area code when it can. Setting any value,localincluded, ignores the conversation’s saved number, but Ready still sends from the number you last texted or called this person with, if it’s still one of your numbers. The strategy picks the number for someone you haven’t reached yet.localmatch the recipient’s area codeevenspread across your numbers, least used firstrandompick one of your numbers at random
confirm_empty_mergeboolean- Send
trueto send even though a merge field is blank (seeempty_merge_fieldbelow). override_quiet_hoursboolean- Send anyway after a
409 QUIET_HOURS_BLOCKthat has"can_override": true. It lifts only the quiet hours set on your account, never the federal and state quiet hours. Ready records it as your statement that this is a consented, conversational text. conversation_idinteger- File the text in this conversation (from
GET /conversations). Unless you setfrom, Ready prefers the number that conversation uses. An id that isn’t on your account is ignored. quoted_message_idinteger- Message
idin that conversation to quote (inbox only), fromGET /conversations/:id/messages. Ready saves its first 200 characters asquoted_texton the new message. The text the recipient gets is unchanged.
Returns
data.message_idstring- Store it. The
message_idof the Message object. data.statusstringqueued;deliveredorfailedfollows when the carrier reports back (themessage_deliveredormessage_failedwebhook, orGET /v1/messages/:id).data.fromstring- The number it went from, the one Ready picked when you left
fromout. data.tostring- The number it went to.
data.segmentsinteger- What you’re billed for, counted on
sent_body. data.sent_bodystring- The exact text sent (sent_body).
data.compliance_text_addedstring | null- Just the text Ready added, such as
Reply STOP to opt out. -Acme Co, ornullwhen nothing was added. data.sent_atISO 8601 string- When Ready handed it to the carrier.
sent_at_unixis the same time in Unix seconds. data.carrier_feenumber- Carrier fee in USD. For a text it is
segments × carrier_fee_usd_per_segment. A text with an image has one flat fee instead. It is0on a free account and on a test key. data.balance_usdnumber- Your balance after this send.
carrier_balanceis the same number (legacy; usebalance_usd). data.credits_remaininginteger- Legacy; use
balance_usd. Approximate 1-segment texts your balance covers, counted at the rate this text was charged at, carrier fee included.
What the response means
202withdata.status: "held": quiet hours where the recipient is, so Ready holds the text and sends it atdata.send_at. Don’t send it again.More
The body has"success": true,data.status,data.send_at(ISO 8601) anddata.queue_id, the held text.data.message_idisnull: no message exists until it sends. You’re charged only when it sends. The same body also hasheld: true,code: "QUIET_HOURS_HELD",queued_for(the same time assend_at),recipient_tzand awarningsentence. Readdata.status: the older top-levelstatussaysqueued. When the text can’t be held, you get409 QUIET_HOURS_BLOCKinstead and nothing is sent.202,error_code: "send_outcome_unknown": it may have been delivered and charged. The body also has"success": falseandoutcome: "unknown". A retry with the same key returns this202again; see When to retry before you send it with a new key.200,error_code: "empty_merge_field": a blank merge field; nothing sent. The body has"success": false,needs_confirmationandempty_fields. Send again with"confirm_empty_merge": trueto send it with the blank.- Rarely,
200with"recorded": false, awarningand nomessage_id: sent and charged, not saved. Don’t resend. - Opt-outs, blocklisted numbers and known landlines are refused up front; the text isn’t charged (the number check is, with number validation on).
Errors
| HTTP | Code | When |
|---|---|---|
| 400 | invalid_request | Missing to or body. |
| 400 | invalid_field | Wrong type (field names it), or to is not a phone number. |
| 400 | invalid_from | Not one of your numbers. |
| 400 | NO_APPROVED_CAMPAIGN | Your registration isn’t approved yet. Also NUMBER_SETUP_UNCONFIRMED, when Ready can’t confirm the number’s setup. |
| 400 | country_not_supported | The recipient is outside the United States, Canada, Australia and the United Kingdom. Nothing sent, not charged. |
| 400 | no_sender_number | No number to send from. Also no_country_sender: none of your numbers can text the recipient’s country. |
| 400 | MESSAGE_TOO_LONG | Over 25 segments (1,600 characters with an image). |
| 400 | CONTENT_BLOCKED | Blocked content; a compliance fee may apply. |
| 402 | insufficient_balance | Balance too low. Nothing sent, not charged. Top up in Billing, or turn on Auto top-up (Billing and pricing). Also CARD_REQUIRED, client_card_required (a sub-account that pays with its own card and has not added one yet), MONTHLY_CAP_REACHED, and BILLING_PAST_DUE or FRAUD_HOLD (these two in code). |
| 403 | opt_out_locked | Contact opted out. reason is the contact’s opt_out_source, such as sms_stop_keyword or tcpa_scrub. Also dnc_list (on your Do Not Call list), tcpa_block, global_blocklist, number_not_assigned. |
| 403 | api_consent_attested_required | consent_attested missing, once enforced. |
| 409 | QUIET_HOURS_BLOCK | Quiet hours and the text can’t be held (with next_allowed_at). With "can_override": true, send again with override_quiet_hours to send it now. |
| 409 | RAMP_CAP_REACHED | Warm-up cap used up. |
| 409 | duplicate_send | Same text and number within 60 seconds, no key. |
| 409 | number_activating | Number still activating. Wait Retry-After. |
| 422 | INVALID_DESTINATION | The carrier rejected the destination as not a valid number. Nothing sent, not charged. |
| 429 | rate_limited | Over carrier pace. Wait Retry-After, same key. |
| 429 | daily_cap | Daily cap hit; resets midnight Pacific. Also number_daily_cap. No Retry-After. |
| 500 | send_failed | Not sent. New key, in a minute. Also hold_not_returned and reservation_unconfirmed (check your balance first). |
| 500 | INTERNAL_ERROR_OUTCOME_UNKNOWN | Outcome unknown, like a 202 (in code). |
| 503 | provider_busy | Carrier busy. Wait Retry-After, new key. |
| 503 | gate_check_failed | A check couldn’t run; not sent. Also carrier_capacity_busy, contact_unavailable, consent_check_failed, sending_paused, permission_check_unavailable, ADMISSION_SHED, send_dedupe_unavailable (Ready couldn’t check for a repeat send). |
| 504 | REQUEST_TIMEOUT_OUTCOME_UNKNOWN | Over 30 seconds, may still send. Check whether it did before you send again with a new key; a retry with the same key answers 409 idempotency_in_progress until it finishes, then its real result. |
#Upload a file
Stores a photo, video, PDF, Office doc, CSV, text file or voice note on Ready and returns a public url. Pass that url as media_url in Send a message, Send to many or Voice messages. Uploading costs nothing; the send is billed as usual.
Parameters
filefile, multipartRequired- The file, sent as
multipart/form-data. Up to 20 MB. Until your registration is approved, photos and documents have a smaller limit, and the error says what it is.
Returns
urlstring- The public link to the file. Anyone with the link can open it.
content_typestring- The file’s type, like
image/jpeg. sizeinteger- Bytes stored.
Each upload stores a new copy, so a retry is safe. You can upload 60 files every 10 minutes.
Errors
| HTTP | Code | When |
|---|---|---|
| 400 | NO_FILE | No file in file. |
| 400 | UNSUPPORTED_FILE_TYPE | Ready can’t send this kind of file. |
| 400 | FILE_CONTENT_MISMATCH | The file’s contents don’t match its type. |
| 400 | UPLOAD_FAILED | The upload couldn’t be read. Send the file again. |
| 400 | media_malware | The file failed the malware check. |
| 400 | media_flagged | The file failed the safety check. |
| 403 | attachments_need_registration | Start your business registration first. |
| 413 | FILE_TOO_LARGE | Over 20 MB. Also FILE_TOO_SCAN_LARGE: over the smaller limit before your registration is approved. |
| 429 | UPLOAD_RATE_LIMITED | Too many uploads in 10 minutes. Wait a few minutes. |
| 503 | media_scan_unavailable | The safety check couldn’t finish. Try again in a minute. Also media_account_read_failed and media_registration_read_failed. |
#List messages
Your account’s sent and received messages, newest first, including texts your team members sent. Returns a list of Message objects in data, paged with a cursor.
Parameters
directionenum, queryinboundoroutbound.toE.164 string, query- Only messages to this number.
fromE.164 string, query- Only messages from this number.
statusstring, queryqueued,delivered,failed,undelivered,unknownorreceived.failedreturns failed and rejected attempts;undeliveredreturns older undelivered or expired ones.More
Any other word isn’t refused: it only matches messages stored with exactly that word, so a typo returns an empty list. The answer then carries awarningssentence listing the valid words.limitinteger, queryDefault50Max200- Page size.
before_idinteger | string, query- The
next_before_idfrom the previous page. Theidof the last message on the page also works.More
offsetandpagearen’t supported and are ignored, so you get the newest page again. When you send either one (other thanoffset=0orpage=1), the answer carries awarningssentence saying so.
Returns
data[]object[]- Message objects.
has_moreboolean- Keep paging while
true. It’strueon an exactly full page, so the last page can be empty. next_before_idinteger | null- Pass as
before_idfor the next page;nullon an empty page. warningsstring[]- Only present when part of your query was ignored or may not do what you meant, such as
offset,pageor an unknownstatus. Plain sentences for a person to read: their wording can change, so log them and don’t match on them.
Specific delivery failures
Every failed or undelivered message includes error_reason, a stable cause to group on, and error_detail, a readable explanation to display or show on hover. Both are null for messages that did not fail. These match GET /v1/messages/:id and the message_failed webhook. Display error_detail; match and count by error_reason, because the wording can change.
The full list of error_reason values, and what to do for each, is under GET /v1/messages/:id.
For a campaign you track in your app, keep the message_id returned for each attempt and count matching messages by error_reason. Read every page using next_before_id, or update each message’s latest outcome from webhooks; do not count a repeated webhook as a new failure. status=failed returns attempts Ready or the carrier refused; status=undelivered returns attempts the carrier accepted but could not deliver, including expired ones. A page’s counts alone are not the campaign’s complete breakdown. If no specific cause was recorded, the API preserves a general or unknown reason instead of inventing one. A text Ready refused before sending has blocked: true and error_reason blocked_before_send.
Errors
| HTTP | Code | When |
|---|---|---|
| 400 | invalid_to | to has no digits. Also invalid_from for from. |
| 400 | invalid_field | A filter was sent twice, like ?status=a&status=b. Send each one once. |
| 400 | invalid_before_id | before_id is a message id that names no message on your account. Pass the next_before_id from the previous page. |
| 429 | rate_limited | Over the per-account limit. |
#Delete a message
Removes one message from your account’s message log for good. If it was the last text in its conversation, the empty conversation goes too. Needs the delete_messages permission. Test keys can’t delete.
Path parameters
idintegerRequired- The message’s
idfrom GET /v1/messages, themessage_idyou got when you sent it, or themessage_idof aninbound_replywebhook.
Returns { "success": true, "data": { "id": 19408828 } }, where id is the deleted message’s row id (the number next_before_id pages by). Calling it again for the same id answers 404, so a retry never removes anything else.
Errors
| HTTP | Code | When |
|---|---|---|
| 400 | INVALID_MESSAGE_ID | The id is longer than 100 characters. |
| 403 | MESSAGE_NOT_ASSIGNED | The key’s user can’t open this message: it is a teammate’s contact, or on a number that user isn’t given. Nothing was deleted. |
| 403 | test_key_not_allowed | A test key. Use a live key. |
| 404 | MESSAGE_NOT_FOUND | No message with this id in your account, or it was already deleted. |
| 423 | LITIGATION_HOLD | A legal hold is on the account or on this message’s numbers. Nothing was deleted. |
| 503 | message_reference_ambiguous | The id matches more than one message. Nothing was deleted. Contact support. |
| 503 | WALL_READ_FAILED | We couldn’t check who the message belongs to. Nothing was deleted. Try again in a minute. |
| 503 | HOLD_CHECK_UNAVAILABLE | We couldn’t check for a legal hold. Nothing was deleted. Try again in a minute. |
#Delete many messages
Removes up to 5,000 messages from your account’s message log for good. Ids that aren’t in your account are skipped and nothing of theirs is touched. Conversations left empty go too. Needs the delete_messages permission. Test keys can’t delete.
Body parameters
idsinteger[]Required- 1 to 5,000 message ids, the same ids Delete a message takes. An id that isn’t in your account is skipped.
Returns
data.deletedinteger- How many messages were deleted.
data.requestedinteger- How many of your ids were looked for in your account. A retry deletes nothing more and answers
deleted: 0.
Errors
| HTTP | Code | When |
|---|---|---|
| 400 | NO_MESSAGES_SELECTED | ids is empty or missing. |
| 400 | TOO_MANY_MESSAGES | More than 5,000 ids. |
| 400 | INVALID_MESSAGE_IDS | An id isn’t a string or a whole number, or is longer than 100 characters. Nothing was deleted. |
| 403 | MESSAGE_NOT_ASSIGNED | The key’s user can’t open one of these messages. Nothing was deleted. |
| 403 | test_key_not_allowed | A test key. Use a live key. |
| 423 | LITIGATION_HOLD | A legal hold is on the account or on one of these messages’ numbers. Nothing was deleted. |
| 429 | rate_limited | Too many bulk deletes in a short time. Wait and try again. |
| 503 | message_reference_ambiguous | An id matches more than one message. Nothing was deleted. Contact support. |
| 503 | WALL_READ_FAILED | We couldn’t check who the messages belong to. Nothing was deleted. Try again in a minute. |
| 503 | HOLD_CHECK_UNAVAILABLE | We couldn’t check for a legal hold. Nothing was deleted. Try again in a minute. |