On this page

Delete messages

Delete() permanently removes a message from Message Persistence or marks it as deleted (soft delete).

Requires Message Persistence

Enable Message Persistence and Enable Delete-From-History in the Admin Portal.

Method signature

This method takes the following parameters:

1message.Delete(bool soft = false)

Input

* required
ParameterDescription
soft
Type: bool
Default:
false
Define if you want to permanently remove message data. By default, the message data gets permanently deleted from Message Persistence. If you set this parameter to true, the message's IsDeleted property is set to true, and you can still restore/get its data.

Output

TypeDescription
Task<ChatOperationResult>
Returned Task that you can await to get the result of the delete operation.

Sample code

Permanently delete the message with the 16200000000000001 timetoken from the support channel.

1

Other examples

Archive (soft delete) the message with the 16200000000000001 timetoken from the support channel, keeping its data in Message Persistence.

1

Last updated on