Conversations
The inbox has one thread per contact. To reply, send to the contact with POST /v1/messages; it lands in the same thread. View-only teammates can read conversations but not change them. Reading a thread still marks it read (see List a thread’s messages). An id that isn’t on your account returns 404 CONVERSATION_NOT_FOUND. An id that isn’t a whole number returns 400 invalid_field.
#The Conversation object
List conversations returns this object. Find a contact’s conversation returns a shorter row (see there). Ignore fields you don’t recognize.
idinteger- The conversation id.
contact_idinteger- The contact id.
first_namestring- The contact’s first name.
last_namestring- The contact’s last name.
phoneE.164 string- The contact’s phone.
statusstringopen,closedorarchived.nullandactivemean open: treat them the same. Set it with Set a conversation’s status.unread_countinteger- Unread messages in the thread. Mark read and Archive clear it; Mark unread sets it to
1. starredinteger1or0. Toggle it with Star or unstar a conversation.pinnedinteger1or0.assigned_tointeger | null- Who the thread is assigned to, or
null. This is the contact’s owner when the contact has one, else the thread’s own assignee. Set it with Assign a conversation. last_message_atISO 8601 string- When the newest message was sent or received. The list is sorted by it, newest first.
last_message_previewstring- The start of the most recent message.
phone_number_idinteger- The id of your number the thread uses, as in
GET /v1/numbersandline_ids. from_numberE.164 string- Your number the thread uses.
tagsstring- The contact’s tags as a JSON array in a string, like
"[\"vip\"]". Parse it before you use it. contact_statusstring | null- The contact’s status.
dnd_smsinteger | null1when the contact is on do not disturb for texts.page_keystring- Where this thread sits in the list. Pass the last one as
beforeto get the next page. opt_out_atISO 8601 string | null- When the contact opted out, or
null.
#List conversations
Your inbox threads, newest message first. Starring doesn’t change the order; use filter=starred. Returns a list of Conversation objects in data.
Parameters
limitinteger · queryDefault50Max1000- Page size.
offsetinteger · queryDefault0- Rows to skip: a whole number, 0 or more. Each page skipped makes the next one slower, and with
searchit reaches only the first 2,000 matches. A page too deep to read in time answers503 offset_too_deep. To walk the whole list, page withbefore. beforestring · query- The next page: pass the
page_keyof the last thread you got. Works at any depth and withsearch; leaveoffsetout. filterenum · query- Which view; default is every thread that isn’t archived, closed ones included. Unknown values are ignored.
unreadstarredarchivedspamblocked
searchstring · query- Matches the contact’s name, phone, email or company, or the first 100 characters of the thread’s most recent message. Older messages aren’t searched. A full phone number in any format matches exactly.
line_idsstring · query- Comma-separated number ids from
GET /v1/numbers(not phone numbers), up to 100, for exampleline_ids=2647,2648. Invalid values are ignored. When none of them is a number id the whole inbox comes back, and the answer hasignored_filters: ["line_ids"]to say the filter was dropped. freshinteger · query- Lists are cached up to 30 seconds, and longer when the server is slow to refresh them. Send
1after a change to read live.
Filters
Every filter below is optional and they combine with AND. Comma-separated values are trimmed. A filter with an unknown or malformed value is ignored, not refused (the exceptions are marked), so a typo returns the unfiltered list: check total and the rows.
tagstring · query- Contact tags, comma-separated. With
tag_mode=anda thread must carry every tag; otherwise any one tag matches. tag_modeenum · queryandoror(the default). Only used withtag.tag_excludestring · query- Comma-separated tags. Threads whose contact has any of them are left out; contacts with no tags stay in.
pipeline_stagestring · query- One pipeline stage id, or several separated by commas (any of them).
categoryinteger · query- An inbox category id.
reply_categorystring · query- Comma-separated reply categories (lower case); any of them matches.
assigned_tostring · query- Comma-separated user ids and/or
unassigned; a thread matches when any of them is its assignee or a co-assignee. assigned_excludestring · query- Comma-separated user ids. Threads assigned to any of them are left out; unassigned threads stay in.
contact_statusstring · query- Comma-separated contact statuses; any of them matches.
contact_status_excludestring · query- Comma-separated contact statuses to leave out.
source, state, companystring · query- Case-insensitive "contains" match on the contact’s source, state or company. Add
_not(source_not,state_not,company_not) to leave out matches. reply_textstring · query- The lead has sent an inbound message containing this text (case-insensitive).
reply_text_excludestring · query- The lead has sent no inbound message containing this text.
area_codestring · query- Contact phone area code (first 3 digits of the 10-digit number).
area_code_notstring · query- Leaves out contacts with that area code.
dndenum · query1: contacts you can’t text (opted out or do-not-disturb).0: contacts you can.score_min, score_maxinteger · query- Contact score range, inclusive. A value that is not a whole number is ignored.
enrolled_seqstring · query- Contacts enrolled in this drip campaign.
last_activity, la_from, la_tostring · query- Last message activity.
last_activityisnone(never messaged),before(withla_to),after(withla_from) orbetween(both). Dates areYYYY-MM-DDor a UTC instant ending inZ. An unknown mode or malformed date answers 400. starred, pinned, litigator, landline, opted_outboolean · query- Send
1to keep only threads with that flag. Any other value adds no filter. Flags combine with AND. carrierstring · query- Exact contact carrier name.
reply_statusstring · query- Comma-separated:
needs_reply,replied,unanswered,positive,negative. Any of them matches (OR). reply_status_allstring · query- Same values; every one listed must hold (AND).
reply_status_excludestring · query- Same values; a thread matching any of them is left out.
last_directionenum · queryinbound(the lead spoke last) oroutbound.deliveryenum · queryfailed: at least one outbound message failed.delivered: at least one was delivered.ai_draftboolean · query1: an AI draft reply is waiting.0: none.drip_sequence_id, campaign_blast_idinteger · query- Threads that replied to that drip campaign or one-time campaign.
drip_sequence_idwins when both are sent. A value that is not a whole number is ignored. campaign_days, campaign_sincestring · query- Narrow the campaign filter: sends in the last
campaign_daysdays (1 to 3650, default all), or since the date incampaign_since, which wins.
Returns
data[]object[]- Conversation objects.
has_moreboolean- Keep paging while
true. search_timed_outbooleantruewhen a search ran out of time. Ifdatais empty, that is not "no matches": narrow the search and retry.search_partialbooleantruemeans some matches may be missing.search_offset_cappedbooleantruewhenoffsetpaged a search past its first 2,000 matches. More exist: page on withbefore.did_you_meanobject[]- Only on an empty first page of a phone number search: up to 5 conversations whose number is one digit off (one digit changed, or two neighbouring digits swapped), newest first, as Conversation objects. Show them as suggestions. Left out when there are none.
totalinteger- Threads matching
filterandsearch, counted up to 1,000. While searching, or filtering by tag, assignee or campaign,totalis the rows returned so far, not a count, so usehas_more. Withline_ids,totalandcountscover only those numbers. total_cappedbooleantruewhen the count passed the cap.count_capinteger- The cap,
1000. countsobject- Thread counts per view:
all(the default view, without archived),unread,starred,pinned,archived,spam.
Errors
| HTTP | Code | When |
|---|---|---|
| 400 | invalid_offset | Not a whole number, 0 or more (in error_code). |
| 503 | offset_too_deep | An offset page without search ran out of time. Nothing was skipped: page with before from the last thread you got. |
curl "https://api.tryready.com/conversations?limit=50&filter=unread" \
-H "X-API-Key: $READY_API_KEY"
const res = await fetch('https://api.tryready.com/conversations?limit=50&filter=unread', {
headers: {
'X-API-Key': process.env.READY_API_KEY,
},
signal: AbortSignal.timeout(65 * 1000),
});
const json = await res.json().catch(() => ({}));
if (!res.ok || json.success === false) {
throw new Error(`${res.status}${json.error_code || json.code ? ' ' + (json.error_code || json.code) : ''}: ${json.error || json.message || res.statusText} (request ${res.headers.get('x-request-id')})`);
}
import os, requests
r = requests.get(
"https://api.tryready.com/conversations",
headers={"X-API-Key": os.environ["READY_API_KEY"]},
params={
"limit": 50,
"filter": "unread"
},
timeout=65,
)
data = r.json() if r.headers.get("content-type", "").startswith("application/json") else {}
if not r.ok or data.get("success") is False:
raise RuntimeError(f'{r.status_code} {data.get("error_code") or data.get("code") or ""}: {data.get("error") or data.get("message") or r.reason} (request {r.headers.get("x-request-id")})')
{
"success": true,
"data": [
{
"id": 5521,
"contact_id": 101,
"first_name": "Ada",
"last_name": "Lovelace",
"phone": "+12125550199",
"status": "open",
"unread_count": 1,
"starred": 0,
"pinned": 0,
"assigned_to": null,
"last_message_at": "2026-10-01T20:40:12.004Z",
"last_message_preview": "Yes, I'm interested!",
"phone_number_id": 2647,
"from_number": "+14155550100"
}
],
"total": 1,
"has_more": false,
"total_capped": false,
"count_cap": 1000,
"counts": {
"all": 238,
"unread": 1,
"starred": 0,
"pinned": 0,
"archived": 10,
"spam": 0
}
}
#List messages in a conversation
One thread’s messages: the newest page, oldest first within the page. Returns a list of Message objects in data, with the differences under Returns.
mark_read=0. A test key never marks a thread read.Parameters
idinteger · pathRequired- The conversation id.
mark_readinteger · query- Send
0to leave the unread state alone. limitinteger · queryDefault50Max500- Page size.
offsetinteger · queryDefault0- Increase to go further back in time.
Returns
data[].idinteger- This thread’s message id, the one
quoted_message_idtakes on Send a message. data[].to_numberE.164 string- Recipient.
data[].from_numberE.164 string- Sender.
data[].costnumber- What the message cost, in USD.
data[].failed_atISO 8601 string | null- When it failed, or
null. data[].senderobject- On an outbound text, who sent it:
kind(team,campaign,automationorintegration) andname(the teammate, campaign, automation or integration, ornullwhen it isn’t known). Left out when we can’t tell. data[].can_reactbooleantrueon a received iMessage to your iMessage line that you can react to with a tapback. Left out otherwise.
Errors
| HTTP | Code | When |
|---|---|---|
| 403 | CONVERSATION_NOT_ASSIGNED | Teammate access doesn’t cover this thread: it’s assigned to someone else. Also CONVERSATION_NOT_ALLOCATED: the thread’s number isn’t allocated to you. |
curl "https://api.tryready.com/conversations/5521/messages?mark_read=0&limit=50" \
-H "X-API-Key: $READY_API_KEY"
const res = await fetch('https://api.tryready.com/conversations/5521/messages?mark_read=0&limit=50', {
headers: {
'X-API-Key': process.env.READY_API_KEY,
},
signal: AbortSignal.timeout(65 * 1000),
});
const json = await res.json().catch(() => ({}));
if (!res.ok || json.success === false) {
throw new Error(`${res.status}${json.error_code || json.code ? ' ' + (json.error_code || json.code) : ''}: ${json.error || json.message || res.statusText} (request ${res.headers.get('x-request-id')})`);
}
import os, requests
r = requests.get(
"https://api.tryready.com/conversations/5521/messages",
headers={"X-API-Key": os.environ["READY_API_KEY"]},
params={
"mark_read": 0,
"limit": 50
},
timeout=65,
)
data = r.json() if r.headers.get("content-type", "").startswith("application/json") else {}
if not r.ok or data.get("success") is False:
raise RuntimeError(f'{r.status_code} {data.get("error_code") or data.get("code") or ""}: {data.get("error") or data.get("message") or r.reason} (request {r.headers.get("x-request-id")})')
{
"success": true,
"data": [
{
"id": 19292894,
"direction": "outbound",
"body": "Your order #1042 has shipped.",
"status": "delivered",
"to_number": "+12125550199",
"from_number": "+14155550100",
"segments": 1,
"cost": 0.012,
"media_url": null,
"created_at": "2026-10-01T20:32:03.473Z",
"sent_at": "2026-10-01T20:32:04.102Z",
"delivered_at": "2026-10-01T20:32:09.856Z",
"failed_at": null
},
{
"id": 19408828,
"direction": "inbound",
"body": "Yes, I'm interested!",
"status": "received",
"to_number": "+14155550100",
"from_number": "+12125550199",
"segments": 1,
"cost": 0.0105,
"media_url": null,
"created_at": "2026-10-01T20:40:12.004Z",
"sent_at": null,
"delivered_at": null,
"failed_at": null
}
]
}
#Find a contact’s conversation
The thread for one contact, or null if there isn’t one. An unknown contact id also returns null, not a 404.
Parameters
contactIdinteger · pathRequired- The contact id.
Returns
dataobject | null- A shorter Conversation object, or
null. It has notags. Itsassigned_tois the thread’s own assignee, andcontact_assigned_tois the contact’s owner, so it can differ from the list’sassigned_to.
Errors
| HTTP | Code | When |
|---|---|---|
| 403 | CONVERSATION_NOT_ASSIGNED | Teammate access doesn’t cover this thread: it’s assigned to someone else. Also CONVERSATION_NOT_ALLOCATED: the thread’s number isn’t allocated to you. |
curl "https://api.tryready.com/conversations/by-contact/101" \
-H "X-API-Key: $READY_API_KEY"
const res = await fetch('https://api.tryready.com/conversations/by-contact/101', {
headers: {
'X-API-Key': process.env.READY_API_KEY,
},
signal: AbortSignal.timeout(65 * 1000),
});
const json = await res.json().catch(() => ({}));
if (!res.ok || json.success === false) {
throw new Error(`${res.status}${json.error_code || json.code ? ' ' + (json.error_code || json.code) : ''}: ${json.error || json.message || res.statusText} (request ${res.headers.get('x-request-id')})`);
}
import os, requests
r = requests.get(
"https://api.tryready.com/conversations/by-contact/101",
headers={"X-API-Key": os.environ["READY_API_KEY"]},
timeout=65,
)
data = r.json() if r.headers.get("content-type", "").startswith("application/json") else {}
if not r.ok or data.get("success") is False:
raise RuntimeError(f'{r.status_code} {data.get("error_code") or data.get("code") or ""}: {data.get("error") or data.get("message") or r.reason} (request {r.headers.get("x-request-id")})')
{
"success": true,
"data": {
"id": 5521,
"contact_id": 101,
"first_name": "Ada",
"last_name": "Lovelace",
"phone": "+12125550199",
"status": "open",
"unread_count": 0,
"contact_status": "active",
"dnd_sms": 0,
"opt_out_at": null,
"last_message_at": "2026-10-01T20:40:12.004Z"
}
}
{
"success": true,
"data": null
}
#Best time to text a contact
A 2-hour window when this contact has replied to you most, from the hours of their past replies. It needs at least 3 replies; with fewer you get best: null. The window always falls between 9:00 AM and 7:00 PM in your account’s time zone. Read only.
Parameters
contactIdinteger · pathRequired- The contact id.
Returns
bestobject | null- The window, at the top level, or
nullwhen there aren’t enough replies. best.start_hhmmstring- Start of the window, like
14:00. best.end_hhmmstring- End of the window, 2 hours later.
best.labelstring- The window in words, like
2 PM to 4 PM. best.sampleinteger- How many replies it’s based on.
best.sourcestring- Always
contact. best.reasonstring- A short sentence you can show.
timezonestring- Your account’s IANA time zone. The window’s hours are in this zone.
dataobject- The same
bestandtimezoneagain, for clients that read every answer fromdata.
Errors
| HTTP | Code | When |
|---|---|---|
| 400 | INVALID_CONTACT_ID | Not a contact id (for example a phone number). |
| 403 | CONVERSATION_NOT_ASSIGNED | Teammate access doesn’t cover this thread: it’s assigned to someone else. Also CONVERSATION_NOT_ALLOCATED: the thread’s number isn’t allocated to you. |
| 500 | best_time_unavailable | We couldn’t work it out right now. This is a failure, not "no data"; retry. |
curl "https://api.tryready.com/conversations/by-contact/101/best-time" \
-H "X-API-Key: $READY_API_KEY"
const res = await fetch('https://api.tryready.com/conversations/by-contact/101/best-time', {
headers: {
'X-API-Key': process.env.READY_API_KEY,
},
signal: AbortSignal.timeout(65 * 1000),
});
const json = await res.json().catch(() => ({}));
if (!res.ok || json.success === false) {
throw new Error(`${res.status}${json.error_code || json.code ? ' ' + (json.error_code || json.code) : ''}: ${json.error || json.message || res.statusText} (request ${res.headers.get('x-request-id')})`);
}
import os, requests
r = requests.get(
"https://api.tryready.com/conversations/by-contact/101/best-time",
headers={"X-API-Key": os.environ["READY_API_KEY"]},
timeout=65,
)
data = r.json() if r.headers.get("content-type", "").startswith("application/json") else {}
if not r.ok or data.get("success") is False:
raise RuntimeError(f'{r.status_code} {data.get("error_code") or data.get("code") or ""}: {data.get("error") or data.get("message") or r.reason} (request {r.headers.get("x-request-id")})')
{
"success": true,
"best": {
"source": "contact",
"start_hhmm": "14:00",
"end_hhmm": "16:00",
"label": "2 PM to 4 PM",
"sample": 7,
"reason": "When this contact has replied to you before."
},
"timezone": "America/Chicago",
"data": {
"best": {
"source": "contact",
"start_hhmm": "14:00",
"end_hhmm": "16:00",
"label": "2 PM to 4 PM",
"sample": 7,
"reason": "When this contact has replied to you before."
},
"timezone": "America/Chicago"
}
}
{
"success": true,
"best": null,
"timezone": "America/Chicago",
"data": { "best": null, "timezone": "America/Chicago" }
}
See also: the guide to doing this in the app.