Platform API
Overview
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
| Capability | Description |
|---|---|
| Conversation reads | Get sorted conversations, one conversation, multiple conversations, or a user's conversations by page. |
| Conversation settings | Set conversation attributes and extension data in batches. |
| Conversation groups Enterprise | Create, update, delete, and list user conversation groups, maintain group order, and manage conversations within groups. |
Common APIs
- Get sorted conversations
- Get a conversation
- Get conversations in batches
- Get a user's conversations
- Set conversations in batches
- List conversation groups Enterprise
- Create a conversation group Enterprise
- Add conversations to groups Enterprise
Resource representations
ConversationInfo
ConversationInfo represents a conversation as stored for one user.
| Field | Type | Description |
|---|---|---|
| ownerUserID | string | User ID that owns the conversation record. |
| conversationID | string | Conversation ID. |
| conversationType | int | Conversation type. See ConversationType. |
| userID | string | Peer user ID for a one-to-one conversation. |
| groupID | string | Group ID for a group conversation. |
| recvMsgOpt | int | Message receiving option. See RecvMsgOpt. |
| isPinned | boolean | Whether the conversation is pinned. |
| attachedInfo | string | Attached conversation data. |
| isPrivateChat | boolean | Whether private chat behavior is enabled. |
| groupAtType | int | Group mention state. See GroupAtType. |
| ex | string | Conversation extension data. |
| burnDuration | int | Burn-after-reading duration. |
| minSeq | int64 | Minimum message sequence for this user's conversation. |
| maxSeq | int64 | Maximum message sequence for this user's conversation. |
| msgDestructTime | int64 | Message destruction time. |
| latestMsgDestructTime | int64 | Latest message destruction time. |
| isMsgDestruct | boolean | Whether message destruction is enabled. |
| isMarked Enterprise | boolean | Whether the conversation is marked. |
| remark Enterprise | string | User-defined conversation remark. |
ConversationGroup
ConversationGroup represents an Enterprise user conversation group.
| Field | Type | Description |
|---|---|---|
| conversationGroupID | string | Conversation group ID. |
| ownerUserID | string | User ID that owns the group. |
| name | string | Group name. |
| order | int64 | Display order. |
| version | int64 | Group version. |
| ex | string | Business extension data. |
| conversationIDs | string[] | Conversation IDs in the group. |
| hidden | boolean | Whether the group is hidden. |
| conversationGroupType | int | Group type. See ConversationGroupType. |
| createTime | int64 | Creation time as a Unix timestamp in milliseconds. |
ConversationGroupOrder
| Field | Type | Description |
|---|---|---|
| conversationGroupID | string | Conversation group ID. |
| order | int64 | Target display order. |
Enums
ConversationType
Message and Webhook sessionType fields use the same values.
| Value | Name | Description |
|---|---|---|
| 1 | SingleChatType | One-to-one chat. |
| 2 | WriteGroupChatType | Write-group chat; direct use is not currently recommended. |
| 3 | ReadGroupChatType | Group chat. |
| 4 | NotificationChatType | Notification conversation. |
RecvMsgOpt
| Value | Name | Description |
|---|---|---|
| 0 | ReceiveMessage | Receive messages. |
| 1 | NotReceiveMessage | Do not receive messages. |
| 2 | ReceiveNotNotifyMessage | Receive messages without notifications. |
GroupAtType
| Value | Name | Description |
|---|---|---|
| 0 | AtNormal | No mention. |
| 1 | AtMe | Current user mentioned. |
| 2 | AtAll | All members mentioned. |
| 3 | AtAllAtMe | Both all members and the current user mentioned. |
| 4 | GroupNotification | Group notification. |
ConversationGroupType
| Value | Name | Description |
|---|---|---|
| 0 | Normal | Normal conversation group. |
| 1 | Filter | Filter 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.
Related pages
Was this page helpful?