Conversation

Conversation entity.

Conversation consists of parts (ConversationPart objects).

Standard object fields

  • id: ID
    Unique conversation identifier.

  • created: timestamp
    Date of conversation creation.

  • replied: boolean
    This flag indicates if a conversation is visible in admin panel's "inbox" list.
    Note: Historically, this flag showed if there were user replies in the conversation. That's why it is called replied. But nowadays in some cases flag can be set to true event without user replies in the conversation. For instance, when a chat bot assigns conversation to an operator.

  • delayed_until: Optional[timestamp]
    Time until which the conversation has been delayed.

  • closed: boolean
    Shows whether the conversation is closed.

  • message: Optional[ID]
    ID of the message which started this conversation (manual, auto, lead-bot). null if message has not been started by a message.

  • type: str Conversation type. It is set by conversation's very first message reply. The options are:

    • email
    • incoming_email - incoming email via email integration or MX integration
    • popup_small, popup_big - pop-up (small or big)
    • block_popup_small, block_popup_big - pop-up, created over Pop-up builder
    • popup_chat - chat message
    • lead_bot - lead-bot
    • routing_bot - welcome-bot
    • push - Web-Push message
    • sdk_push - Push-message to user's application using SDK (iOS or Android)
  • reply_type: str
    Expected reply type to the first message. Can be one of the following: text, email, phone, push, button, no.

  • removed: Optional[timestamp]
    If the conversation has been removed (for example, during user GDPR removal), contains remove timestamp. null otherwise.

  • reply_last_type: str
    Last conversation reply type (reply_last). Can be either reply_user or reply_admin.

  • parts_count: integer
    Total number of replies (including system ones) in conversations.

  • assignee: Optional[Admin]
    Operator, to whom this conversation is assigned. Admin object. null if conversation is not assigned to anyone.

  • sended_time: datetime
    Time when message which initiated the conversation has been sent. Can differ from created field in some system cases.

  • admin_unread_count: integer
    Number of user replies, not read by an operator.

  • user_unread_count: integer
    Number of operator replies, not read by user.

  • not_answered_admin_replies: integer
    Number of user replies, not answered by operator (e. g. number of user replies since last operator reaction reply seen by the user).

  • unread_parts_count: integer
    Deprecated. Duplicates user_unread_count.

  • replies_count: int
    Number of user or operator replies in the conversation.

  • last_admin: Optional[Admin]
    Last operator chatting in the conversation. Admin object (can be null if no operator joined the conversation).

  • last_update: datetime
    Conversation last update date (time of last reply creation).

  • tags: Array[str]
    Conversation tags.

  • important: boolean
    A flag indicating that conversation is important to answer. The conversation is considered important if last reply is from user or conversation is not assigned to operator.

  • external_service: Optional[str]
    Type of integration with messenger through which user interacts. null, if conversation has not been created by integration.

  • external_id: Optional[str]
    External conversation ID, if conversation is created by integration with messenger. null if not.

  • last_user_reply_time: Optional[datetime]
    Last user reply time. Can be null if there are no user replies.

  • status: Optional[str]
    Status of manual message, which initiated this conversation. null if conversation is not created by a message or for old message system. Options: created, rendered, sent, accepted, delivered, bounced, complained, dropped, error.

  • assistant_type: Optional[str]
    Assistant that manages this conversation. If conversation is managed by operator - null.
    Assistant types: dialogflow, lead_bot, routing_bot, facebook_bot, telegram_bot, widget_bot.

  • recipient_type: str
    Conversation message recipient type if it can be sent both to chat and SDK. Options: all, web, sdk.

Optional fields

  • user: User
    User, with whom this conversation is being conducted.

  • channel: Optional[Channel]
    Current conversation channel. If conversation is not in a channel at the moment - null. Channel object.

  • part_last: ConversationPart
    The very last reply in the conversation (including system replies). ConversationPart object.

  • important_part_last: ConversationPart
    Last important reply. You can see this reply in left "Inbox" section of admin panel. Comparing to part_last, this reply don't contain system replies. But, for instance, contains notes (comparing to reply_last). ConversationPart object.

  • reply_last: ConversationPart
    Last reply of operator or user. No notes, no system replies. ConversationPart object.

Example

{
  "id": 1882298,
  "created": 1436614153,
  "user": {
     ...
  },
  "read": true,
  "replied": true,
  "clicked": false,
  "unsubscribed": false,
  "closed": false,
  "message": 299,
  "type": "email",
  "reply_type": "text",
  "part_last": {
    ...
  },
  "parts_count": 5,
  "assignee": {
    ...
  },
  "unread_parts_count": 0,
  "last_admin": {
    ...
  },
  "last_update": 1436626215,
  "tags": ["sales", "en"]
}