Docs menu

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_idstringrequired

    The line (prf_…).

Query

  • limitinteger

    Items per page, 1–200 (default 50).

  • beforestring

    The next_before of the previous page.

  • handlestring

    The chat with this person (any phone format) or group id.

  • assigned_to"agent" | "human" | "none"

    agent, human or none.

  • tagstring

    Only chats with people your team tagged this way (any case).

Response

200 OKA page of chats.

  • dataarray of ChatSummaryrequired

    Fields of data
    • idstringrequired

      cht_…

    • object"chat"required

    • profile_idstringrequired

      prf_…

    • handlestringrequired

      The other side: a phone number (+1…), an email, or a group chat id.

    • kind"dm" | "group"required

    • titlestring or nullrequired

      The chat's own name (group chats).

    • contactChatContact or nullrequired

      What the team calls the person (contacts), or null when nobody named them.

      Fields of contact
      • namestring or nullrequired

      • tagsarray of stringrequired

    • last_message_attimestamp or nullrequired

    • assigned_to"agent" | "human" or nullrequired

      Who handles the chat; a flag your agent can read and set.

    • last_read_attimestamp or nullrequired

    • created_attimestamprequired

    • unread_countintegerrequired

      Inbound messages since the chat was last read.

    • last_messageMessage or nullrequired

      A message sent or received on a line.

      Fields of last_message
      • idstringrequired

        msg_…

      • object"message"required

      • profile_idstringrequired

        prf_…

      • chat_idstringrequired

        cht_…

      • chat_handlestring

        The chat's address: a phone number, email or group chat id.

      • direction"inbound" | "outbound"required

      • senderstring or nullrequired

        Who sent an inbound message (in group chats, one of the members).

      • textstring or nullrequired

      • attachmentsarray of Attachmentrequired

      • servicestring or nullrequired

        How it went or came: iMessage, RCS or SMS. Null until known.

      • requested_servicestring or nullrequired

        The service the send asked for, if any.

      • fallback_fromstring or nullrequired

        Set when the message failed over: the service it started on (iMessage).

      • reactionsarray of Reactionrequired

      • status"queued" | "dispatched" | "sent" | "delivered" | "read" | "failed" | "unconfirmed" | "received"required

        queued → dispatched → sent → delivered → read (iMessage only), or failed / unconfirmed. Inbound messages are received.

      • errorobject or nullrequired

        Why a message failed: line_unavailable, recipient_not_allowed, sending_paused, unconfirmed or send_failed.

      • guidstring or nullrequired

        The message's id in Messages, once it has one.

      • created_attimestamprequired

      • sent_attimestamp or nullrequired

      • delivered_attimestamp or nullrequired

      • read_attimestamp or nullrequired

      • queue_untiltimestamp or nullrequired

        While queued: when the send gives up if the line is still unavailable.

  • has_morebooleanrequired

    More items exist after this page.

  • next_beforestring or nullrequired

    Pass as before for the next page; null on the last one.

Errors

StatusCodeMeans
400validation_failedA field is missing or invalid.
401unauthorizedThe API key is missing, unknown or revoked.
403insufficient_scopeThe API key lacks the scope this needs.
404not_foundNo such object, or the key can't see it.

Every error is { "error": { "code", "message" } }. All error codes.

Keys come with your first line.

Request an invite and we'll set up a line for your team. API access is part of every plan.

Request an invite