List chats
GET/v1/profiles/{profile_id}/chats
- Scope
messages:read - Pages with
before
The line's chats, most recent first, each with its newest message and unread count. Works while the line has trouble.
Parameters
Path
profile_idstringrequiredThe line (
prf_…).
Query
limitintegerItems per page, 1–200 (default 50).
beforestringThe
next_beforeof the previous page.handlestringThe chat with this person (any phone format) or group id.
assigned_to"agent" | "human" | "none"agent,humanornone.tagstringOnly chats with people your team tagged this way (any case).
Response
200 OKA page of chats.
dataarray of ChatSummaryrequiredFields of
dataidstringrequiredcht_…object"chat"requiredprofile_idstringrequiredprf_…handlestringrequiredThe other side: a phone number (
+1…), an email, or a group chat id.kind"dm" | "group"requiredtitlestring or nullrequiredThe chat's own name (group chats).
contactChatContact or nullrequiredWhat the team calls the person (contacts), or null when nobody named them.
Fields of
contactnamestring or nullrequiredtagsarray of stringrequired
last_message_attimestamp or nullrequiredassigned_to"agent" | "human" or nullrequiredWho handles the chat; a flag your agent can read and set.
last_read_attimestamp or nullrequiredcreated_attimestamprequiredunread_countintegerrequiredInbound messages since the chat was last read.
last_messageMessage or nullrequiredA message sent or received on a line.
Fields of
last_messageidstringrequiredmsg_…object"message"requiredprofile_idstringrequiredprf_…chat_idstringrequiredcht_…chat_handlestringThe chat's address: a phone number, email or group chat id.
direction"inbound" | "outbound"requiredsenderstring or nullrequiredWho sent an inbound message (in group chats, one of the members).
textstring or nullrequiredattachmentsarray of Attachmentrequiredservicestring or nullrequiredHow it went or came:
iMessage,RCSorSMS. Null until known.requested_servicestring or nullrequiredThe
servicethe send asked for, if any.fallback_fromstring or nullrequiredSet when the message failed over: the service it started on (
iMessage).reactionsarray of Reactionrequiredstatus"queued" | "dispatched" | "sent" | "delivered" | "read" | "failed" | "unconfirmed" | "received"requiredqueued→dispatched→sent→delivered→read(iMessage only), orfailed/unconfirmed. Inbound messages arereceived.errorobject or nullrequiredWhy a message failed:
line_unavailable,recipient_not_allowed,sending_paused,unconfirmedorsend_failed.guidstring or nullrequiredThe message's id in Messages, once it has one.
created_attimestamprequiredsent_attimestamp or nullrequireddelivered_attimestamp or nullrequiredread_attimestamp or nullrequiredqueue_untiltimestamp or nullrequiredWhile
queued: when the send gives up if the line is still unavailable.
has_morebooleanrequiredMore items exist after this page.
next_beforestring or nullrequiredPass as
beforefor the next page; null on the last one.
Errors
| Status | Code | Means |
|---|---|---|
| 400 | validation_failed | A field is missing or invalid. |
| 401 | unauthorized | The API key is missing, unknown or revoked. |
| 403 | insufficient_scope | The API key lacks the scope this needs. |
| 404 | not_found | No such object, or the key can't see it. |
Every error is { "error": { "code", "message" } }. All error codes.