Browse Platform API
Platform API

Overview

Copy

The message module lets business backends write and manage messages through the Platform API. In addition to normal sending, batch delivery, and business notifications, Enterprise capabilities cover content processing, streaming messages, unread counts, and read state.

Capability scope

CapabilityDescription
Send messagesWrite a message to a one-to-one or group conversation with a sender, target, content type, push options, and send time.
Batch sendingSend the same message to multiple users or deliver a low-frequency system notification to all users.
Business notificationsDeliver custom business events through OpenIM. Clients receive OnRecvCustomBusinessMessage; the request controls whether a conversation message is also created and which reliability level is used.
Message managementRevoke a message by conversation ID and message Seq and synchronize the revoke event to relevant users.
Time synchronizationGet the message server time for send timestamps, migration, and business log alignment.
Message modification EnterpriseModify message content or extension fields and synchronize the change to relevant clients.
Content processing EnterpriseTranslate message or business text through a server-side API.
Streaming messages EnterpriseCreate a streaming message and append content for progressively generated responses such as AI output.
Unread count management EnterpriseQuery, clear, or reset unread counts for selected user conversations.
Read state EnterpriseMark a selected user conversation as read.

Common APIs

Enums

ContentType

contentType determines the JSON structure of content. See Message content types for message-specific fields and examples.

SessionType

Message sessionType uses the same values as ConversationType.

MsgFrom

ValueNameDescription
100UserMsgTypeUser message.
200SysMsgTypeSystem message.

MessageStatus

ValueNameDescription
1MsgNormalNormal message.
4MsgDeletedDeleted message.

Integration advice

Before sending from the backend, verify that the sender identity, target user or group, content type, and push options originate from a trusted business workflow. Normal user chat is generally sent by the client SDK under the signed-in user's identity; the Platform API is better suited to system messages, operational notifications, migration, and administration.

When importing historical messages, use sendTime to preserve the original timestamp. Import users, groups, and friend relationships first, then write messages in conversation order to avoid timeline discontinuities.