please select
  • UIKit
  • SDK
  • Server APIs
Chat/
SDK/
Web/
Message/
SDK
  • Install Chat SDK
  • Initialize Chat SDK
  • Login and Logout
  • Client APIs
  • Changelog
  • Message
    • Overview
    • Send a Message
    • Receive a Message
    • Historical Message
    • Forward Messages
    • Modify a Message
    • Delete Messages
    • Clear History Message
    • Recall a Message
    • Send an Online Message
    • Message Read Receipt
    • Query Messages
    • Targeted Group Message
    • Do not Notify
    • Key-Value Extensions
    • Translation
  • Conversation
    • Overview
    • Conversation List
    • Get Conversations
    • Unread Count
    • Pin Conversations
    • Delete Conversations
    • Mark
    • Conversation Group
  • Group
    • Overview
    • Group Management
    • Group Profile
    • Group Member Management
    • Group Member Profile
    • Custom Group Attribute
    • Group Counter
  • Community Topic
    • Community Management
  • User Profile and Relationship Chain
    • User Profile
    • User Status
    • Friend Management
    • Friend Group
    • Block List
  • Guideline for Beginners
  • Console Guide
    • Creating and Upgrading an Application
    • Basic Configuration
    • Feature Configuration
    • Account Management
    • Group Management
    • Webhook Configuration
  • Product Introduction
    • Message Management
      • One-to-One Message
      • Message Storage
      • Offline Push
      • Group Message
      • Message Formats
    • Account System
      • Login Authentication
      • Online Status Management
    • Group Related
      • Group System
      • Group Management
    • User Profile and Relationship Chain
      • Profile Management
      • Relationship Chain Management
  • Purchase Guide
    • Billing Overview
    • Pricing
  • Error Codes

Delete Messages

Feature Description

After a message is deleted successfully, its isDeleted is true. In one-to-one conversations, deleted messages cannot be pulled on the next login, but the receiver will not be affected. In group conversations, deleted messages cannot be pulled on the next login, but other group members will not be affected.
Note
1. Up to 30 messages can be deleted at a time. If more than 30 messages are selected, the first 30 messages will be deleted.
2. Messages to be deleted must be from the same conversation, that is, the conversation of the first message in the message list.
3. This API can be called only once per second.
4. Deleted messages are not synced.
5. Messages cannot be deleted from audio-video groups (AVChatRoom), and if you call this API, the error code 10035 will be returned.
API
chat.deleteMessage(messageList);
Parameter
Name
Type
Description
messageList
Array
List of messages (up to 30) in the same conversation
Returned value
Promise
Sample
let promise = chat.deleteMessage([message1, message2, message3, ...]);
promise.then(function(imResponse) {
// Messages deleted successfully
}).catch(function(imError) {
// Failed to delete the messages
console.warn('deleteMessage error:', imError);
});