Browse Platform API
Platform API

Overview

Copy

The conversation module lets backend services read and maintain user conversation data, including sorted lists, individual records, batch reads, paginated owner reads, and batch updates.

Capability scope

CapabilityDescription
Conversation readsGet sorted conversations, one conversation, multiple conversations, or a user's conversations by page.
Conversation settingsSet conversation attributes and extension data in batches.
Conversation groups EnterpriseCreate, update, delete, and list user conversation groups, maintain group order, and manage conversations within groups.

Common APIs

Resource representations

ConversationInfo

ConversationInfo represents a conversation as stored for one user.

FieldTypeDescription
ownerUserIDstringUser ID that owns the conversation record.
conversationIDstringConversation ID.
conversationTypeintConversation type. See ConversationType.
userIDstringPeer user ID for a one-to-one conversation.
groupIDstringGroup ID for a group conversation.
recvMsgOptintMessage receiving option. See RecvMsgOpt.
isPinnedbooleanWhether the conversation is pinned.
attachedInfostringAttached conversation data.
isPrivateChatbooleanWhether private chat behavior is enabled.
groupAtTypeintGroup mention state. See GroupAtType.
exstringConversation extension data.
burnDurationintBurn-after-reading duration.
minSeqint64Minimum message sequence for this user's conversation.
maxSeqint64Maximum message sequence for this user's conversation.
msgDestructTimeint64Message destruction time.
latestMsgDestructTimeint64Latest message destruction time.
isMsgDestructbooleanWhether message destruction is enabled.
isMarked EnterprisebooleanWhether the conversation is marked.
remark EnterprisestringUser-defined conversation remark.

ConversationGroup

ConversationGroup represents an Enterprise user conversation group.

FieldTypeDescription
conversationGroupIDstringConversation group ID.
ownerUserIDstringUser ID that owns the group.
namestringGroup name.
orderint64Display order.
versionint64Group version.
exstringBusiness extension data.
conversationIDsstring[]Conversation IDs in the group.
hiddenbooleanWhether the group is hidden.
conversationGroupTypeintGroup type. See ConversationGroupType.
createTimeint64Creation time as a Unix timestamp in milliseconds.

ConversationGroupOrder

FieldTypeDescription
conversationGroupIDstringConversation group ID.
orderint64Target display order.

Enums

ConversationType

Message and Webhook sessionType fields use the same values.

ValueNameDescription
1SingleChatTypeOne-to-one chat.
2WriteGroupChatTypeWrite-group chat; direct use is not currently recommended.
3ReadGroupChatTypeGroup chat.
4NotificationChatTypeNotification conversation.

RecvMsgOpt

ValueNameDescription
0ReceiveMessageReceive messages.
1NotReceiveMessageDo not receive messages.
2ReceiveNotNotifyMessageReceive messages without notifications.

GroupAtType

ValueNameDescription
0AtNormalNo mention.
1AtMeCurrent user mentioned.
2AtAllAll members mentioned.
3AtAllAtMeBoth all members and the current user mentioned.
4GroupNotificationGroup notification.

ConversationGroupType

ValueNameDescription
0NormalNormal conversation group.
1FilterFilter group.

Integration advice

Use conversation APIs for administration, data repair, and multi-device synchronization support. Do not expose management endpoints directly to clients.

Before a batch update, verify that each conversation belongs to the target user so that another user's state is not modified.