ready. Try Ready →Sign up

#Conversations

The inbox has one thread per contact. To reply, send to the contact with POST /v1/messages; it lands in the same thread.

Errors here carry their code in code unless noted. View-only teammates can read conversations but not change them.

#List conversations

GET/conversations

Your inbox threads: starred first, then by latest message.

  • Cost Free

Query parameters

limitintegerOptionalDefault 50Max 1000
Page size.
offsetintegerOptionalDefault 0
Rows to skip: a whole number, 0 or more.
filterenumOptional
Which view; default is open threads (archived and snoozed hidden). Unknown values are ignored.
  • unread
  • starred
  • archived
  • snoozed
  • spam
  • blocked
line_idsstringOptional
Comma-separated number ids from GET /v1/numbers (not phone numbers), up to 100.
DetailsFor example line_ids=2647,2648. Invalid values are ignored, which returns the whole inbox.
freshintegerOptional
Lists are cached up to 30 seconds. Send 1 after a change to read live.

Returns

data[]object[]
Threads. Ignore fields you don't recognize.
DetailsFields include id, contact_id, first_name, last_name, phone, status, unread_count, starred, pinned, assigned_to, last_message_at, last_message_preview, phone_number_id, from_number, tags and more.
has_moreboolean
Keep paging while true.
totalinteger
Threads matching filter and search, counted up to 1,000.
DetailsPast that, total_capped: true and count_cap: 1000. With line_ids, total and counts ignore the lines and count every line's threads, so use has_more.
countsobject
Thread counts per view.
Detailsall (the default view, without archived and snoozed), unread, starred, pinned, archived, snoozed, spam.

Errors

HTTPCodeWhen
400invalid_offsetNot a whole number, 0 or more (in error_code).

#List messages in a conversation

GET/conversations/:id/messages

One thread's messages: the newest page, oldest first within the page.

  • Cost Free
Important. Reading the newest page marks the thread as read. Sync jobs should add mark_read=0.

Path parameters

idintegerRequired
The conversation id.

Query parameters

mark_readintegerOptional
Send 0 to leave the unread state alone.
limitintegerOptionalDefault 50Max 500
Page size.
offsetintegerOptionalDefault 0
Increase to go further back in time.

Returns

data[]object[]
Messages. Ignore fields you don't recognize.
DetailsFields include id, direction (inbound or outbound), body, status, to_number, from_number, segments, cost, media_url, created_at, sent_at, delivered_at, failed_at, and more.

Errors

HTTPCodeWhen
403CONVERSATION_NOT_ASSIGNEDTeammate access doesn't cover this thread.
DetailsAssigned to someone else. Also CONVERSATION_NOT_ALLOCATED: the thread's number isn't allocated to you.
404CONVERSATION_NOT_FOUNDNo such conversation on your account.

#Find a contact's conversation

GET/conversations/by-contact/:contactId

The thread for one contact, or null if there isn't one.

  • Cost Free

Path parameters

contactIdintegerRequired
The contact id.

Returns

dataobject | null
The thread, or null. An unknown contact id also returns null, not a 404.
DetailsThis row has contact_status, dnd_sms and opt_out_at, and no tags.

Errors

HTTPCodeWhen
403CONVERSATION_NOT_ASSIGNEDTeammate access doesn't cover this thread.
DetailsAssigned to someone else. Also CONVERSATION_NOT_ALLOCATED: the thread's number isn't allocated to you.

#Assign a conversation

PUT/conversations/:id/assign

Replaces the thread's assignees.

  • Auth API key, not view-only
  • Cost Free

Path parameters

idintegerRequired
The conversation id.

Body parameters

assignee_idsinteger[]Required
Team member ids (Settings → Team); [] unassigns. The first id is the primary owner.
DetailsThe first id also becomes the contact's owner. It must be a JSON array of ids.

Returns

assignee_idsinteger[]
The new assignees, at the top level.

Errors

HTTPCodeWhen
400invalid_assignee_idsNot a list of ids (in error_code).
400invalid_assigneeAn id isn't on your team.
404not_foundNo such conversation (lower case here).

#Set conversation status

PUT/conversations/:id/status

Opens or closes a thread.

  • Auth API key, not view-only
  • Cost Free

Path parameters

idintegerRequired
The conversation id.

Body parameters

statusenumRequired
open or closed (also active, archived). To archive, prefer Archive, which also sets the archive time.

Errors

HTTPCodeWhen
400invalid_statusMissing or unknown status.
404no codeNo such conversation.

#Mark read

PUT/conversations/:id/read

Clears the thread's unread count. No body.

  • Auth API key, not view-only
  • Cost Free

Path parameters

idintegerRequired
The conversation id.

Errors

HTTPCodeWhen
404CONVERSATION_NOT_FOUNDNo such conversation on your account.

#Mark unread

PUT/conversations/:id/unread

Sets the thread's unread count to 1. No body.

  • Auth API key, not view-only
  • Cost Free

Path parameters

idintegerRequired
The conversation id.

Errors

HTTPCodeWhen
404CONVERSATION_NOT_FOUNDNo such conversation on your account.

#Archive

PUT/conversations/:id/archive

Archives the thread and clears its unread count. No body.

  • Auth API key, not view-only
  • Cost Free

Path parameters

idintegerRequired
The conversation id.

Errors

HTTPCodeWhen
404CONVERSATION_NOT_FOUNDNo such conversation on your account.

#Unarchive

PUT/conversations/:id/unarchive

Brings the thread back to the inbox with status: "open", even if it was closed. No body.

  • Auth API key, not view-only
  • Cost Free

Path parameters

idintegerRequired
The conversation id.

Errors

HTTPCodeWhen
404CONVERSATION_NOT_FOUNDNo such conversation on your account.

#Star or unstar

PUT/conversations/:id/star

Toggles the star on or off. No body.

  • Auth API key, not view-only
  • Cost Free

Path parameters

idintegerRequired
The conversation id.

Returns

data.starredinteger
The new value, 1 or 0. For a specific state, read starred from the list first.

Errors

HTTPCodeWhen
404CONVERSATION_NOT_FOUNDNo such conversation on your account.