Skip to main content
Version: 5.7.0

SysDeleteChatMessage

tip

This method is available in Cloud Code scripts only.

Delete the specified chat message. Message can be from any user (or the system). Version must match (or pass -1 to bypass version enforcement).

Returns the number of messages that were deleted. Since the history rolls over, it is possible that the message had already expired before the deletion attempt - in that case, the value of the deleted field will be 0.

ServiceOperation
chatSYS_DELETE_CHAT_MESSAGE

Method Parameters

ParameterDescription
channelIdThe channel of the message
msgIdThe message id
versionThe version of the message. Pass it -1 to bypass version checking.

Usage

http://localhost:3000
// Cloud Code only. To view example, switch to the Cloud Code tab
JSON Response
{
"status": 200,
"data": {
"deleted": 1
}
}
Common Error Code

Status Codes

CodeNameDescription
40346CHAT_INVALID_CHANNEL_IDThe channel id provided is invalid.
40601RTT_NOT_ENABLEDRTT must be enabled for this feature
40616CLOUD_CODE_ONLYMethod only available via cloud code