Browse SDKs · WASM
SDKsWASMEnterprise

Schedule server message deletion

Enable, disable, and configure scheduled server-message deletion for a conversation.

Copy

Scheduled server-message deletion consists of isMsgDestruct and msgDestructTime. The former controls whether the policy is enabled, while the latter stores the deletion interval. Because they are part of one operation, submit both fields in a single call.

await openimsdk.setConversation({
  conversationID,
  isMsgDestruct: true,
  msgDestructTime: 3600,
});

msgDestructTime is measured in seconds. Pass isMsgDestruct: false to disable the policy; product behavior determines whether the previous interval is retained. This capability periodically deletes server messages and is not burn after reading, which uses isPrivateChat and burnDuration.

When the deletion interval is reached, the policy removes only messages stored on the server. It does not proactively delete messages already synchronized to the current device or another client. After reinstalling the client, clearing local data, or switching to a new device that has never synchronized those messages, messages already removed from the server cannot be retrieved again.

A successful Promise means that the setting request has completed. Merge the latest enablement state and interval from OnConversationChanged by conversationID; see Get the conversation list for the complete listener.