Docs menu

Assign a chat or mark it seen

PATCH/v1/profiles/{profile_id}/chats/{chat_id}

  • Scope messages:send

assigned_to says who handles the chat (agent, human or null) and sends chat.updated. seen: true marks it read in the app (unread count 0) without a read receipt to the other side.

Parameters

Path

  • profile_idstringrequired

    The line (prf_…).

  • chat_idstringrequired

    The chat (cht_…).

Request body

  • assigned_to"agent" | "human" or null

    agent, human, or null for nobody.

  • seentrue

    true sets the unread count to 0 without a read receipt.

Response

200 OKThe chat.

  • 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

      Fields of attachments
      • idstringrequired

        att_…

      • file_namestring or nullrequired

      • mime_typestring or nullrequired

      • size_bytesinteger or nullrequired

      • urlstringrequired

        A path on the API: GET it with your key and follow the 302 to a short-lived download link.

    • 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

      Fields of reactions
      • kind"love" | "like" | "dislike" | "laugh" | "emphasize" | "question" or "emoji"required

        One of the six tapbacks, or emoji for an emoji reaction.

      • emojistring or nullrequired

        The emoji, when kind is emoji.

      • fromstringrequired

        "me" for the line's own reaction, else the person's address.

      • attimestamp or nullrequired

    • 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.

      Fields of error
      • codestringrequired

      • messagestringrequired

    • 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.

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